Class DatabaseEditor

All Implemented Interfaces:
IActivationListener, IDraggingFix, IWorkbenchPartIZ, IPropertyEditorController, IPropUndoContext, ISaveableEditor, IDisposedPart, IPropUndoRedo, IAdaptable, IExecutableExtension, org.eclipse.datatools.sqltools.sqlbuilder.IContentChangeListener, org.eclipse.datatools.sqltools.sqlbuilder.IExecuteSQLListener, ISelectionChangedListener, ISelectionProvider, IGotoMarker, IEditorPart, INavigationLocationProvider, IPersistable, IPersistableEditor, ISaveablePart, ISaveablesSource, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class DatabaseEditor extends PropEditorPart implements ISaveableEditor, org.eclipse.datatools.sqltools.sqlbuilder.IContentChangeListener, org.eclipse.datatools.sqltools.sqlbuilder.IExecuteSQLListener
The Database Editor part.
  • Field Details

    • ID

      public static final String ID
      The Part ID.
  • Constructor Details

    • DatabaseEditor

      public DatabaseEditor()
      Eclipse constructor.
  • Method Details

    • initEditor

      protected void initEditor(PropCnr cnr) throws PartInitException
      The initialize editor method.

      Subclasses may override this method.

      Overrides:
      initEditor in class PropEditorPart
      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.
    • getActionBarContributor

      public org.eclipse.datatools.sqltools.sqlbuilder.actions.SQLBuilderActionBarContributor getActionBarContributor()
      Gets the action bar contributor.
      Returns:
      The action bar contributor.
    • setActionBarContributor

      public void setActionBarContributor(CustomSQLBuilderActionBarContributor contributor)
      Sets the action contributor associated with this editor. This is called by the contributor itself.
      Parameters:
      contributor - Assigns the contributor.
    • getSQLBuilder

      public CustomSQLBuilder getSQLBuilder()
      Gets the instance of the SQL Builder.
      Returns:
      The SQL builder instance, never null.
    • getDatabaseProps

      public EditorDatabaseProps getDatabaseProps()
      Gets the database properties.
      Returns:
      The database properties.
    • onClose

      public void onClose()
      Called when the part is being closed but is not yet disposed but hidden.
      Specified by:
      onClose in interface IActivationListener
      Overrides:
      onClose in class PropEditorPart
    • dispose

      public void dispose()
      Called to dispose.
      Specified by:
      dispose in interface IWorkbenchPart
      Overrides:
      dispose in class PropEditorPart
    • restoreMemento

      protected void restoreMemento()
      Restores this editor's state using the given memento.
      Overrides:
      restoreMemento in class PropEditorPart
    • saveStateImpl

      protected void saveStateImpl(IMemento memento)
      Saves the state of the object in the given memento.
      Overrides:
      saveStateImpl in class PropEditorPart
      Parameters:
      memento - The storage area for object's state.
    • isAdditionalDataDirty

      public boolean isAdditionalDataDirty()
      Checks the dirty state of additional data.
      Specified by:
      isAdditionalDataDirty in interface ISaveableEditor
    • saveAdditionalData

      public void saveAdditionalData(IProgressMonitor monitor)
      Saves the additional data.
      Specified by:
      saveAdditionalData in interface ISaveableEditor
      Parameters:
      monitor - The progress monitor.
    • notifyContentChange

      public void notifyContentChange()
      Notifies that content changed from SQLBuilder, called from the SWT thread.
      Specified by:
      notifyContentChange in interface org.eclipse.datatools.sqltools.sqlbuilder.IContentChangeListener
    • getAdapter

      public <T> T getAdapter(Class<T> key)
      Checks for outline page match (IContentOutlinePage), handled by SQLBuilder.
      Specified by:
      getAdapter in interface IAdaptable
      Overrides:
      getAdapter in class PropEditorPart
    • createEditorComposite

      protected void createEditorComposite(Composite parent)
      Creates the Editor Main Composite.
      Specified by:
      createEditorComposite in class PropEditorPart
      Parameters:
      parent - The empty parent composite without initialized layout, with the widget background color.
    • onSetFocus

      protected void onSetFocus()
      Sets focus to this part.
      Overrides:
      onSetFocus in class PropEditorPart
    • selectionChangedEx

      protected void selectionChangedEx(SelectionChangedEvent event)
      Selection changes in the tree.
      Overrides:
      selectionChangedEx in class PropEditorPart
    • updateStatesEx

      protected void updateStatesEx()
      Update states.
      Overrides:
      updateStatesEx in class PropEditorPart
    • doOpen

      public boolean doOpen(GProp<?>[] props)
      Opens the property by selecting it in focus.
      Overrides:
      doOpen in class PropEditorPart
    • doOpen

      public boolean doOpen(GProp<?> prop, int index, String childName)
      Opens the property by selecting it in focus. This method must be overridden.
      Overrides:
      doOpen in class PropEditorPart
      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.
    • performPrint

      protected void performPrint()
      Performs Print.
      Specified by:
      performPrint in class PropEditorPart
    • executedSQL

      public void executedSQL()
      Called when SQL has been executed in SQL Builder.
      Specified by:
      executedSQL in interface org.eclipse.datatools.sqltools.sqlbuilder.IExecuteSQLListener