Class PropEditorPart

All Implemented Interfaces:
IActivationListener, IDraggingFix, IWorkbenchPartIZ, IPropertyEditorController, IPropUndoContext, IDisposedPart, IPropUndoRedo, IAdaptable, IExecutableExtension, ISelectionChangedListener, ISelectionProvider, IGotoMarker, IEditorPart, INavigationLocationProvider, IPersistable, IPersistableEditor, ISaveablePart, ISaveablesSource, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation
Direct Known Subclasses:
CaptureEditor, ContextMenuEditor, DatabaseEditor, FontFacesEditor, ImageDefinitionEditor, PanelEditor, RecordingEditor, ScreenEditor, SelectorEditor, StyleEditor, TextTableEditor, VirtualSpaceEditor, WebServiceEditor

The abstract Property Editor part used by the Editors in iiziGo.
Author:
Christopher Mindus
  • Field Details Link icon

    • EMPTY Link icon

      public static final PropEditorPart[] EMPTY
      Empty array.
    • rootPropCnr Link icon

      protected PropCnr rootPropCnr
      The (Module) root container used to listen to events, null when not used.
    • fileResource Link icon

      protected IFile fileResource
      The file resource for the editor.
    • filePropCnr Link icon

      protected FilePropCnr filePropCnr
      The File Property being edited, null for none.
    • editedPropCnr Link icon

      protected PropCnr editedPropCnr
      The edited property inside the filePropCnr.
    • toolBar Link icon

      protected ToolBar toolBar
      The tool bar.
    • toolBar2 Link icon

      protected ToolBar toolBar2
      The tool bar.
    • partSelection Link icon

      protected IStructuredSelection partSelection
      This part's current selection.
    • selectionEnabler Link icon

      protected SelectionEnabler selectionEnabler
      The last selection states.
    • cutAction Link icon

      protected PartAction cutAction
      Menu actions.
    • copyAction Link icon

      protected PartAction copyAction
      Menu actions.
    • pasteAction Link icon

      protected PartAction pasteAction
      Menu actions.
    • pasteBeforeAction Link icon

      protected PartAction pasteBeforeAction
      Menu actions.
    • pasteAfterAction Link icon

      protected PartAction pasteAfterAction
      Menu actions.
    • pasteLinkAction Link icon

      protected PartAction pasteLinkAction
      Menu actions.
    • deleteAction Link icon

      protected PartAction deleteAction
      Menu actions.
    • selectAllAction Link icon

      protected PartAction selectAllAction
      Menu actions.
    • revertAction Link icon

      protected PartAction revertAction
      Menu actions.
    • saveAction Link icon

      protected PartAction saveAction
      Menu actions.
    • renameAction Link icon

      protected PartAction renameAction
      Menu actions.
    • moveAction Link icon

      protected PartAction moveAction
      Menu actions.
    • linkAction Link icon

      protected PartAction linkAction
      Menu actions.
    • printAction Link icon

      protected PartAction printAction
      Menu actions.
    • copyReferenceAction Link icon

      protected PartAction copyReferenceAction
      Menu actions that MAY be null in case they are not supported.
    • copyFullPathAction Link icon

      protected PartAction copyFullPathAction
    • undoAction Link icon

      protected UndoActionHandler undoAction
    • redoAction Link icon

      protected RedoActionHandler redoAction
    • tiPaste Link icon

      protected ToolItem tiPaste
      Paste items.
    • dslPaste Link icon

      protected DropdownSelectionListener dslPaste
    • globalActionBars Link icon

      protected IActionBars globalActionBars
      The global action bars.
    • ir Link icon

      protected final ImageRegistry ir
      The Image Registry.
    • appUI Link icon

      protected ApplicationUI appUI
      The Application UI.
    • restoreMemento Link icon

      protected IMemento restoreMemento
      The restored memento.

      Note that restoreMemento may be null.

    • propEventListener Link icon

      protected final EventListener propEventListener
      Property event listener.
    • updateSelectionAndStatesRunner Link icon

      public final Runnable updateSelectionAndStatesRunner
      The update states runnable.
  • Constructor Details Link icon

    • PropEditorPart Link icon

      public PropEditorPart(Class<? extends PropCnr> propertyClass)
      Constructor.
      Parameters:
      propertyClass - The property class in files.
  • Method Details Link icon

    • getEditors Link icon

      public static PropEditorPart[] getEditors()
      Gets a snapshot of the editor parts.
    • updateAllStates Link icon

      public static void updateAllStates()
      Updates the states of all created editors.
    • getActiveEditor Link icon

      public static PropEditorPart getActiveEditor()
      Gets the active editor part.
      Returns:
      The active editor part, or null for none.
    • getActiveEditor Link icon

      public static PropEditorPart getActiveEditor(GProp<?> prop)
      Gets the active or topmost editor from a property.
      Returns:
      null if none is found.
    • getTopmostEditor Link icon

      public static PropEditorPart getTopmostEditor(PropEditorPart[] editors)
      Gets 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).
    • getActivePart Link icon

      public static PropEditorPart getActivePart()
      Gets 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.
    • onCloseProject Link icon

      public static void onCloseProject(IProject project)
      Called when a project is closed or unregistered from being a Module project. This closes the editors for it!
    • addListener Link icon

      public static boolean addListener(ILicenseSystemError listener)
      Adds 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.
    • removeListener Link icon

      public static boolean removeListener(ILicenseSystemError listener)
      Removes a dispose listener for the client session.
      Parameters:
      listener - The listener to remove.
      Returns:
      true if listener is successfully removed, false otherwise.
    • invalidLicense Link icon

      public static void invalidLicense(LicenseException e)
      Called from the SWT thread if the license is not valid.
      Parameters:
      e - The license exception.
    • getLicenseException Link icon

      public static LicenseException getLicenseException()
      Gets the potential license exception that occurred when loading it.
      Returns:
      The license exception, or null for OK (or License System not yet loaded).
    • createLicenseExceptionComposite Link icon

      public static Composite createLicenseExceptionComposite(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.
    • addForDisposalAtDispose Link icon

      protected void addForDisposalAtDispose(Object disposable)
      Adds an action that is disposed when the editor is disposed of.
    • getMultiSelectionProvider Link icon

      public final MultiSelectionProvider getMultiSelectionProvider()
      Gets the multi-property selection provider.
      Specified by:
      getMultiSelectionProvider in interface IPropertyEditorController
    • getExtension Link icon

      public PartExtensionIZ getExtension()
      The extensions framework.
      Specified by:
      getExtension in interface IWorkbenchPartIZ
    • getSelectionEnabler Link icon

      public SelectionEnabler getSelectionEnabler()
      Gets the selection enabler instance.
      Specified by:
      getSelectionEnabler in interface IWorkbenchPartIZ
    • onEditorActivated Link icon

      protected void onEditorActivated(boolean on)
      Called when the editor is activated or deactivated.
    • addOpenFile Link icon

      protected void addOpenFile(FilePropCnr fpc)
      Adds an open file. This method should be called when e.g. the text table editor opens a parallel text table for editing.
    • closeFile Link icon

      protected void closeFile(FilePropCnr fpc)
      Closed an open file. This method should be called when e.g. the text table editor opens a parallel text table for editing.
    • init Link icon

      public final void init(IEditorSite site, IEditorInput input) throws 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:
      init in interface IEditorPart
      Specified by:
      init in class EditorPart
      Throws:
      PartInitException - For initialization failures.
    • hasInitError Link icon

      public boolean hasInitError()
      Flag for initialize error, i.e. if there is a PartInitException in the postponed call.
    • onEditorReady Link icon

      protected 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.
    • proceedInit Link icon

      protected void proceedInit() throws PartInitException
      Continues the "init". This method can be overridden by editors that are not file property based such as the capture editor.
      Throws:
      PartInitException
    • proceedInitProperty Link icon

      protected void proceedInitProperty(PropCnr pc) throws PartInitException
      Proceeds initializing the editor with the property.
      Throws:
      PartInitException
    • getPartComposite Link icon

      public Composite getPartComposite()
      Gets the part composite created.
      Returns:
      The part composite, null if not yet created.
    • updateTitle Link icon

      protected void updateTitle()
      Updates the title and tooltip when file name/contents changes.
    • getTitleToolTip Link icon

      public String getTitleToolTip()
      Returns the title tooltip.
      Specified by:
      getTitleToolTip in interface IWorkbenchPart
      Overrides:
      getTitleToolTip in class EditorPart
    • getTitleImage Link icon

      public Image getTitleImage()
      Returns the workbench part image.
      Specified by:
      getTitleImage in interface IWorkbenchPart
      Overrides:
      getTitleImage in class WorkbenchPart
    • getPartName Link icon

      protected String getPartName(String title)
      Gets the part name that is about to be set. Override to provide an other title.
    • getTitleToolTip Link icon

      protected String getTitleToolTip(String title)
      Gets the part name that is about to be set. Override to provide an other title.
    • getModuleModel Link icon

      public ModuleModel getModuleModel()
      Gets the ModuleModel instance of the project.
      Specified by:
      getModuleModel in interface IPropertyEditorController
      Returns:
      The ModuleModel of the project, null if not yet loaded.
    • onFileClosed Link icon

      protected void onFileClosed(FilePropCnr fpc)
      Called 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.
    • onPartRenamed Link icon

      protected void onPartRenamed(GEvent e)
      Called 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.
    • initEditor Link icon

      protected void initEditor(PropCnr cnr) throws PartInitException
      The 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:
      PartInitException - For initialization failures.
    • onClose Link icon

      public void onClose()
      Called when the part is being closed but is not yet disposed but hidden.
      Specified by:
      onClose in interface IActivationListener
    • isSaveOnCloseNeeded Link icon

      public boolean isSaveOnCloseNeeded()
      Returns whether the contents of this editor should be saved when the editor is closed.

      This method always returns false because the IIZI saveables mechanism is somewhat different and saves when workspace exits.

      Specified by:
      isSaveOnCloseNeeded in interface ISaveablePart
      Overrides:
      isSaveOnCloseNeeded in class EditorPart
    • dispose Link icon

      public void dispose()
      Disposes of the Editor.
      Specified by:
      dispose in interface IWorkbenchPart
      Overrides:
      dispose in class WorkbenchPart
    • isDisposed Link icon

      public boolean isDisposed()
      Checks if the part is disposed of.
      Specified by:
      isDisposed in interface IActivationListener
      Specified by:
      isDisposed in interface IDisposedPart
      Specified by:
      isDisposed in interface IPropertyEditorController
      Specified by:
      isDisposed in interface IWorkbenchPartIZ
      Returns:
      true if disposed of, false otherwise.
    • restoreState Link icon

      public final void restoreState(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:
      restoreState in interface IPersistableEditor
      Parameters:
      memento - the saved state for this editor. May be null.
    • restoreMemento Link icon

      protected 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 restoreMemento may be null.

    • saveState Link icon

      public final void saveState(IMemento memento)
      Saves the state of the object in the given memento.

      Subclasses may extend this method.

      Specified by:
      saveState in interface IPersistable
      Parameters:
      memento - The storage area for object's state.
    • saveStateImpl Link icon

      protected void saveStateImpl(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.
    • addSelectionChangedListener Link icon

      public void addSelectionChangedListener(ISelectionChangedListener listener)
      Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.
      Specified by:
      addSelectionChangedListener in interface ISelectionProvider
      Parameters:
      listener - a selection changed listener
    • removeSelectionChangedListener Link icon

      public void removeSelectionChangedListener(ISelectionChangedListener listener)
      Removes the given selection change listener from this selection provider. Has no effect if an identical listener is not registered.
      Specified by:
      removeSelectionChangedListener in interface ISelectionProvider
      Parameters:
      listener - a selection changed listener
    • getSelection Link icon

      public ISelection getSelection()
      Returns the current selection for this provider.
      Specified by:
      getSelection in interface ISelectionProvider
      Returns:
      the current selection
    • setSelection Link icon

      public void setSelection(ISelection selection)
      Sets the current selection for this selection provider.
      Specified by:
      setSelection in interface ISelectionProvider
      Parameters:
      selection - the new selection
    • addToolbarPushButton Link icon

      public static ToolItem addToolbarPushButton(ToolBar toolBar, String tooltip, Image image, int style, 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.
    • addToolbarPushButton Link icon

      public static ToolItem addToolbarPushButton(ToolBar toolBar, String tooltip, Image image, 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.
    • addToolbarPushButton Link icon

      public static ToolItem addToolbarPushButton(ToolBar toolBar, String tooltip, String icon, 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.
    • addToolbarPushButton Link icon

      protected ToolItem addToolbarPushButton(String tooltip, Image image, 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.
    • addToolbarPushButton Link icon

      protected ToolItem addToolbarPushButton(String tooltip, String icon, 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.
    • addToolbarPushButton Link icon

      public void addToolbarPushButton(ToolBar toolBar, IAction action)
      Adds a tool bar push button from an action.
      Parameters:
      toolBar - The tool bar.
      action - The action.
    • addToolbarPushButton Link icon

      protected void addToolbarPushButton(IAction action)
      Adds a tool bar push button from an action.
      Parameters:
      action - The action.
    • addToolbar2PushButton Link icon

      protected void addToolbar2PushButton(IAction action)
      Adds a push button to the second tool bar from an action.
      Parameters:
      action - The action.
    • addToolbar2PushButton Link icon

      protected ToolItem addToolbar2PushButton(String tooltip, Image image, 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.
    • addToolbarSeparator Link icon

      public static void addToolbarSeparator(ToolBar toolBar)
      Adds a separator to the tool bar.
      Parameters:
      toolBar - The tool bar.
    • addToolbarSeparator Link icon

      protected void addToolbarSeparator()
      Adds a separator to the tool bar.
    • addToolbar2Separator Link icon

      protected void addToolbar2Separator()
      Adds a separator to the second tool bar.
    • createPartControl Link icon

      public final void createPartControl(Composite parent)
      Create contents of the editor part.

      This method calls .

      Specified by:
      createPartControl in interface IWorkbenchPart
      Specified by:
      createPartControl in class WorkbenchPart
      Parameters:
      parent - The parent composite.
    • supportsCopyReference Link icon

      protected 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.
    • supportsCopyFullPath Link icon

      protected 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.
    • usePasteBeforeAfter Link icon

      protected boolean usePasteBeforeAfter()
      Override to return how paste before/after are processed.
      Returns:
      true to handle before/after.
    • createEditorComposite Link icon

      protected abstract void createEditorComposite(Composite parent)
      Creates the Editor Main Composite.
      Parameters:
      parent - The empty parent composite without initialized layout, with the widget background color.
    • performCopyReference Link icon

      protected 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.
    • performCopyFullPath Link icon

      protected 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.
    • setActionsUndoContext Link icon

      public void setActionsUndoContext(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.
    • getUndoAction Link icon

      public UndoActionHandler getUndoAction()
      Gets the undo action.
    • getRedoAction Link icon

      public RedoActionHandler getRedoAction()
      Gets the undo action.
    • registerFormControl Link icon

      public void registerFormControl(Control control)
      Registers a form entry capable control in the Editor part.
      Parameters:
      control - The control can be Text, Combo, CCombo, StyledText, Spinner.
    • getShell Link icon

      public final Shell getShell()
      Gets the shell.
      Specified by:
      getShell in interface IPropUndoRedo
      Returns:
      An object castable to org.eclipse.swt.widgets.Shell.
    • getUndoContext Link icon

      public final IUndoContext getUndoContext()
      Gets the undo context.
      Specified by:
      getUndoContext in interface IPropertyEditorController
      Specified by:
      getUndoContext in interface IPropUndoContext
      Specified by:
      getUndoContext in interface IPropUndoRedo
      Returns:
      An object castable to org.eclipse.core.commands.operations.IUndoContext.
    • getUndoRedo Link icon

      public final IPropUndoRedo getUndoRedo()
      Gets the undo/redo interface.
      Specified by:
      getUndoRedo in interface IPropertyEditorController
      Specified by:
      getUndoRedo in interface IWorkbenchPartIZ
    • isDirty Link icon

      public 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:
      isDirty in interface ISaveablePart
      Specified by:
      isDirty in class EditorPart
    • verifyDirtyStateChanged Link icon

      public void verifyDirtyStateChanged()
      Verifies the dirty and fires state changed as required.
    • refreshViewers Link icon

      public void refreshViewers()
      Refreshes all registered viewers before e.g. a "doOpen" call to show a property when they have just been added.
    • doOpen Link icon

      public boolean doOpen(GProp<?>[] props)
      Opens the property by selecting it in focus. This method must be overridden.
    • doOpen Link icon

      public boolean doOpen(GProp<?> prop, int index, String childName)
      Opens 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.
    • doSave Link icon

      public void doSave(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:
      doSave in interface ISaveablePart
      Specified by:
      doSave in class EditorPart
    • doSaveAs Link icon

      public final void doSaveAs()
      Saves the contents of this part to another object.

      This is not supported.

      Specified by:
      doSaveAs in interface ISaveablePart
      Specified by:
      doSaveAs in class EditorPart
    • isSaveAsAllowed Link icon

      public final boolean isSaveAsAllowed()
      Returns whether the "Save As" operation is supported by this part.
      Specified by:
      isSaveAsAllowed in interface ISaveablePart
      Specified by:
      isSaveAsAllowed in class EditorPart
      Returns:
      false, always.
    • performUndo Link icon

      public void performUndo()
      Performs Undo.
    • performRedo Link icon

      public void performRedo()
      Performs Redo.
    • getSyntClipboardSelection Link icon

      public IClipboardSelection getSyntClipboardSelection()
      Gets the current IClipboardSelection implementor.
      Returns:
      null For none.
    • performCopy Link icon

      public void performCopy()
      Performs Copy.
    • performCut Link icon

      public void performCut()
      Performs Cut.
    • performPaste Link icon

      public void performPaste()
      Performs Paste.
    • performPasteBefore Link icon

      public void performPasteBefore()
      Performs Paste Before.
    • performPasteAfter Link icon

      public void performPasteAfter()
      Performs Paste Before.
    • performPasteLink Link icon

      public void performPasteLink()
      Performs Paste-link.
    • performDelete Link icon

      public void performDelete()
      Performs Delete.
    • performSelectAll Link icon

      public final void performSelectAll()
      Performs Select All.
    • performMove Link icon

      public void performMove()
      Performs Move.
    • performLink Link icon

      public void performLink()
      Performs Link.
    • performPrint Link icon

      protected abstract void performPrint()
      Performs Print.
    • performRevert Link icon

      protected void performRevert()
      Performs Revert.
    • performSave Link icon

      protected void performSave()
      Performs Save.
    • performRename Link icon

      protected void performRename()
      Performs Rename.
    • getCurrentTreeViewer Link icon

      protected TreeViewer getCurrentTreeViewer()
      Gets the current tree viewer.
      Returns:
      null for none.
    • performCollapseAll Link icon

      protected void performCollapseAll()
      Performs move up.
    • performExpandAll Link icon

      protected void performExpandAll()
      Performs move down.
    • selectionChanged Link icon

      public final void selectionChanged(SelectionChangedEvent event)
      Selection changes in the tree. Once the selection has been processed, the selectChangedEx(event) method is called.
      Specified by:
      selectionChanged in interface ISelectionChangedListener
    • fireSelectionAndStates Link icon

      public void fireSelectionAndStates()
      Fires a new selection event that also updates the states.
    • selectionChangedEx Link icon

      protected void selectionChangedEx(SelectionChangedEvent event)
      Selection changes in the tree.

      Subclasses should override this method to process selection changes.

    • updateStates Link icon

      public final void updateStates()
      Update states of the menu and tool bars, both global and part-local ones. The states are set according to the selectionStates member variable class instance. To fine-tune the states in the selectionStates and further process other states, override the updateStatesEx() method.
      Specified by:
      updateStates in interface IActivationListener
      Specified by:
      updateStates in interface IPropUndoRedo
    • onUpdateStates Link icon

      protected void onUpdateStates()
      Called just in the beginning of updateStates() before selections are processed. Override as required.
    • updateStatesPasteBeforeAfter Link icon

      protected void updateStatesPasteBeforeAfter()
      Process update states for pasteBeforeAction and pasteAfterAction. Override if other processing that the default is required, such as in the Panel Editor.
    • postAsyncUpdateStates Link icon

      protected final void postAsyncUpdateStates()
      Post an async updateStates event (once only in one "SWT cycle").
    • onEditedPropertyChangedForVerify Link icon

      protected void onEditedPropertyChangedForVerify(GEvent event)
      Called 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.
    • updateStatesEx Link icon

      protected void updateStatesEx()
      Update states of the menu and tool bars, both global and part-local ones. The states are set according to the selectionStates member variable class instance.

      To fine-tune the states in the selectionStates and further process other states, override this method.

    • setPropertyValue Link icon

      public void setPropertyValue(PropCnr parent, GProp<?> property, Object value)
      Sets 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:
      setPropertyValue in interface IPropertyEditorController
    • setPropertyError Link icon

      public void setPropertyError(GProp<?> property, String errorID, IPropErrorItem item)
      Sets a property error. The undo/redo functionality will wrap an undo/redo action for this function.
      Specified by:
      setPropertyError in interface IPropertyEditorController
    • setPropertyAttrFlag Link icon

      public void setPropertyAttrFlag(GProp<?> property, int attr, boolean flag)
      Sets a property attribute flag. The undo/redo functionality will wrap an undo/redo action for this function.
      Specified by:
      setPropertyAttrFlag in interface IPropertyEditorController
    • removePropertyValue Link icon

      public void removePropertyValue(GProp<?> property)
      Removes a property when undefined in the editors. The undo/redo functionality will wrap an undo/redo action for this function.
      Specified by:
      removePropertyValue in interface IPropertyEditorController
    • getAdapter Link icon

      public <T> T getAdapter(Class<T> adapter)
      Specified by:
      getAdapter in interface IAdaptable
      Overrides:
      getAdapter in class WorkbenchPart
    • getSaveables Link icon

      public Saveable[] getSaveables()
      Specified by:
      getSaveables in interface ISaveablesSource
    • getActiveSaveables Link icon

      public Saveable[] getActiveSaveables()
      Specified by:
      getActiveSaveables in interface ISaveablesSource
    • createEmptyNavigationLocation Link icon

      public INavigationLocation createEmptyNavigationLocation()
      Creates an empty navigation location. The message restoreState will be sent to the location to restore its state.
      Specified by:
      createEmptyNavigationLocation in interface INavigationLocationProvider
      Returns:
      INavigationLocation
    • createNavigationLocation Link icon

      public INavigationLocation createNavigationLocation()
      Creates a navigation location describing the current state.
      Specified by:
      createNavigationLocation in interface INavigationLocationProvider
      Returns:
      INavigationLocation
    • onActivated Link icon

      public final void onActivated(boolean on)
      Called when activator or deactivated.
      Specified by:
      onActivated in interface IActivationListener
    • createCommonViewer Link icon

      public final CommonViewerEx createCommonViewer(Composite parent)
      Creates 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".
    • createFilteredCommonViewer Link icon

      public final FilteredCommonViewer createFilteredCommonViewer(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".
    • createFilteredCommonViewer Link icon

      public final FilteredCommonViewer createFilteredCommonViewer(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".
    • onDragBegin Link icon

      protected void onDragBegin()
      Drag started.
    • onDragEnd Link icon

      protected void onDragEnd()
      Drag finished.
    • isDragging Link icon

      public boolean isDragging()
      Flag for dragging to postpone selection events until drag completes.
      Specified by:
      isDragging in interface IDraggingFix
    • createMenu Link icon

      protected void createMenu(Viewer viewer, IContextMenuContributor contributor)
      Creates a menu that is used as a pop-up menu.
    • createMenu Link icon

      protected void createMenu(Control control, IContextMenuContributorFormControl<Control> contributor)
      Creates a menu that is used as a pop-up menu.
    • setFocus Link icon

      public final void setFocus()
      Sets focus to the Editor. Subclasses should extend this method.
      Specified by:
      setFocus in interface IWorkbenchPart
      Specified by:
      setFocus in class WorkbenchPart
    • onSetFocus Link icon

      protected 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).
    • registerViewer Link icon

      protected void registerViewer(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.
    • registerViewer Link icon

      public void registerViewer(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.
    • setTargetViewer Link icon

      public final void setTargetViewer(Object viewer)
      Sets the target viewer for e.g. add operations in order to make selection of the added properties at add, undo or redo.
      Specified by:
      setTargetViewer in interface IPropUndoRedo
      Parameters:
      viewer - The CommonViewer, TreeViewer or TableViewer, or null for none.
    • getTargetViewer Link icon

      public Object getTargetViewer()
      Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
      Specified by:
      getTargetViewer in interface IPropUndoRedo
      Returns:
      The CommonViewer, TreeViewer or TableViewer, or null for none.
    • setBlockViewerFocus Link icon

      public void setBlockViewerFocus(boolean block)
      Blocks the target viewer from focus.
      Specified by:
      setBlockViewerFocus in interface IPropertyEditorController
    • onComponentFocus Link icon

      public void onComponentFocus(Control c)
      Called by the workbench extension when focus is received.
    • gotoMarker Link icon

      public void gotoMarker(IMarker marker)
      Sets the cursor and selection state for an editor to reveal the position of the given marker.
      Specified by:
      gotoMarker in interface IGotoMarker
      Parameters:
      marker - the marker
    • setFocus Link icon

      protected int setFocus(PropCnr container, 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.