Class CustomSQLBuilder

java.lang.Object
org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
com.iizigo.db.editor.CustomSQLBuilder
All Implemented Interfaces:
Observer, org.eclipse.datatools.sqltools.sqlbuilder.IContentChangeListener, org.eclipse.emf.edit.domain.IEditingDomainProvider, IMenuListener

public class CustomSQLBuilder extends org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
Customized UI Component of SQL Query Builder content editor.
Author:
Christopher Mindus
  • Field Summary

    Fields inherited from class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder

    _actionBarContributor, _clientCreated, _contentChangeListeners, _contentOutlinePage, _currentSelection, _designViewer, _editingDomain, _editor, _editorInputUsageOptions, _executeSQLListeners, _graphControl, _iFile, _inCreateClient, _inputLoaded, _loadOnConnection, _parentControl, _sashGraphOutline, _sashMain, _sashSourceGraph, _sourceViewer, _sqlBuilderEditorInput, _sqlDomainModel, _windowStateInfo, DEFAULT_SASHGRAPHOUTLINE_WEIGHT1, DEFAULT_SASHGRAPHOUTLINE_WEIGHT2, DEFAULT_SASHMAIN_HEIGHT, DEFAULT_SASHMAIN_WEIGHT1, DEFAULT_SASHMAIN_WEIGHT2, DEFAULT_SASHMAIN_WIDTH, DEFAULT_SASHSOURCEGRAPH_WEIGHT1, DEFAULT_SASHSOURCEGRAPH_WEIGHT2
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Overrides: Enables / disables the GraphControl to avoid message box.
    void
    Tries to make sure that we have a database connection so that the SQL model will be populated when we need it.
    void
    Creates the UI component for the SQLBuilder.
    protected void
    Creates the Source Viewer
    Gets the
    Gets the database editor.
    Gets the source viewer.
    Gets the text that is input in the source viewer.
    boolean
    Overrides dirty state during initialization and save.
    void
    Menu listener.
    void
    setDirty(boolean isDirty)
    Marks this SQLBuilder's statement as "dirty" (has unsaved changes).

    Methods inherited from class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder

    addContentChangeListener, addExecuteSQLListener, changeStatementType, createContextMenuFor, createDesignViewer, createGraphViewer, doSave, getConnectionInfo, getContentOutlinePage, getDesignViewer, getDocumentProvider, getDomainModel, getEditingDomain, getEditorInputUsageOptions, getFile, getGraphViewer, getOmitSchemaInfo, getSQL, getSQLBuilderEditorInput, getSQLTreeViewer, getWindowStateInfo, handleContentOutlineSelection, inValidateEditCall, isContentOutlineRootSelected, isStatementProper, loadInput, notifyContentChange, notifySQLExecuted, reloadFromModel, removeContentChangeListener, removeExecuteSQLListener, reparseIfRequired, saveOmitSchemaInfo, setActionBarContributor, setInput, setLoadOnConnection, update, updateProperStatement, validateBeforeSave

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getActionBarContributor

      public CustomSQLBuilderActionBarContributor getActionBarContributor()
      Gets the
      Overrides:
      getActionBarContributor in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
    • getDatabaseEditor

      public DatabaseEditor getDatabaseEditor()
      Gets the database editor.
      Returns:
      The database editor instance.
    • createClient

      public void createClient(Composite parent)
      Creates the UI component for the SQLBuilder. This method should be called after setInput(ISQLBuilderEditorInput).
      Overrides:
      createClient in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
      Parameters:
      parent - the parent composite.
    • createSourceViewer

      protected void createSourceViewer(Composite client)
      Creates the Source Viewer
      Overrides:
      createSourceViewer in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
    • getTextInput

      public String getTextInput()
      Gets the text that is input in the source viewer.
      Returns:
      The SQL statement in the source viewer without parsing.
    • changeGraphControlEnableState

      protected void changeGraphControlEnableState(boolean enable)
      Overrides: Enables / disables the GraphControl to avoid message box.
      Overrides:
      changeGraphControlEnableState in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
    • getSourceViewer

      public CustomSQLSourceViewer getSourceViewer()
      Gets the source viewer.
      Overrides:
      getSourceViewer in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
      Returns:
      The customized SQL source viewer.
    • connectIfNeeded

      public void connectIfNeeded(IWorkbenchPart part)
      Tries to make sure that we have a database connection so that the SQL model will be populated when we need it. This allows us to delay connecting so that the user won't get prompted when the Workbench is coming up. This function should be called by editors based on SQLBuilder when the Workbench opens with the editor having been open when the workbench last closed.
      Overrides:
      connectIfNeeded in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
    • isDirty

      public boolean isDirty()
      Overrides dirty state during initialization and save.
      Overrides:
      isDirty in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
    • setDirty

      public void setDirty(boolean isDirty)
      Marks this SQLBuilder's statement as "dirty" (has unsaved changes).
      Overrides:
      setDirty in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
      Parameters:
      isDirty - true when there are unsaved changes, otherwise false.