Package com.iizigo.db.editor
Class CustomSQLSourceViewer
java.lang.Object
org.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
com.iizigo.db.editor.CustomSQLSourceViewer
- All Implemented Interfaces:
- EventListener,- IMenuListener,- IPropertyChangeListener,- IInputProvider,- IInputSelectionProvider,- ISelectionChangedListener,- ISelectionProvider,- DisposeListener,- 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.
- Author:
- 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- WIDGET_DATA_KEY
- Method SummaryModifier and TypeMethodDescription- voidClears the text entry field and re-parses.- boolean- doRefresh- (boolean doPerform) Refreshes SQL and graphs.Last known good SQL.Gets the source viewer.Gets the SQL statement from the text field, without parsing, etc.- void- menuAboutToShow- (IMenuManager menu) Menu shown.- voidRefreshes the source from the statement.- boolean- reparse()Called for re-parse.- void- setSQLInput- (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
- Method Details- getSourceViewerGets the source viewer.- Returns:
- The JFace source viewer.
 
- refreshSourcepublic void refreshSource()Refreshes the source from the statement. This is blocked only until doNiceSQL is set.- Overrides:
- refreshSourcein class- org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
 
- doRefreshpublic boolean doRefresh- (boolean doPerform) Refreshes SQL and graphs.- Parameters:
- doPerform- Flag to refresh or just test to see if refresh will do something.
- Returns:
- true to enable the refresh button, false to disable it.
 
- reparsepublic boolean reparse()Called for re-parse.- Overrides:
- reparsein class- org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
 
- getLastKnownProperSourceLast known good SQL.- Overrides:
- getLastKnownProperSourcein class- org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
 
- clearSQLInputpublic void clearSQLInput()Clears the text entry field and re-parses.
- setSQLInputSets the input SQL when parsing failed.- Parameters:
- inputSQL- The SQL string, can contain errors.
- isDirty- Reset or set dirty flag.
 
- getSQLInputGets the SQL statement from the text field, without parsing, etc.- Returns:
- The statement from the JFace viewer.
 
- setTextDirtypublic 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.- Overrides:
- setTextDirtyin class- org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLSourceViewer
- Parameters:
- dirty- whether or not the text is dirty