Class CustomSQLBuilder

  • All Implemented Interfaces:
    java.util.Observer, org.eclipse.datatools.sqltools.sqlbuilder.IContentChangeListener, org.eclipse.emf.edit.domain.IEditingDomainProvider, org.eclipse.jface.action.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

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      protected voidchangeGraphControlEnableState​(boolean enable)
      Overrides: Enables / disables the GraphControl to avoid message box.
      voidconnectIfNeeded​(org.eclipse.ui.IWorkbenchPart part)
      Tries to make sure that we have a database connection so that the SQL model will be populated when we need it.
      voidcreateClient​(org.eclipse.swt.widgets.Composite parent)
      Creates the UI component for the SQLBuilder.
      protected voidcreateSourceViewer​(org.eclipse.swt.widgets.Composite client)
      Creates the Source Viewer
      CustomSQLBuilderActionBarContributorgetActionBarContributor()
      Gets the
      DatabaseEditorgetDatabaseEditor()
      Gets the database editor.
      CustomSQLSourceViewergetSourceViewer()
      Gets the source viewer.
      java.lang.StringgetTextInput()
      Gets the text that is input in the source viewer.
      booleanisDirty()
      Overrides dirty state during initialization and save.
      voidmenuAboutToShow​(org.eclipse.jface.action.IMenuManager menuManager)
      Menu listener.
      voidsetDirty​(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 Detail

      • getActionBarContributor

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

        public void menuAboutToShow​(org.eclipse.jface.action.IMenuManager menuManager)
        Menu listener.
        Specified by:
        menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
        Overrides:
        menuAboutToShow 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​(org.eclipse.swt.widgets.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​(org.eclipse.swt.widgets.Composite client)
        Creates the Source Viewer
        Overrides:
        createSourceViewer in class org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
      • getTextInput

        public java.lang.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​(org.eclipse.ui.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.