Class CustomSQLSourceViewer

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.jface.viewers.ISelectionProvider,, org.eclipse.swt.internal.SWTEventListener

    public class CustomSQLSourceViewer
    extends org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
    Customized SQL source viewer for undo/redo, etc, to be well-integrated with IIZI.
    Christopher Mindus
    • Field Summary

      • Fields inherited from class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer

        actions, configuration, currentSelection, document, documentProvider, qListener, reparseRunning, sourceViewer, sqlbuilder, sqlDomainModel, textChanged
      • Fields inherited from class org.eclipse.jface.viewers.Viewer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearSQLInput()
      Clears the text entry field and re-parses.
      boolean doRefresh​(boolean doPerform)
      Refreshes SQL and graphs.
      java.lang.String getLastKnownProperSource()
      Last known good SQL.
      org.eclipse.jface.text.source.SourceViewer getSourceViewer()
      Gets the source viewer.
      java.lang.String getSQLInput()
      Gets the SQL statement from the text field, without parsing, etc.
      void menuAboutToShow​(org.eclipse.jface.action.IMenuManager menu)
      Menu shown.
      void refreshSource()
      Refreshes the source from the statement.
      boolean reparse()
      Called for re-parse.
      void setSQLInput​(java.lang.String inputSQL, boolean isDirty)
      Sets the input SQL when parsing failed.
      void setTextDirty​(boolean dirty)
      Let the source view know that the text is dirty from action such as dropping a table in the Graph view.
      • Methods inherited from class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer

        addAction, createActions, forceReparse, getAction, getControl, getDocumentProvider, getDomainModel, getFileSQLStr, getParseRequired, getSegments, getSelection, getText, getTextChanged, handleDispose, initDBContext, inputChanged, isEditable, isReparseRunning, isRootStatement, isTextChanged, noUnsupportedReparse, propertyChange, refresh, refreshSource, revertToDefaultSource, revertToInitialSource, revertToLastKnownProperSource, selectionChanged, setAction, setContentChangeListener, setEditable, setFileSQLStr, setParseRequired, setSelection, setSQLBuilder, setTextChanged, updateAction, widgetDisposed
      • Methods inherited from class org.eclipse.jface.viewers.ContentViewer

        getContentProvider, getInput, getLabelProvider, handleLabelProviderChanged, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider
      • Methods inherited from class org.eclipse.jface.viewers.Viewer

        addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
      • Methods inherited from class java.lang.Object

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

      • menuAboutToShow

        public void menuAboutToShow​(org.eclipse.jface.action.IMenuManager menu)
        Menu shown.
        Specified by:
        menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
        menuAboutToShow in class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
      • getSourceViewer

        public org.eclipse.jface.text.source.SourceViewer getSourceViewer()
        Gets the source viewer.
        The JFace source viewer.
      • refreshSource

        public void refreshSource()
        Refreshes the source from the statement. This is blocked only until doNiceSQL is set.
        refreshSource in class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
      • doRefresh

        public boolean doRefresh​(boolean doPerform)
        Refreshes SQL and graphs.
        doPerform - Flag to refresh or just test to see if refresh will do something.
        true to enable the refresh button, false to disable it.
      • reparse

        public boolean reparse()
        Called for re-parse.
        reparse in class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
      • getLastKnownProperSource

        public java.lang.String getLastKnownProperSource()
        Last known good SQL.
        getLastKnownProperSource in class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
      • clearSQLInput

        public void clearSQLInput()
        Clears the text entry field and re-parses.
      • setSQLInput

        public void setSQLInput​(java.lang.String inputSQL,
                                boolean isDirty)
        Sets the input SQL when parsing failed.
        inputSQL - The SQL string, can contain errors.
        isDirty - Reset or set dirty flag.
      • getSQLInput

        public java.lang.String getSQLInput()
        Gets the SQL statement from the text field, without parsing, etc.
        The statement from the JFace viewer.
      • setTextDirty

        public void setTextDirty​(boolean dirty)
        Let the source view know that the text is dirty from action such as dropping a table in the Graph view. FYI: the TextListener should have detected the change but did not. This is a work-around solution.
        setTextDirty in class org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
        dirty - whether or not the text is dirty