Package com.iizigo.text
Class TextTableEditor
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
com.iizigo.editor.PropEditorPart
com.iizigo.text.TextTableEditor
- All Implemented Interfaces:
- IComplexOperationSelection,- IActivationListener,- IDraggingFix,- IWorkbenchPartIZ,- ISelectionEnablerHandler,- IPropertyEditorController,- IPropUndoContext,- IFilterListener,- EventListener,- IPropUndoRedo,- IKStringInfoProvider,- org.eclipse.core.runtime.IAdaptable,- org.eclipse.core.runtime.IExecutableExtension,- org.eclipse.jface.viewers.IDoubleClickListener,- org.eclipse.jface.viewers.ISelectionChangedListener,- org.eclipse.jface.viewers.ISelectionProvider,- org.eclipse.ui.ide.IGotoMarker,- org.eclipse.ui.IEditorPart,- org.eclipse.ui.INavigationLocationProvider,- org.eclipse.ui.IPersistable,- org.eclipse.ui.IPersistableEditor,- org.eclipse.ui.ISaveablePart,- org.eclipse.ui.ISaveablesSource,- org.eclipse.ui.IWorkbenchPart,- org.eclipse.ui.IWorkbenchPart2,- org.eclipse.ui.IWorkbenchPart3,- org.eclipse.ui.part.IWorkbenchPartOrientation
public class TextTableEditor extends PropEditorPart implements EventListener, org.eclipse.jface.viewers.IDoubleClickListener, IFilterListener, IKStringInfoProvider, ISelectionEnablerHandler, IComplexOperationSelection
The Style's Editor part.
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from class com.iizigo.editor.PropEditorPart- PropEditorPart.DragSourceDelegator
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe Part ID.- static final Class<?>[]Text table classes.- Fields inherited from class com.iizigo.editor.PropEditorPart- appUI, copyAction, copyFullPathAction, copyReferenceAction, cutAction, deleteAction, dslPaste, editedPropCnr, EMPTY, filePropCnr, fileResource, globalActionBars, ir, linkAction, moveAction, partSelection, pasteAction, pasteAfterAction, pasteBeforeAction, pasteLinkAction, printAction, propEventListener, redoAction, renameAction, restoreMemento, revertAction, rootPropCnr, saveAction, selectAllAction, selectionEnabler, tiPaste, toolBar, toolBar2, undoAction, updateSelectionAndStatesRunner- Fields inherited from interface org.eclipse.ui.IEditorPart- PROP_DIRTY, PROP_INPUT- Fields inherited from interface org.eclipse.ui.IWorkbenchPart- PROP_TITLE
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- protected void- createEditorComposite- (org.eclipse.swt.widgets.Composite parent) Creates the Editor Main Composite.- void- dispose()Disposes of editor.- booleanGets the flag for adding the reference string in an attribute when editing the KString.- void- doComplexOperationSelection- (GProp<?>[] props) Performs the selection of the components, typically after undo/redo.- booleanOpens the property by selecting it in focus.- booleanOpens the property by selecting it in focus.- void- doubleClick- (org.eclipse.jface.viewers.DoubleClickEvent event) Notifies of a double click in table.- double- getDPR()Gets the device pixel ratio.- getEditedTextTable- (int column) Gets the edited text table at specified column index.Gets the HTTP Server string prefix including port.- getImageTarget- (String ref) Gets the image reference.- GProp<?>Gets the property used for references look-up's.Gets the base reference name for the resource, typically an image, for the Server or the Designer.Override this method to return the initial selection that is suitable for restoring a selection using- doComplexOperationSelection(GProp []).Gets the language code to use.- protected void- initEditor- (PropCnr cnr) The initialize editor method.- boolean- installFont- (String fontFamily) Installs the font families as specified by the font family.- boolean- installFonts- (List<FontFiles> fontList) Installs the font face as specified by the- FontFilesinstance for the Client Session.- booleanChecks if this interface returns the selection before the operation takes place or not.- booleanChecks if the processing is active.- voidCalled to process an event.- protected void- onFileClosed- (FilePropCnr fpc) Called when an open file in the editor has been closed and needs to be removed.- voidCalled when a filter text has been applied.- static voidCalled when a text has changed and perhaps needs automatic translation to other tables.- protected voidCalled just in the beginning of updateStates() before selections are processed.- boolean- openInParallel- (String ref) Opens a text table in parallel.- voidPerforms Copy.- voidPerforms Cut.- voidPerforms Delete.- voidPerforms Paste.- protected voidPerforms Print.- booleanFlag indicating the "real" resolved string should be returned.- protected voidUpdates the states.- static String- validateTextID- (String id) Validates the Text ID.- Methods inherited from class com.iizigo.editor.PropEditorPart- addForDisposalAtDispose, addListener, addOpenFile, addSelectionChangedListener, addToolbar2PushButton, addToolbar2PushButton, addToolbar2Separator, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarSeparator, addToolbarSeparator, closeFile, createCommonViewer, createEmptyNavigationLocation, createFilteredCommonViewer, createFilteredCommonViewer, createLicenseExceptionComposite, createMenu, createMenu, createNavigationLocation, createPartControl, doSave, doSaveAs, fireSelectionAndStates, getActiveEditor, getActiveEditor, getActivePart, getActiveSaveables, getAdapter, getCurrentTreeViewer, getEditors, getExtension, getLicenseException, getModuleModel, getMultiSelectionProvider, getPartComposite, getPartName, getRedoAction, getSaveables, getSelection, getSelectionEnabler, getShell, getSyntClipboardSelection, getTargetViewer, getTitleImage, getTitleToolTip, getTitleToolTip, getTopmostEditor, getUndoAction, getUndoContext, getUndoRedo, gotoMarker, hasInitError, init, invalidLicense, isDirty, isDisposed, isDragging, isSaveAsAllowed, isSaveOnCloseNeeded, onActivated, onClose, onCloseProject, onComponentFocus, onDragBegin, onDragEnd, onEditedPropertyChangedForVerify, onEditorActivated, onEditorReady, onPartRenamed, onSetFocus, performCollapseAll, performCopyFullPath, performCopyReference, performExpandAll, performLink, performMove, performPasteAfter, performPasteBefore, performPasteLink, performRedo, performRename, performRevert, performSave, performSelectAll, performUndo, postAsyncUpdateStates, proceedInit, proceedInitProperty, refreshViewers, registerFormControl, registerViewer, registerViewer, removeListener, removePropertyValue, removeSelectionChangedListener, restoreMemento, restoreState, saveState, saveStateImpl, selectionChanged, selectionChangedEx, setActionsUndoContext, setBlockViewerFocus, setFocus, setFocus, setInput, setPropertyAttrFlag, setPropertyError, setPropertyValue, setSelection, setTargetViewer, supportsCopyFullPath, supportsCopyReference, updateAllStates, updateStates, updateStatesPasteBeforeAfter, updateTitle, usePasteBeforeAfter, verifyDirtyStateChanged- Methods inherited from class org.eclipse.ui.part.EditorPart- checkSite, getEditorInput, getEditorSite, setContentDescription, setInitializationData, setInputWithNotify, setPartName- Methods inherited from class org.eclipse.ui.part.WorkbenchPart- addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy- Methods inherited from class org.eclipse.core.commands.common.EventManager- addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait- Methods inherited from interface com.iizigo.editor.complex.IComplexOperationSelection- isDisposed- Methods inherited from interface com.iizix.text.IKStringInfoProvider- installFonts- Methods inherited from interface org.eclipse.ui.IWorkbenchPart- addPropertyListener, getSite, getTitle, removePropertyListener- Methods inherited from interface com.iizigo.editor.IWorkbenchPartIZ- onComponentFocused
- Field Details- TEXT_TABLE_CLASSESText table classes.
- IDThe Part ID.
 
- Constructor Details- TextTableEditorpublic TextTableEditor()Eclipse constructor.
 
- Method Details- initEditorThe initialize editor method.- Subclasses may override this method. - Overrides:
- initEditorin class- PropEditorPart
- Parameters:
- cnr- The property container being edited. Note: the real name of the property is in the parent FilePropCnr Atom.
- Throws:
- org.eclipse.ui.PartInitException- For initialization failures.
 
- disposepublic void dispose()Disposes of editor.- Specified by:
- disposein interface- org.eclipse.ui.IWorkbenchPart
- Overrides:
- disposein class- PropEditorPart
 
- getEditedTextTableGets the edited text table at specified column index.
- onUpdateStatesprotected void onUpdateStates()Called just in the beginning of updateStates() before selections are processed. Override as required.- Overrides:
- onUpdateStatesin class- PropEditorPart
 
- updateStatesExprotected void updateStatesEx()Updates the states.- Overrides:
- updateStatesExin class- PropEditorPart
 
- createEditorCompositeprotected void createEditorComposite- (org.eclipse.swt.widgets.Composite parent) Creates the Editor Main Composite.- Specified by:
- createEditorCompositein class- PropEditorPart
- Parameters:
- parent- The empty parent composite without initialized layout, with the widget background color.
 
- validateTextIDValidates the Text ID.- Returns:
- error message, null for OK.
 
- doOpenOpens the property by selecting it in focus.- Overrides:
- doOpenin class- PropEditorPart
- Parameters:
- prop- The property to focus.
- index- The index in a multi-property.
- childName- Name of child property or null.
- Returns:
- true for success, false for failure.
 
- doOpenOpens the property by selecting it in focus.- Overrides:
- doOpenin class- PropEditorPart
 
- getHTTPServerGets the HTTP Server string prefix including port.- Specified by:
- getHTTPServerin interface- IKStringInfoProvider
- Returns:
- The "HTTP[S]//server[:port]" String or null for none.
 
- getImageTargetGets the image reference.- Specified by:
- getImageTargetin interface- IKStringInfoProvider
- Parameters:
- ref- The image definition reference string.
- Returns:
- The image found, or null if not found.
 
- doAddReferencepublic boolean doAddReference()Gets the flag for adding the reference string in an attribute when editing the KString.- Specified by:
- doAddReferencein interface- IKStringInfoProvider
- Returns:
- true for the Designer (will add additional parameters for the rich text editor), false for normal processing.
 
- shouldResolvepublic boolean shouldResolve()Flag indicating the "real" resolved string should be returned. This value is true for the runtime client when in "real run mode".- Specified by:
- shouldResolvein interface- IKStringInfoProvider
- Returns:
- true to resolve all references, false if inside e.g. the Designer.
 
- getResolveReferencePropertyGets the property used for references look-up's.- Specified by:
- getResolveReferencePropertyin interface- IKStringInfoProvider
- Returns:
- The property to use for reference property look-up.
 
- getDPRpublic double getDPR()Gets the device pixel ratio.- Specified by:
- getDPRin interface- IKStringInfoProvider
- Returns:
- The device pixel ratio, default 1.0.
 
- getTargetLanguageCodeGets the language code to use.- Specified by:
- getTargetLanguageCodein interface- IKStringInfoProvider
- Returns:
- The language code, or null for default.
 
- getResourcePrefixGets the base reference name for the resource, typically an image, for the Server or the Designer. This reference is "/$" (the default in this interface) for the Designer, but should be "/$APPID/" for the Server, where APPID is the application being run by the client. The Server must therefore implement this method and return that string instead.- Specified by:
- getResourcePrefixin interface- IKStringInfoProvider
- Returns:
- The resource prefix string, "/$" by default, but "/$APPID/" for the Server,' where APPID is the application being run by the client.
 
- installFontInstalls the font families as specified by the font family.- Specified by:
- installFontin interface- IKStringInfoProvider
- Parameters:
- fontFamily- The font family or families.
- Returns:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
 
- installFontsInstalls the font face as specified by the- FontFilesinstance for the Client Session. Once installed, the font family can be used.- Specified by:
- installFontsin interface- IKStringInfoProvider
- Parameters:
- fontList- The list of font files to install.
- Returns:
- true for success, false if the remote part doesn't support installation, e.g. in a preview browser.
 
- onFilterCalled when a filter text has been applied.- Specified by:
- onFilterin interface- IFilterListener
- Parameters:
- text- The filter text to apply, null for none (never empty string).
 
- onEventCalled to process an event.- Specified by:
- onEventin interface- EventListener
- Parameters:
- event- The event.
 
- performPrintprotected void performPrint()Performs Print.- Specified by:
- performPrintin class- PropEditorPart
 
- doubleClickpublic void doubleClick- (org.eclipse.jface.viewers.DoubleClickEvent event) Notifies of a double click in table.- Specified by:
- doubleClickin interface- org.eclipse.jface.viewers.IDoubleClickListener
- Parameters:
- event- event object describing the double-click
 
- openInParallelOpens a text table in parallel.- Parameters:
- ref- The reference.
- Returns:
- true for success, false for failure.
 
- onFileClosedCalled when an open file in the editor has been closed and needs to be removed. This is called in the SWT thread. This call is not done for the main file of this editor, but secondary files. For the main file, the editor is closed directory.- Subclasses with multiple files override this method. - Overrides:
- onFileClosedin class- PropEditorPart
- Parameters:
- fpc- The file closed.
 
- isSelectionEnablerProcessingEnabledChecks if the processing is active.- Specified by:
- isSelectionEnablerProcessingEnabledin interface- ISelectionEnablerHandler
- Parameters:
- se- The selection enabler instance that should be updated.
- Returns:
- The processing enabled flag: true = processed, false = process as default.
 
- isReturningSelectionBeforeOperationpublic boolean isReturningSelectionBeforeOperation()Checks if this interface returns the selection before the operation takes place or not.- Specified by:
- isReturningSelectionBeforeOperationin interface- IComplexOperationSelection
- Returns:
- false, must be overridden to return the selection before.
 
- getSelectionBeforeOverride this method to return the initial selection that is suitable for restoring a selection using- doComplexOperationSelection(GProp []).- Specified by:
- getSelectionBeforein interface- IComplexOperationSelection
- Parameters:
- op- The complex operation.
- Returns:
- The selection that can be restored, null for none.
 
- doComplexOperationSelectionPerforms the selection of the components, typically after undo/redo.- Specified by:
- doComplexOperationSelectionin interface- IComplexOperationSelection
 
- performCopypublic void performCopy()Performs Copy.- Overrides:
- performCopyin class- PropEditorPart
 
- performCutpublic void performCut()Performs Cut.- Overrides:
- performCutin class- PropEditorPart
 
- performPastepublic void performPaste()Performs Paste.- Overrides:
- performPastein class- PropEditorPart
 
- performDeletepublic void performDelete()Performs Delete.- Overrides:
- performDeletein class- PropEditorPart
 
- onKStringPropChangedCalled when a text has changed and perhaps needs automatic translation to other tables. It is assumed that the "ksp" property is valid and is owned by "tt".- Parameters:
- tt- The text table.
- ksp- The property.