Class PropEditorPart
- All Implemented Interfaces:
- IActivationListener,- IDraggingFix,- IWorkbenchPartIZ,- IPropertyEditorController,- IPropUndoContext,- IPropUndoRedo,- org.eclipse.core.runtime.IAdaptable,- org.eclipse.core.runtime.IExecutableExtension,- 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
- Direct Known Subclasses:
- CaptureEditor,- ContextMenuEditor,- DatabaseEditor,- FontFacesEditor,- ImageDefinitionEditor,- PanelEditor,- RecordingEditor,- ScreenEditor,- SelectorEditor,- StyleEditor,- TextTableEditor,- VirtualSpaceEditor,- WebServiceEditor
- Author:
- Christopher Mindus
- Nested Class SummaryNested ClassesModifier and TypeClassDescription- protected final classClass used to delegate DragSource events to the listener, making it possible to know when drag-drop is in effect.
- Field SummaryFieldsModifier and TypeFieldDescription- protected ApplicationUIThe Application UI.- protected PartActionMenu actions.- protected PartAction- protected PartActionMenu actions that MAY be null in case they are not supported.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected DropdownSelectionListener- protected PropCnrThe edited property inside the- filePropCnr.- static final PropEditorPart[]Empty array.- protected FilePropCnrThe File Property being edited, null for none.- protected org.eclipse.core.resources.IFileThe file resource for the editor.- protected org.eclipse.ui.IActionBarsThe global action bars.- protected final ImageRegistryThe Image Registry.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected org.eclipse.jface.viewers.IStructuredSelectionThis part's current selection.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected final EventListenerProperty event listener.- protected org.eclipse.ui.operations.RedoActionHandler- protected PartActionMenu actions.- protected org.eclipse.ui.IMementoThe restored memento.- protected PartActionMenu actions.- protected PropCnrThe (Module) root container used to listen to events, null when not used.- protected PartActionMenu actions.- protected PartActionMenu actions.- protected SelectionEnablerThe last selection states.- protected org.eclipse.swt.widgets.ToolItemPaste items.- protected org.eclipse.swt.widgets.ToolBarThe tool bar.- protected org.eclipse.swt.widgets.ToolBarThe tool bar.- protected org.eclipse.ui.operations.UndoActionHandler- final RunnableThe update states runnable.- 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- addForDisposalAtDispose- (Object disposable) Adds an action that is disposed when the editor is disposed of.- static boolean- addListener- (ILicenseSystemError listener) Adds a dispose listener for the client session.- protected void- addOpenFile- (FilePropCnr fpc) Adds an open file.- void- addSelectionChangedListener- (org.eclipse.jface.viewers.ISelectionChangedListener listener) Adds a listener for selection changes in this selection provider.- protected org.eclipse.swt.widgets.ToolItem- addToolbar2PushButton- (String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- protected void- addToolbar2PushButton- (org.eclipse.jface.action.IAction action) Adds a push button to the second tool bar from an action.- protected voidAdds a separator to the second tool bar.- protected org.eclipse.swt.widgets.ToolItem- addToolbarPushButton- (String tooltip, String icon, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- protected org.eclipse.swt.widgets.ToolItem- addToolbarPushButton- (String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- protected void- addToolbarPushButton- (org.eclipse.jface.action.IAction action) Adds a tool bar push button from an action.- static org.eclipse.swt.widgets.ToolItem- addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, String icon, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- static org.eclipse.swt.widgets.ToolItem- addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, org.eclipse.swt.graphics.Image image, int style, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- static org.eclipse.swt.widgets.ToolItem- addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- void- addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, org.eclipse.jface.action.IAction action) Adds a tool bar push button from an action.- protected voidAdds a separator to the tool bar.- static void- addToolbarSeparator- (org.eclipse.swt.widgets.ToolBar toolBar) Adds a separator to the tool bar.- protected void- closeFile- (FilePropCnr fpc) Closed an open file.- final CommonViewerEx- createCommonViewer- (org.eclipse.swt.widgets.Composite parent) Creates the CommonViewer with extra support for Drag-and-Drop.- protected abstract void- createEditorComposite- (org.eclipse.swt.widgets.Composite parent) Creates the Editor Main Composite.- org.eclipse.ui.INavigationLocationCreates an empty navigation location.- final FilteredCommonViewer- createFilteredCommonViewer- (org.eclipse.swt.widgets.Composite parent, int style, IzFilter filter) Creates the Filtered CommonViewer with extra support for Drag-and-Drop.- final FilteredCommonViewer- createFilteredCommonViewer- (org.eclipse.swt.widgets.Composite parent, IzFilter filter) Creates the Filtered CommonViewer with extra support for Drag-and-Drop.- static org.eclipse.swt.widgets.Composite- createLicenseExceptionComposite- (org.eclipse.swt.widgets.Composite parent, String errorText) Creates an error composite from the license exception.- protected void- createMenu- (org.eclipse.jface.viewers.Viewer viewer, IContextMenuContributor contributor) Creates a menu that is used as a pop-up menu.- protected void- createMenu- (org.eclipse.swt.widgets.Control control, IContextMenuContributorFormControl<org.eclipse.swt.widgets.Control> contributor) Creates a menu that is used as a pop-up menu.- org.eclipse.ui.INavigationLocationCreates a navigation location describing the current state.- final void- createPartControl- (org.eclipse.swt.widgets.Composite parent) Create contents of the editor part.- void- dispose()Disposes of the Editor.- booleanOpens the property by selecting it in focus.- booleanOpens the property by selecting it in focus.- void- doSave- (org.eclipse.core.runtime.IProgressMonitor monitor) Saves the contents of this part.- final void- doSaveAs()Saves the contents of this part to another object.- voidFires a new selection event that also updates the states.- static PropEditorPartGets the active editor part.- static PropEditorPart- getActiveEditor- (GProp<?> prop) Gets the active or topmost editor from a property.- static PropEditorPartGets the active part, differs from- getActiveEditor()because it check if e.g.- org.eclipse.ui.Saveable[]- <T> T- getAdapter- (Class<T> adapter) - protected org.eclipse.jface.viewers.TreeViewerGets the current tree viewer.- static PropEditorPart[]Gets a snapshot of the editor parts.The extensions framework.- static LicenseExceptionGets the potential license exception that occurred when loading it.Gets the ModuleModel instance of the project.- final MultiSelectionProviderGets the multi-property selection provider.- org.eclipse.swt.widgets.CompositeGets the part composite created.- protected String- getPartName- (String title) Gets the part name that is about to be set.- org.eclipse.ui.operations.RedoActionHandlerGets the undo action.- org.eclipse.ui.Saveable[]- org.eclipse.jface.viewers.ISelectionReturns the current selection for this provider.Gets the selection enabler instance.- final org.eclipse.swt.widgets.Shell- getShell()Gets the shell.Gets the current IClipboardSelection implementor.Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- org.eclipse.swt.graphics.ImageReturns the workbench part image.Returns the title tooltip.- protected String- getTitleToolTip- (String title) Gets the part name that is about to be set.- static PropEditorPart- getTopmostEditor- (PropEditorPart[] editors) Gets the topmost editor part from an array of editors.- org.eclipse.ui.operations.UndoActionHandlerGets the undo action.- final org.eclipse.core.commands.operations.IUndoContextGets the undo context.- final IPropUndoRedoGets the undo/redo interface.- void- gotoMarker- (org.eclipse.core.resources.IMarker marker) Sets the cursor and selection state for an editor to reveal the position of the given marker.- booleanFlag for initialize error, i.e.- final void- init- (org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) Initializes this editor with the given editor site and input.- protected void- initEditor- (PropCnr cnr) The initialize editor method.- static voidCalled from the SWT thread if the license is not valid.- boolean- isDirty()Returns whether the contents of this part have changed since the last save operation.- booleanChecks if the part is disposed of.- booleanFlag for dragging to postpone selection events until drag completes.- final booleanReturns whether the "Save As" operation is supported by this part.- booleanReturns whether the contents of this editor should be saved when the editor is closed.- final void- onActivated- (boolean on) Called when activator or deactivated.- void- onClose()Called when the part is being closed but is not yet disposed but hidden.- static void- onCloseProject- (org.eclipse.core.resources.IProject project) Called when a project is closed or unregistered from being a Module project.- void- onComponentFocus- (org.eclipse.swt.widgets.Control c) Called by the workbench extension when focus is received.- protected voidDrag started.- protected voidDrag finished.- protected voidCalled when verification listener gets called for verify, very commonly in a non-SWT thread.- protected void- onEditorActivated- (boolean on) Called when the editor is activated or deactivated.- protected voidFunction called once the Editor has been initialized and fully created, should be overridden by Editor parts that need such functionality.- protected void- onFileClosed- (FilePropCnr fpc) Called when an open file in the editor has been closed and needs to be removed.- protected voidCalled when the part has been renamed.- protected voidCalled when set focus is called to override default processing.- protected voidCalled just in the beginning of updateStates() before selections are processed.- protected voidPerforms move up.- voidPerforms Copy.- protected boolean- performCopyFullPath- (boolean doPerform) Copies the full path.- protected boolean- performCopyReference- (boolean doPerform) Copies the reference.- voidPerforms Cut.- voidPerforms Delete.- protected voidPerforms move down.- voidPerforms Link.- voidPerforms Move.- voidPerforms Paste.- voidPerforms Paste Before.- voidPerforms Paste Before.- voidPerforms Paste-link.- protected abstract voidPerforms Print.- voidPerforms Redo.- protected voidPerforms Rename.- protected voidPerforms Revert.- protected voidPerforms Save.- final voidPerforms Select All.- voidPerforms Undo.- protected final voidPost an async updateStates event (once only in one "SWT cycle").- protected voidContinues the "init".- protected voidProceeds initializing the editor with the property.- voidRefreshes all registered viewers before e.g.- void- registerFormControl- (org.eclipse.swt.widgets.Control control) Registers a form entry capable control in the Editor part.- protected void- registerViewer- (org.eclipse.jface.viewers.StructuredViewer viewer, int index) Registers a viewer for selection changes.- void- registerViewer- (org.eclipse.jface.viewers.StructuredViewer viewer, int index, IContextMenuContributor contributor) Registers a viewer for selection changes.- static boolean- removeListener- (ILicenseSystemError listener) Removes a dispose listener for the client session.- void- removePropertyValue- (GProp<?> property) Removes a property when undefined in the editors.- void- removeSelectionChangedListener- (org.eclipse.jface.viewers.ISelectionChangedListener listener) Removes the given selection change listener from this selection provider.- protected voidCalled to perform the restoring of the Memento state.- final void- restoreState- (org.eclipse.ui.IMemento memento) Called with a memento for this editor.- final void- saveState- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- protected void- saveStateImpl- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- final void- selectionChanged- (org.eclipse.jface.viewers.SelectionChangedEvent event) Selection changes in the tree.- protected void- selectionChangedEx- (org.eclipse.jface.viewers.SelectionChangedEvent event) Selection changes in the tree.- void- setActionsUndoContext- (org.eclipse.core.commands.operations.IUndoContext undoContext) Assigns another undo context to the undo/redo actions.- void- setBlockViewerFocus- (boolean block) Blocks the target viewer from focus.- final void- setFocus()Sets focus to the Editor.- protected int- setFocus- (PropCnr container, org.eclipse.jface.viewers.StructuredViewer viewer, IzFilter filter, PropertyEditor propertyEditor, GProp<?> property, int index, String childName) Attempts to set focus to the property in question based on a container, a viewer and a property editor.- void- setInput- (org.eclipse.ui.IEditorInput input) Sets the input to this editor.- void- setPropertyAttrFlag- (GProp<?> property, int attr, boolean flag) Sets a property attribute flag.- void- setPropertyError- (GProp<?> property, String errorID, IPropErrorItem item) Sets a property error.- void- setPropertyValue- (PropCnr parent, GProp<?> property, Object value) Sets a property value.- void- setSelection- (org.eclipse.jface.viewers.ISelection selection) Sets the current selection for this selection provider.- final void- setTargetViewer- (Object viewer) Sets the target viewer for e.g.- protected booleanReturns if the Copy path should be present or not.- protected booleanReturns if the Copy reference should be present or not.- static voidUpdates the states of all created editors.- final voidUpdate states of the menu and tool bars, both global and part-local ones.- protected voidUpdate states of the menu and tool bars, both global and part-local ones.- protected voidProcess update states for pasteBeforeAction and pasteAfterAction.- protected voidUpdates the title and tooltip when file name/contents changes.- protected booleanOverride to return how paste before/after are processed.- voidVerifies the dirty and fires state changed as required.- 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 org.eclipse.ui.IWorkbenchPart- addPropertyListener, getSite, getTitle, removePropertyListener- Methods inherited from interface com.iizigo.editor.IWorkbenchPartIZ- onComponentFocused
- Field Details- EMPTYEmpty array.
- rootPropCnrThe (Module) root container used to listen to events, null when not used.
- fileResourceprotected org.eclipse.core.resources.IFile fileResourceThe file resource for the editor.
- filePropCnrThe File Property being edited, null for none.
- editedPropCnrThe edited property inside the- filePropCnr.
- toolBarprotected org.eclipse.swt.widgets.ToolBar toolBarThe tool bar.
- toolBar2protected org.eclipse.swt.widgets.ToolBar toolBar2The tool bar.
- partSelectionprotected org.eclipse.jface.viewers.IStructuredSelection partSelectionThis part's current selection.
- selectionEnablerThe last selection states.
- cutActionMenu actions.
- copyActionMenu actions.
- pasteActionMenu actions.
- pasteBeforeActionMenu actions.
- pasteAfterActionMenu actions.
- pasteLinkActionMenu actions.
- deleteActionMenu actions.
- selectAllActionMenu actions.
- revertActionMenu actions.
- saveActionMenu actions.
- renameActionMenu actions.
- moveActionMenu actions.
- linkActionMenu actions.
- printActionMenu actions.
- copyReferenceActionMenu actions that MAY be null in case they are not supported.
- copyFullPathAction
- undoActionprotected org.eclipse.ui.operations.UndoActionHandler undoAction
- redoActionprotected org.eclipse.ui.operations.RedoActionHandler redoAction
- tiPasteprotected org.eclipse.swt.widgets.ToolItem tiPastePaste items.
- dslPaste
- globalActionBarsprotected org.eclipse.ui.IActionBars globalActionBarsThe global action bars.
- irThe Image Registry.
- appUIThe Application UI.
- restoreMementoprotected org.eclipse.ui.IMemento restoreMementoThe restored memento.- Note that - restoreMementomay be- null.
- propEventListenerProperty event listener.
- updateSelectionAndStatesRunnerThe update states runnable.
 
- Constructor Details- PropEditorPartConstructor.- Parameters:
- propertyClass- The property class in files.
 
 
- Method Details- getEditorsGets a snapshot of the editor parts.
- updateAllStatespublic static void updateAllStates()Updates the states of all created editors.
- getActiveEditorGets the active editor part.- Returns:
- The active editor part, or null for none.
 
- getActiveEditorGets the active or topmost editor from a property.- Returns:
- null if none is found.
 
- getTopmostEditorGets the topmost editor part from an array of editors.- Parameters:
- editors- Selection of editors to choose from, in the order of first created editor.
- Returns:
- The topmost editor, or null if no editor is found (editors array is empty).
 
- getActivePartGets the active part, differs from- getActiveEditor()because it check if e.g. a Common Navigator is active...- Returns:
- The active editor part, or null for none.
 
- onCloseProjectpublic static void onCloseProject- (org.eclipse.core.resources.IProject project) Called when a project is closed or unregistered from being a Module project. This closes the editors for it!
- addListenerAdds a dispose listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeListenerRemoves a dispose listener for the client session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- invalidLicenseCalled from the SWT thread if the license is not valid.- Parameters:
- e- The license exception.
 
- getLicenseExceptionGets the potential license exception that occurred when loading it.- Returns:
- The license exception, or null for OK (or License System not yet loaded).
 
- createLicenseExceptionCompositepublic static org.eclipse.swt.widgets.Composite createLicenseExceptionComposite- (org.eclipse.swt.widgets.Composite parent, String errorText) Creates an error composite from the license exception.- Parameters:
- parent- The parent composite.
- errorText- The error text to use if there is no license exception.
- Returns:
- The error composite, or null for no exception and no error text.
 
- addForDisposalAtDisposeAdds an action that is disposed when the editor is disposed of.
- getMultiSelectionProviderGets the multi-property selection provider.- Specified by:
- getMultiSelectionProviderin interface- IPropertyEditorController
 
- getExtensionThe extensions framework.- Specified by:
- getExtensionin interface- IWorkbenchPartIZ
 
- getSelectionEnablerGets the selection enabler instance.- Specified by:
- getSelectionEnablerin interface- IWorkbenchPartIZ
 
- onEditorActivatedprotected void onEditorActivated- (boolean on) Called when the editor is activated or deactivated.
- addOpenFileAdds an open file. This method should be called when e.g. the text table editor opens a parallel text table for editing.
- closeFileClosed an open file. This method should be called when e.g. the text table editor opens a parallel text table for editing.
- initpublic final void init- (org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException Initializes this editor with the given editor site and input.- This method is automatically called shortly after the part is instantiated. It marks the start of the part's life cycle. The IWorkbenchPart.dispose method will be called automatically at the end of the life cycle. Clients must not call this method. - Implementors of this method must examine the editor input object type to determine if it is understood. If not, the implementor must throw a PartInitException. - The initEditor method is called once initialized. - Specified by:
- initin interface- org.eclipse.ui.IEditorPart
- Specified by:
- initin class- org.eclipse.ui.part.EditorPart
- Throws:
- org.eclipse.ui.PartInitException- For initialization failures.
 
- hasInitErrorpublic boolean hasInitError()Flag for initialize error, i.e. if there is a PartInitException in the postponed call.
- onEditorReadyprotected void onEditorReady()Function called once the Editor has been initialized and fully created, should be overridden by Editor parts that need such functionality. By default nothing is done in this method.
- proceedInitprotected void proceedInit() throws org.eclipse.ui.PartInitExceptionContinues the "init". This method can be overridden by editors that are not file property based such as the capture editor.- Throws:
- org.eclipse.ui.PartInitException
 
- proceedInitPropertyProceeds initializing the editor with the property.- Throws:
- org.eclipse.ui.PartInitException
 
- getPartCompositepublic org.eclipse.swt.widgets.Composite getPartComposite()Gets the part composite created.- Returns:
- The part composite, null if not yet created.
 
- updateTitleprotected void updateTitle()Updates the title and tooltip when file name/contents changes.
- getTitleToolTipReturns the title tooltip.- Specified by:
- getTitleToolTipin interface- org.eclipse.ui.IWorkbenchPart
- Overrides:
- getTitleToolTipin class- org.eclipse.ui.part.EditorPart
 
- getTitleImagepublic org.eclipse.swt.graphics.Image getTitleImage()Returns the workbench part image.- Specified by:
- getTitleImagein interface- org.eclipse.ui.IWorkbenchPart
- Overrides:
- getTitleImagein class- org.eclipse.ui.part.WorkbenchPart
 
- getPartNameGets the part name that is about to be set. Override to provide an other title.
- getTitleToolTipGets the part name that is about to be set. Override to provide an other title.
- setInputpublic void setInput- (org.eclipse.ui.IEditorInput input) Sets the input to this editor.- Note: Clients must fire the - IEditorPart.PROP_INPUTproperty change within their implementation of- setInput().- Overrides:
- setInputin class- org.eclipse.ui.part.EditorPart
- Parameters:
- input- The editor input.
 
- getModuleModelGets the ModuleModel instance of the project.- Specified by:
- getModuleModelin interface- IPropertyEditorController
- Returns:
- The ModuleModel of the project, null if not yet loaded.
 
- 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. - Parameters:
- fpc- The file closed.
 
- onPartRenamedCalled when the part has been renamed. Subclasses override this method to handle changes in property names if the property e.g. is in a tree.
- initEditorThe initialize editor method.- Subclasses may override this method. - 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.
 
- onClosepublic void onClose()Called when the part is being closed but is not yet disposed but hidden.- Specified by:
- onClosein interface- IActivationListener
 
- isSaveOnCloseNeededpublic boolean isSaveOnCloseNeeded()Returns whether the contents of this editor should be saved when the editor is closed.- This method always returns - falsebecause the IIZI saveables mechanism is somewhat different and saves when workspace exits.- Specified by:
- isSaveOnCloseNeededin interface- org.eclipse.ui.ISaveablePart
- Overrides:
- isSaveOnCloseNeededin class- org.eclipse.ui.part.EditorPart
 
- disposepublic void dispose()Disposes of the Editor.- Specified by:
- disposein interface- org.eclipse.ui.IWorkbenchPart
- Overrides:
- disposein class- org.eclipse.ui.part.WorkbenchPart
 
- isDisposedpublic boolean isDisposed()Checks if the part is disposed of.- Specified by:
- isDisposedin interface- IActivationListener
- Specified by:
- isDisposedin interface- IPropertyEditorController
- Specified by:
- isDisposedin interface- IWorkbenchPartIZ
- Returns:
- true if disposed of, false otherwise.
 
- restoreStatepublic final void restoreState- (org.eclipse.ui.IMemento memento) Called with a memento for this editor. The editor can parse the data or save the memento. This method may not be called.- Specified by:
- restoreStatein interface- org.eclipse.ui.IPersistableEditor
- Parameters:
- memento- the saved state for this editor. May be- null.
 
- restoreMementoprotected void restoreMemento()Called to perform the restoring of the Memento state. When this method is called, the subclass can get the memento using the protected variable- restoreMemento.- Note that - restoreMementomay be- null.
- saveStatepublic final void saveState- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- Subclasses may extend this method. - Specified by:
- saveStatein interface- org.eclipse.ui.IPersistable
- Parameters:
- memento- The storage area for object's state.
 
- saveStateImplprotected void saveStateImpl- (org.eclipse.ui.IMemento memento) Saves the state of the object in the given memento.- Subclasses should override this method to provide support. - Parameters:
- memento- The storage area for object's state.
 
- addSelectionChangedListenerpublic void addSelectionChangedListener- (org.eclipse.jface.viewers.ISelectionChangedListener listener) Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.- Specified by:
- addSelectionChangedListenerin interface- org.eclipse.jface.viewers.ISelectionProvider
- Parameters:
- listener- a selection changed listener
 
- removeSelectionChangedListenerpublic void removeSelectionChangedListener- (org.eclipse.jface.viewers.ISelectionChangedListener listener) Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.- Specified by:
- removeSelectionChangedListenerin interface- org.eclipse.jface.viewers.ISelectionProvider
- Parameters:
- listener- a selection changed listener
 
- getSelectionpublic org.eclipse.jface.viewers.ISelection getSelection()Returns the current selection for this provider.- Specified by:
- getSelectionin interface- org.eclipse.jface.viewers.ISelectionProvider
- Returns:
- the current selection
 
- setSelectionpublic void setSelection- (org.eclipse.jface.viewers.ISelection selection) Sets the current selection for this selection provider.- Specified by:
- setSelectionin interface- org.eclipse.jface.viewers.ISelectionProvider
- Parameters:
- selection- the new selection
 
- addToolbarPushButtonpublic static org.eclipse.swt.widgets.ToolItem addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, org.eclipse.swt.graphics.Image image, int style, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- Parameters:
- toolBar- The tool bar.
- tooltip- The tool-tip text of the tool bar button.
- image- The image to use for the tool bar button.
- style- The style: SWT.PUSH, SWT.CHECK, etc...
- listener- The listener for the tool bar button.
 
- addToolbarPushButtonpublic static org.eclipse.swt.widgets.ToolItem addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- Parameters:
- toolBar- The tool bar.
- tooltip- The tool-tip text of the tool bar button.
- image- The image to use for the tool bar button.
- listener- The listener for the tool bar button.
 
- addToolbarPushButtonpublic static org.eclipse.swt.widgets.ToolItem addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, String tooltip, String icon, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- Parameters:
- toolBar- The tool bar.
- tooltip- The tool-tip text of the tool bar item.
- icon- The workbench predefined image name.
- listener- The listener for the tool bar button.
- Returns:
- The newly created tool bar button.
 
- addToolbarPushButtonprotected org.eclipse.swt.widgets.ToolItem addToolbarPushButton- (String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- Parameters:
- tooltip- The tool-tip text of the tool bar button.
- image- The image to use for the tool bar button.
- listener- The listener for the tool bar button.
 
- addToolbarPushButtonprotected org.eclipse.swt.widgets.ToolItem addToolbarPushButton- (String tooltip, String icon, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button.- Parameters:
- tooltip- The tool-tip text of the tool bar item.
- icon- The workbench predefined image name.
- listener- The listener for the tool bar button.
- Returns:
- The newly created tool bar button.
 
- addToolbarPushButtonpublic void addToolbarPushButton- (org.eclipse.swt.widgets.ToolBar toolBar, org.eclipse.jface.action.IAction action) Adds a tool bar push button from an action.- Parameters:
- toolBar- The tool bar.
- action- The action.
 
- addToolbarPushButtonprotected void addToolbarPushButton- (org.eclipse.jface.action.IAction action) Adds a tool bar push button from an action.- Parameters:
- action- The action.
 
- addToolbar2PushButtonprotected void addToolbar2PushButton- (org.eclipse.jface.action.IAction action) Adds a push button to the second tool bar from an action.- Parameters:
- action- The action.
 
- addToolbar2PushButtonprotected org.eclipse.swt.widgets.ToolItem addToolbar2PushButton- (String tooltip, org.eclipse.swt.graphics.Image image, org.eclipse.swt.widgets.Listener listener) Adds a tool bar push button to the second tool bar.- Parameters:
- tooltip- The tool-tip text of the tool bar button.
- image- The image to use for the tool bar button.
- listener- The listener for the tool bar button.
 
- addToolbarSeparatorpublic static void addToolbarSeparator- (org.eclipse.swt.widgets.ToolBar toolBar) Adds a separator to the tool bar.- Parameters:
- toolBar- The tool bar.
 
- addToolbarSeparatorprotected void addToolbarSeparator()Adds a separator to the tool bar.
- addToolbar2Separatorprotected void addToolbar2Separator()Adds a separator to the second tool bar.
- createPartControlpublic final void createPartControl- (org.eclipse.swt.widgets.Composite parent) Create contents of the editor part.- This method calls . - Specified by:
- createPartControlin interface- org.eclipse.ui.IWorkbenchPart
- Specified by:
- createPartControlin class- org.eclipse.ui.part.WorkbenchPart
- Parameters:
- parent- The parent composite.
 
- supportsCopyReferenceprotected boolean supportsCopyReference()Returns if the Copy reference should be present or not.- Returns:
- false indicates no such item should be present, true for maybe, depending on selection.
 
- supportsCopyFullPathprotected boolean supportsCopyFullPath()Returns if the Copy path should be present or not.- Returns:
- false indicates no such item should be present, true for maybe, depending on selection.
 
- usePasteBeforeAfterprotected boolean usePasteBeforeAfter()Override to return how paste before/after are processed.- Returns:
- true to handle before/after.
 
- createEditorCompositeprotected abstract void createEditorComposite- (org.eclipse.swt.widgets.Composite parent) Creates the Editor Main Composite.- Parameters:
- parent- The empty parent composite without initialized layout, with the widget background color.
 
- performCopyReferenceprotected boolean performCopyReference- (boolean doPerform) Copies the reference.- Parameters:
- doPerform- Flag to perform the action or just testing it.
- Returns:
- true for action enabled, false for disabled.
 
- performCopyFullPathprotected boolean performCopyFullPath- (boolean doPerform) Copies the full path.- Parameters:
- doPerform- Flag to perform the action or just testing it.
- Returns:
- true for action enabled, false for disabled.
 
- setActionsUndoContextpublic void setActionsUndoContext- (org.eclipse.core.commands.operations.IUndoContext undoContext) Assigns another undo context to the undo/redo actions.- Parameters:
- undoContext- The new undo context, or null to restore to the original one.
 
- getUndoActionpublic org.eclipse.ui.operations.UndoActionHandler getUndoAction()Gets the undo action.
- getRedoActionpublic org.eclipse.ui.operations.RedoActionHandler getRedoAction()Gets the undo action.
- registerFormControlpublic void registerFormControl- (org.eclipse.swt.widgets.Control control) Registers a form entry capable control in the Editor part.- Parameters:
- control- The control can be Text, Combo, CCombo, StyledText, Spinner.
 
- getShellpublic final org.eclipse.swt.widgets.Shell getShell()Gets the shell.- Specified by:
- getShellin interface- IPropUndoRedo
- Returns:
- An object castable to org.eclipse.swt.widgets.Shell.
 
- getUndoContextpublic final org.eclipse.core.commands.operations.IUndoContext getUndoContext()Gets the undo context.- Specified by:
- getUndoContextin interface- IPropertyEditorController
- Specified by:
- getUndoContextin interface- IPropUndoContext
- Specified by:
- getUndoContextin interface- IPropUndoRedo
- Returns:
- An object castable to org.eclipse.core.commands.operations.IUndoContext.
 
- getUndoRedoGets the undo/redo interface.- Specified by:
- getUndoRedoin interface- IPropertyEditorController
- Specified by:
- getUndoRedoin interface- IWorkbenchPartIZ
 
- isDirtypublic boolean isDirty()Returns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event with PROP_DIRTY.- Specified by:
- isDirtyin interface- org.eclipse.ui.ISaveablePart
- Specified by:
- isDirtyin class- org.eclipse.ui.part.EditorPart
 
- verifyDirtyStateChangedpublic void verifyDirtyStateChanged()Verifies the dirty and fires state changed as required.
- refreshViewerspublic void refreshViewers()Refreshes all registered viewers before e.g. a "doOpen" call to show a property when they have just been added.
- doOpenOpens the property by selecting it in focus. This method must be overridden.
- doOpenOpens the property by selecting it in focus. This method must be overridden.- Parameters:
- prop- The property to focus.
- index- The index in a multi-property.
- childName- The child property name or null.
- Returns:
- true for success, false for failure.
 
- doSavepublic void doSave- (org.eclipse.core.runtime.IProgressMonitor monitor) Saves the contents of this part.- If the save is successful, the part should fire a property changed event reflecting the new dirty state (PROP_DIRTY property). If the save is cancelled through user action, or for any other reason, the part should invoke setCancelled on the IProgressMonitor to inform the caller. - Specified by:
- doSavein interface- org.eclipse.ui.ISaveablePart
- Specified by:
- doSavein class- org.eclipse.ui.part.EditorPart
 
- doSaveAspublic final void doSaveAs()Saves the contents of this part to another object.- This is not supported. - Specified by:
- doSaveAsin interface- org.eclipse.ui.ISaveablePart
- Specified by:
- doSaveAsin class- org.eclipse.ui.part.EditorPart
 
- isSaveAsAllowedpublic final boolean isSaveAsAllowed()Returns whether the "Save As" operation is supported by this part.- Specified by:
- isSaveAsAllowedin interface- org.eclipse.ui.ISaveablePart
- Specified by:
- isSaveAsAllowedin class- org.eclipse.ui.part.EditorPart
- Returns:
- false, always.
 
- performUndopublic void performUndo()Performs Undo.
- performRedopublic void performRedo()Performs Redo.
- getSyntClipboardSelectionGets the current IClipboardSelection implementor.- Returns:
- null For none.
 
- performCopypublic void performCopy()Performs Copy.
- performCutpublic void performCut()Performs Cut.
- performPastepublic void performPaste()Performs Paste.
- performPasteBeforepublic void performPasteBefore()Performs Paste Before.
- performPasteAfterpublic void performPasteAfter()Performs Paste Before.
- performPasteLinkpublic void performPasteLink()Performs Paste-link.
- performDeletepublic void performDelete()Performs Delete.
- performSelectAllpublic final void performSelectAll()Performs Select All.
- performMovepublic void performMove()Performs Move.
- performLinkpublic void performLink()Performs Link.
- performPrintprotected abstract void performPrint()Performs Print.
- performRevertprotected void performRevert()Performs Revert.
- performSaveprotected void performSave()Performs Save.
- performRenameprotected void performRename()Performs Rename.
- getCurrentTreeViewerprotected org.eclipse.jface.viewers.TreeViewer getCurrentTreeViewer()Gets the current tree viewer.- Returns:
- null for none.
 
- performCollapseAllprotected void performCollapseAll()Performs move up.
- performExpandAllprotected void performExpandAll()Performs move down.
- selectionChangedpublic final void selectionChanged- (org.eclipse.jface.viewers.SelectionChangedEvent event) Selection changes in the tree. Once the selection has been processed, the- selectChangedEx(event)method is called.- Specified by:
- selectionChangedin interface- org.eclipse.jface.viewers.ISelectionChangedListener
 
- fireSelectionAndStatespublic void fireSelectionAndStates()Fires a new selection event that also updates the states.
- selectionChangedExprotected void selectionChangedEx- (org.eclipse.jface.viewers.SelectionChangedEvent event) Selection changes in the tree.- Subclasses should override this method to process selection changes. 
- updateStatespublic final void updateStates()Update states of the menu and tool bars, both global and part-local ones. The states are set according to the- selectionStatesmember variable class instance. To fine-tune the states in the- selectionStatesand further process other states, override the- updateStatesEx()method.- Specified by:
- updateStatesin interface- IActivationListener
- Specified by:
- updateStatesin interface- IPropUndoRedo
 
- onUpdateStatesprotected void onUpdateStates()Called just in the beginning of updateStates() before selections are processed. Override as required.
- updateStatesPasteBeforeAfterprotected void updateStatesPasteBeforeAfter()Process update states for pasteBeforeAction and pasteAfterAction. Override if other processing that the default is required, such as in the Panel Editor.
- postAsyncUpdateStatesprotected final void postAsyncUpdateStates()Post an async updateStates event (once only in one "SWT cycle").
- onEditedPropertyChangedForVerifyCalled when verification listener gets called for verify, very commonly in a non-SWT thread. This method does nothing by default and can be overridden to process the edited property container changes events.
- updateStatesExprotected void updateStatesEx()Update states of the menu and tool bars, both global and part-local ones. The states are set according to the- selectionStatesmember variable class instance.- To fine-tune the states in the - selectionStatesand further process other states, override this method.
- setPropertyValueSets a property value. The undo/redo functionality will wrap an undo/redo action for this function. This method handles setting a property value that is extended in the parent and the new property is to replace it in the parent.- Specified by:
- setPropertyValuein interface- IPropertyEditorController
 
- setPropertyErrorSets a property error. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- setPropertyErrorin interface- IPropertyEditorController
 
- setPropertyAttrFlagSets a property attribute flag. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- setPropertyAttrFlagin interface- IPropertyEditorController
 
- removePropertyValueRemoves a property when undefined in the editors. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- removePropertyValuein interface- IPropertyEditorController
 
- getAdapter- Specified by:
- getAdapterin interface- org.eclipse.core.runtime.IAdaptable
- Overrides:
- getAdapterin class- org.eclipse.ui.part.WorkbenchPart
 
- getSaveablespublic org.eclipse.ui.Saveable[] getSaveables()- Specified by:
- getSaveablesin interface- org.eclipse.ui.ISaveablesSource
 
- getActiveSaveablespublic org.eclipse.ui.Saveable[] getActiveSaveables()- Specified by:
- getActiveSaveablesin interface- org.eclipse.ui.ISaveablesSource
 
- onActivatedpublic final void onActivated- (boolean on) Called when activator or deactivated.- Specified by:
- onActivatedin interface- IActivationListener
 
- createCommonViewerCreates the CommonViewer with extra support for Drag-and-Drop. The Tree Control gets an added focus listener to this instance as well as the viewer getting a post-selection listener.- Parameters:
- parent- The parent.
- Returns:
- The common viewer registered as "com.iizigo.navigator".
 
- createFilteredCommonViewerpublic final FilteredCommonViewer createFilteredCommonViewer- (org.eclipse.swt.widgets.Composite parent, IzFilter filter) Creates the Filtered CommonViewer with extra support for Drag-and-Drop. The Tree Control gets an added focus listener to this instance as well as the viewer getting a post-selection listener.- The tree is created with SWT.MULTI style. - Parameters:
- parent- The parent.
- filter- Filter.
- Returns:
- The common viewer registered as "com.iizigo.navigator".
 
- createFilteredCommonViewerpublic final FilteredCommonViewer createFilteredCommonViewer- (org.eclipse.swt.widgets.Composite parent, int style, IzFilter filter) Creates the Filtered CommonViewer with extra support for Drag-and-Drop. The Tree Control gets an added focus listener to this instance as well as the viewer getting a post-selection listener.- Parameters:
- parent- The parent.
- style- Tree SWT styles.
- filter- Filter.
- Returns:
- The common viewer registered as "com.iizigo.navigator".
 
- onDragBeginprotected void onDragBegin()Drag started.
- onDragEndprotected void onDragEnd()Drag finished.
- isDraggingpublic boolean isDragging()Flag for dragging to postpone selection events until drag completes.- Specified by:
- isDraggingin interface- IDraggingFix
 
- createMenuprotected void createMenu- (org.eclipse.jface.viewers.Viewer viewer, IContextMenuContributor contributor) Creates a menu that is used as a pop-up menu.
- createMenuprotected void createMenu- (org.eclipse.swt.widgets.Control control, IContextMenuContributorFormControl<org.eclipse.swt.widgets.Control> contributor) Creates a menu that is used as a pop-up menu.
- setFocuspublic final void setFocus()Sets focus to the Editor. Subclasses should extend this method.- Specified by:
- setFocusin interface- org.eclipse.ui.IWorkbenchPart
- Specified by:
- setFocusin class- org.eclipse.ui.part.WorkbenchPart
 
- onSetFocusprotected void onSetFocus()Called when set focus is called to override default processing. Override this method instead of the "final" setFocus method that can't be overridden (due to process of initialization errors, PartInitException, etc).
- registerViewerprotected void registerViewer- (org.eclipse.jface.viewers.StructuredViewer viewer, int index) Registers a viewer for selection changes. This will cause a focus listener to this class as well as a post-selection-listener. This method is required to set fulfill the contract of the editor's SelectionProvider contract.- Parameters:
- viewer- The viewer.
- index- The control index.
 
- registerViewerpublic void registerViewer- (org.eclipse.jface.viewers.StructuredViewer viewer, int index, IContextMenuContributor contributor) Registers a viewer for selection changes. This will cause a focus listener to this class as well as a post-selection-listener. This method is required to set fulfill the contract of the editor's SelectionProvider contract.- Parameters:
- viewer- The viewer.
- index- The control index.
- contributor- The context menu contributor, null for none.
 
- setTargetViewerSets the target viewer for e.g. add operations in order to make selection of the added properties at add, undo or redo.- Specified by:
- setTargetViewerin interface- IPropUndoRedo
- Parameters:
- viewer- The CommonViewer, TreeViewer or TableViewer, or null for none.
 
- getTargetViewerGets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- Specified by:
- getTargetViewerin interface- IPropUndoRedo
- Returns:
- The CommonViewer, TreeViewer or TableViewer, or null for none.
 
- setBlockViewerFocuspublic void setBlockViewerFocus- (boolean block) Blocks the target viewer from focus.- Specified by:
- setBlockViewerFocusin interface- IPropertyEditorController
 
- onComponentFocuspublic void onComponentFocus- (org.eclipse.swt.widgets.Control c) Called by the workbench extension when focus is received.
- gotoMarkerpublic void gotoMarker- (org.eclipse.core.resources.IMarker marker) Sets the cursor and selection state for an editor to reveal the position of the given marker.- Specified by:
- gotoMarkerin interface- org.eclipse.ui.ide.IGotoMarker
- Parameters:
- marker- the marker
 
- setFocusprotected int setFocus- (PropCnr container, org.eclipse.jface.viewers.StructuredViewer viewer, IzFilter filter, PropertyEditor propertyEditor, GProp<?> property, int index, String childName) Attempts to set focus to the property in question based on a container, a viewer and a property editor. If successful, the viewer selects the property or its ancestor, the property editor has the focus to the edited property.- This call should be made from the SWT thread. - Parameters:
- container- The container.
- viewer- A viewer.
- filter- A filter instance for the viewer, null for none.
- propertyEditor- The property editor.
- property- The property to focus.
- index- Index in multi-property, -1 for none.
- childName- Name of child property or null.
- Returns:
- -1=failed, 0=selection only, 1=selection+property.