Package com.iizigo.db.editor
Class CustomSQLBuilder
- java.lang.Object
- org.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
- com.iizigo.db.editor.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.SQLBuilderCustomized 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 Type Method Description 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 theSQLBuilder.protected voidcreateSourceViewer(org.eclipse.swt.widgets.Composite client)Creates the Source ViewerCustomSQLBuilderActionBarContributorgetActionBarContributor()Gets theDatabaseEditorgetDatabaseEditor()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
Method Detail
getActionBarContributor
public CustomSQLBuilderActionBarContributor getActionBarContributor()
Gets the- Overrides:
getActionBarContributorin classorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
menuAboutToShow
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
Menu listener.- Specified by:
menuAboutToShowin interfaceorg.eclipse.jface.action.IMenuListener- Overrides:
menuAboutToShowin classorg.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 theSQLBuilder. This method should be called aftersetInput(ISQLBuilderEditorInput).- Overrides:
createClientin classorg.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:
createSourceViewerin classorg.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:
changeGraphControlEnableStatein classorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
getSourceViewer
public CustomSQLSourceViewer getSourceViewer()
Gets the source viewer.- Overrides:
getSourceViewerin classorg.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:
connectIfNeededin classorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
isDirty
public boolean isDirty()
Overrides dirty state during initialization and save.- Overrides:
isDirtyin classorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
setDirty
public void setDirty(boolean isDirty)
Marks this SQLBuilder's statement as "dirty" (has unsaved changes).- Overrides:
setDirtyin classorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder- Parameters:
isDirty- true when there are unsaved changes, otherwise false.