|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sqlbuilder.SQLBuilder
public class SQLBuilder
UI Component of SQL Query Builder content editor.
This can be hosted in an editor (e.g. SQLBuilderEditor
) or a dialog.
Constructor Summary | |
---|---|
SQLBuilder()
Constructor for SQLBuilder . |
|
SQLBuilder(org.eclipse.ui.IEditorPart ed)
Constructor for SQLBuilder . |
Method Summary | |
---|---|
void |
addContentChangeListener(IContentChangeListener listener)
|
void |
addExecuteSQLListener(IExecuteSQLListener listener)
|
void |
changeStatementType(int statementType)
Changes the statement type in the SQLBuilder by using the statement template for the specified type. |
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. |
void |
createClient(org.eclipse.swt.widgets.Composite parent)
Creates the UI component for the SQLBuilder . |
org.eclipse.jface.action.MenuManager |
createContextMenuFor(org.eclipse.jface.viewers.Viewer viewer)
Creates context menu for a viewer. |
void |
doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Saves the current statement in the file resource associated with this SQLBuilder . |
SQLBuilderActionBarContributor |
getActionBarContributor()
Returns the SQLBuilderActionBarContributor belonging to this SQLBuilder . |
ISQLEditorConnectionInfo |
getConnectionInfo()
Gets the ISQLEditorConnectionInfo object associated with this
SQLBuilder's statement. |
org.eclipse.ui.views.contentoutline.IContentOutlinePage |
getContentOutlinePage(org.eclipse.swt.widgets.Composite composite)
Returns the content outline page. |
DesignViewer |
getDesignViewer()
Returns the DesignViewer. |
SQLDomainModel |
getDomainModel()
Returns the SQLDomainModel belonging to this SQLBuilder . |
org.eclipse.emf.edit.domain.EditingDomain |
getEditingDomain()
Returns the EditingDomain belonging to this SQLBuilder |
ISQLBuilderEditorInputUsageOptions |
getEditorInputUsageOptions()
Returns the current editorInputusageOptions of the SQLBuilder . |
org.eclipse.core.resources.IFile |
getFile()
Returns the IFile belonging to this SQLBuilder , which
may be null. |
GraphControl |
getGraphViewer()
Returns the GraphViewer. |
IOmitSchemaInfo |
getOmitSchemaInfo()
Gets the OmitSchemaInfo object associated with this statement |
SQLSourceViewer |
getSourceViewer()
Returns the SourceViewer. |
java.lang.String |
getSQL()
|
ISQLBuilderEditorInput |
getSQLBuilderEditorInput()
Returns the ISQLBuilderEditorInput belonging to this SQLBuilder . |
SQLTreeViewer |
getSQLTreeViewer()
Returns the SQLTreeViewer. |
IWindowStateInfo |
getWindowStateInfo()
Returns the current window state of the SQLBuilder . |
void |
handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection,
boolean fromEvent)
This deals with how we want selection in the outliner to affect the other views. |
boolean |
inValidateEditCall()
Returns whether the SQLBuilder is currently validating the SQL. |
boolean |
isContentOutlineRootSelected()
Returns whether the root of the content outline view is selected. |
boolean |
isDirty()
Returns whether the contents of this SQLBuilder have changed since
the last save operation. |
static boolean |
isStatementProper(SQLDomainModel domainModel)
Tests whether the current SQL is valid. |
void |
menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
|
void |
notifyContentChange()
Called when content has changed. |
void |
notifySQLExecuted()
Called when SQL statement has been executed. |
void |
reloadFromModel()
Reloads the SourceViewer from the SQL Model. |
void |
removeContentChangeListener(IContentChangeListener listener)
|
void |
removeExecuteSQLListener(IExecuteSQLListener listener)
|
void |
reparseIfRequired()
Reparses the SQL in the SourceViewer if it has changed. |
void |
saveOmitSchemaInfo(org.eclipse.core.resources.IFile file)
Saves the current OmitSchemaInfo for IFile parameter |
void |
setActionBarContributor(SQLBuilderActionBarContributor contributor)
Sets the SQLBuilderActionBarContributor for this SQLBuilder . |
void |
setDirty(boolean dirty)
Marks this SQLBuilder's statement as "dirty" (has unsaved changes). |
void |
setInput(ISQLBuilderEditorInput sqlBuilderEditorInput)
Sets the input for the SQLBuilder . |
void |
setLoadOnConnection(boolean loadOnConnection)
Tells the SQLBuilder to load the input SQL only after a database connection has been obtained. |
void |
update(java.util.Observable ob,
java.lang.Object arg)
Implementation of Observer interface. |
void |
updateProperStatement(boolean isValid)
Enables / disables SQLBuilder controls and actions depending on whether the current SQL is valid or not. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLBuilder()
SQLBuilder
. This constructor should be called when
a component other than an editor is being created.
public SQLBuilder(org.eclipse.ui.IEditorPart ed)
SQLBuilder
. This constructor should be called when
an Editor is being created.
ed
- the editor that is creating this SQLBuilder
.Method Detail |
---|
public void addContentChangeListener(IContentChangeListener listener)
public void removeContentChangeListener(IContentChangeListener listener)
public void addExecuteSQLListener(IExecuteSQLListener listener)
public void removeExecuteSQLListener(IExecuteSQLListener listener)
public void createClient(org.eclipse.swt.widgets.Composite parent)
SQLBuilder
.
This method should be called after setInput(ISQLBuilderEditorInput)
.
parent
- the parent composite.public void setLoadOnConnection(boolean loadOnConnection)
public void setInput(ISQLBuilderEditorInput sqlBuilderEditorInput) throws org.eclipse.ui.PartInitException, ParseException
SQLBuilder
.
This method should be called before createClient(Composite)
.
The waitForConnection
parameter indicates that the SQLBuilder should
delay opening the input until a connection to the database has been obtained.
sqlBuilderEditorInput
- bWaitForConnection
-
org.eclipse.ui.PartInitException
ParseException
public void saveOmitSchemaInfo(org.eclipse.core.resources.IFile file)
public SQLSourceViewer getSourceViewer()
public GraphControl getGraphViewer()
public DesignViewer getDesignViewer()
public SQLTreeViewer getSQLTreeViewer()
public org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage(org.eclipse.swt.widgets.Composite composite)
public void handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection, boolean fromEvent)
selection
- selection passed to handleContentOutlineSelection
.fromEvent
- not used.public boolean isContentOutlineRootSelected()
public void changeStatementType(int statementType)
statementType
- public void updateProperStatement(boolean isValid)
isValid
- whether the current SQL is valid.public static boolean isStatementProper(SQLDomainModel domainModel)
domainModel
- the domain model for the SQL.
public void reparseIfRequired()
public void reloadFromModel()
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
EditingDomain
belonging to this SQLBuilder
getEditingDomain
in interface org.eclipse.emf.edit.domain.IEditingDomainProvider
public void update(java.util.Observable ob, java.lang.Object arg)
update
in interface java.util.Observer
ob
- the object calling this methodarg
- the argument passed to the notifyObservers methodpublic SQLDomainModel getDomainModel()
SQLDomainModel
belonging to this SQLBuilder
.
public ISQLBuilderEditorInput getSQLBuilderEditorInput()
ISQLBuilderEditorInput
belonging to this SQLBuilder
.
public ISQLBuilderEditorInputUsageOptions getEditorInputUsageOptions()
SQLBuilder
.
public org.eclipse.core.resources.IFile getFile()
IFile
belonging to this SQLBuilder
, which
may be null.
public boolean inValidateEditCall()
SQLBuilder
is currently validating the SQL.
public SQLBuilderActionBarContributor getActionBarContributor()
SQLBuilderActionBarContributor
belonging to this SQLBuilder
.
public void setActionBarContributor(SQLBuilderActionBarContributor contributor)
SQLBuilderActionBarContributor
for this SQLBuilder
.
public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
SQLBuilder
.
This method should be called by editors which consume the SQLBuilder
.
If the SQLBuilder has an input which is not file based, the SQL is not saved. In this case, it is the
responsibility of the consumer of the SQLBuilder
to save the SQL.
progressMonitor
- progressMonitor used during save.public boolean isDirty()
SQLBuilder
have changed since
the last save operation.
true
if the contents have been modified and need
saving, and false
if they have not changed since the last
savepublic void setDirty(boolean dirty)
dirty
- true when there are unsaved changes, otherwise falsepublic IWindowStateInfo getWindowStateInfo()
SQLBuilder
.
public void notifyContentChange()
notifyContentChange
in interface IContentChangeListener
IContentChangeListener.notifyContentChange()
public void notifySQLExecuted()
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
menuAboutToShow
in interface org.eclipse.jface.action.IMenuListener
IMenuListener.menuAboutToShow(IMenuManager)
public org.eclipse.jface.action.MenuManager createContextMenuFor(org.eclipse.jface.viewers.Viewer viewer)
viewer
- the viewer.
public java.lang.String getSQL()
public ISQLEditorConnectionInfo getConnectionInfo()
ISQLEditorConnectionInfo
object associated with this
SQLBuilder's statement.
public IOmitSchemaInfo getOmitSchemaInfo()
OmitSchemaInfo
object associated with this statement
public void connectIfNeeded(org.eclipse.ui.IWorkbenchPart part)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |