Package com.iizigo.db.editor
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 SummaryModifier and TypeMethodDescription- protected void- changeGraphControlEnableState- (boolean enable) Overrides: Enables / disables the GraphControl to avoid message box.- voidTries to make sure that we have a database connection so that the SQL model will be populated when we need it.- void- createClient- (Composite parent) Creates the UI component for the- SQLBuilder.- protected void- createSourceViewer- (Composite client) Creates the Source ViewerGets theGets the database editor.Gets the source viewer.Gets the text that is input in the source viewer.- boolean- isDirty()Overrides dirty state during initialization and save.- void- menuAboutToShow- (IMenuManager menuManager) 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
- Method Details- getActionBarContributorGets the- Overrides:
- getActionBarContributorin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
 
- getDatabaseEditorGets the database editor.- Returns:
- The database editor instance.
 
- createClientCreates the UI component for the- SQLBuilder. This method should be called after- setInput(ISQLBuilderEditorInput).- Overrides:
- createClientin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
- Parameters:
- parent- the parent composite.
 
- createSourceViewerCreates the Source Viewer- Overrides:
- createSourceViewerin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
 
- getTextInputGets the text that is input in the source viewer.- Returns:
- The SQL statement in the source viewer without parsing.
 
- changeGraphControlEnableStateprotected void changeGraphControlEnableState- (boolean enable) Overrides: Enables / disables the GraphControl to avoid message box.- Overrides:
- changeGraphControlEnableStatein class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
 
- getSourceViewerGets the source viewer.- Overrides:
- getSourceViewerin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
- Returns:
- The customized SQL source viewer.
 
- connectIfNeededTries 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:
- connectIfNeededin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
 
- isDirtypublic boolean isDirty()Overrides dirty state during initialization and save.- Overrides:
- isDirtyin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
 
- setDirtypublic void setDirty- (boolean isDirty) Marks this SQLBuilder's statement as "dirty" (has unsaved changes).- Overrides:
- setDirtyin class- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
- Parameters:
- isDirty- true when there are unsaved changes, otherwise false.