org.eclipse.datatools.sqltools.sqlbuilder.input
Class SQLBuilderEditorInput

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqlbuilder.input.SQLBuilderEditorInput
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, ISQLBuilderEditorInput, ISQLEditorInput, org.eclipse.ui.IEditorInput

public class SQLBuilderEditorInput
extends java.lang.Object
implements ISQLBuilderEditorInput

This class implements the ISQLEditorInput interface using a string for the SQL statement itself. This class is provided as a convenience for callers of the SQL Builder who want to open it with a SQL statement as text. There are constructors which allow you to pass in ISQLEditorConnectionInfo or IConnectionProfile objects. There are constructors which allow you to pass in an existing SQL statement in a SQLStatementInfo object or to create new SQL statements by passing in an integer to specify the statement type. The value must be one of StatementHelper's STATEMENT_TYPE constants.

Author:
Jeremy Lindop

Constructor Summary
SQLBuilderEditorInput(IConnectionProfile connectionProfile, int statementType)
          Creates an instance of this class with the given ConnectionProfile and StatementType.
SQLBuilderEditorInput(IConnectionProfile connectionProfile, ISQLStatementInfo sqlStatementInfo)
          Creates an instance of this class with the given ConnectionProfile and SQLStatementInfo.
SQLBuilderEditorInput(IConnectionProfile connectionProfile, ISQLStatementInfo sqlStatementInfo, IOmitSchemaInfo omitSchemaInfo)
          Creates an instance of this class with the given ConnectionProfile, SQLStatementInfo and OmitSchemaInfo.
SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo, int statementType)
          Creates an instance of this class with the given ConnectionInfo and StatementType.
SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo, ISQLStatementInfo sqlStatementInfo)
          Creates an instance of this class with the given ConnectionInfo and SQLStatementInfo.
SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo, ISQLStatementInfo sqlStatementInfo, IOmitSchemaInfo omitSchemaInfo)
          Creates an instance of this class with the given ConnectionInfo and SQLStatementInfo.
 
Method Summary
 boolean exists()
           
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 ISQLEditorConnectionInfo getConnectionInfo()
          Gets the ISQLEditorConnectionInfo associated with this input.
 IConnectionProfile getConnectionProfile()
          Gets the IConnectionProfile associated with this input.
 java.lang.String getId()
          Returns the unique identifier that distinguishes this editor input
 org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
           
 ISQLBuilderEditorInputUsageOptions getInputUsageOptions()
          Gets the usage options of the editor input.
 java.lang.String getName()
           
 IOmitSchemaInfo getOmitSchemaInfo()
          Gets the IOmitSchemaInfo associated with this input.
 org.eclipse.ui.IPersistableElement getPersistable()
           
 java.lang.String getSQL()
          Gets the SQLStatement contained in this input's File
 ISQLStatementInfo getSQLStatementInfo()
          Gets the ISQLStatementInfo associated with this input.
 int getStatementType()
          Gets the StatementType for in this input.
 java.lang.String getToolTipText()
           
 IWindowStateInfo getWindowStateInfo()
          Gets the window state information which stores the control states of the SQL Query Builder.
 boolean isConnectionRequired()
          Returns whether database connection is required for this editor input to exist.
 void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
          Sets the ISQLEditorConnectionInfo associated with this input to the given object.
 void setConnectionProfile(IConnectionProfile connProfile)
          Sets the IConnectionProfile associated with this input to the given object.
 void setInputUsageOptions(ISQLBuilderEditorInputUsageOptions options)
          Sets the usage options of the editor input.
 void setOmitSchemaInfo(IOmitSchemaInfo omitSchemaInfo)
          Sets the OmitSchemaInfo associated with this input to the given object.
 void setSQLStatementInfo(ISQLStatementInfo sqlStatementInfo)
          Sets the SQLStatementInfo associated with this input to the given object.
 void setStatementType(int statementType)
          Sets the StatementType for in this input.
 void setWindowStateInfo(IWindowStateInfo windowStateInfo)
          Sets the window state information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLBuilderEditorInput

public SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo,
                             int statementType)
Creates an instance of this class with the given ConnectionInfo and StatementType. This constructor is used to create new SQL statements.

Parameters:
connectionInfo - the ConnectionInfo
statementType - statement type is used for creating new statements. The value must be one of StatementHelper's STATEMENT_TYPE constants.

SQLBuilderEditorInput

public SQLBuilderEditorInput(IConnectionProfile connectionProfile,
                             int statementType)
Creates an instance of this class with the given ConnectionProfile and StatementType. This constructor is used to create new SQL statements.

Parameters:
connectionProfile - the ConnectionProfile
statementType - statement type is used for creating new statements. The value must be one of StatementHelper's STATEMENT_TYPE constants.

SQLBuilderEditorInput

public SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo,
                             ISQLStatementInfo sqlStatementInfo)
Creates an instance of this class with the given ConnectionInfo and SQLStatementInfo. This constructor should be used to create a SQLBuilderEditorInput based on an existing SQL statement. The SQLStatementInfo may optionally contain a SQLDialectInfo object to specify the SQL dialect.

Parameters:
connectionInfo - the ConnectionInfo
sqlStatementInfo - the SQLStatementInfo

SQLBuilderEditorInput

public SQLBuilderEditorInput(IConnectionProfile connectionProfile,
                             ISQLStatementInfo sqlStatementInfo)
Creates an instance of this class with the given ConnectionProfile and SQLStatementInfo. This constructor should be used to create a SQLBuilderEditorInput based on an existing SQL statement. The SQLStatementInfo may optionally contain a SQLDialectInfo object to specify the SQL dialect.

Parameters:
connectionProfile - the ConnectionProfile
sqlStatementInfo - the SQLStatementInfo

SQLBuilderEditorInput

public SQLBuilderEditorInput(ISQLEditorConnectionInfo connectionInfo,
                             ISQLStatementInfo sqlStatementInfo,
                             IOmitSchemaInfo omitSchemaInfo)
Creates an instance of this class with the given ConnectionInfo and SQLStatementInfo. This constructor should be used to create a SQLBuilderEditorInput based on an existing SQL statement. The SQLStatementInfo may optionally contain a SQLDialectInfo object to specify the SQL dialect.

Parameters:
connectionInfo - the ConnectionInfo
sqlStatementInfo - the SQLStatementInfo
omitSchemaInfo - the OmitSchemaInfo

SQLBuilderEditorInput

public SQLBuilderEditorInput(IConnectionProfile connectionProfile,
                             ISQLStatementInfo sqlStatementInfo,
                             IOmitSchemaInfo omitSchemaInfo)
Creates an instance of this class with the given ConnectionProfile, SQLStatementInfo and OmitSchemaInfo. This constructor should be used to create a SQLBuilderEditorInput based on an existing SQL statement. The SQLStatementInfo may optionally contain a SQLDialectInfo object to specify the SQL dialect.

Parameters:
connectionProfile - the ConnectionProfile
sqlStatementInfo - the SQLStatementInfo
omitSchemaInfo - the OmitSchemaInfo
Method Detail

getConnectionInfo

public ISQLEditorConnectionInfo getConnectionInfo()
Gets the ISQLEditorConnectionInfo associated with this input.

Specified by:
getConnectionInfo in interface ISQLBuilderEditorInput
Specified by:
getConnectionInfo in interface ISQLEditorInput
Returns:
the current ISQLEditorConnectionInfo object

setConnectionInfo

public void setConnectionInfo(ISQLEditorConnectionInfo connInfo)
Sets the ISQLEditorConnectionInfo associated with this input to the given object.

Specified by:
setConnectionInfo in interface ISQLBuilderEditorInput
Specified by:
setConnectionInfo in interface ISQLEditorInput
Parameters:
connInfo - the ISQLEditorConnectionInfo object to set

getConnectionProfile

public IConnectionProfile getConnectionProfile()
Gets the IConnectionProfile associated with this input.

Returns:
the current IConnectionProfile object

setConnectionProfile

public void setConnectionProfile(IConnectionProfile connProfile)
Sets the IConnectionProfile associated with this input to the given object.

Parameters:
connInfo - the IConnectionProfile object to set

setOmitSchemaInfo

public void setOmitSchemaInfo(IOmitSchemaInfo omitSchemaInfo)
Sets the OmitSchemaInfo associated with this input to the given object.

Specified by:
setOmitSchemaInfo in interface ISQLBuilderEditorInput
Parameters:
omitSchemaInfo - the OmitSchemaInfo object to set

getOmitSchemaInfo

public IOmitSchemaInfo getOmitSchemaInfo()
Gets the IOmitSchemaInfo associated with this input.

Specified by:
getOmitSchemaInfo in interface ISQLBuilderEditorInput
Returns:
the current IOmitSchemaInfo object

setSQLStatementInfo

public void setSQLStatementInfo(ISQLStatementInfo sqlStatementInfo)
Sets the SQLStatementInfo associated with this input to the given object.

Parameters:
sqlStatementInfo - the ISQLStatementInfo object to set

getSQLStatementInfo

public ISQLStatementInfo getSQLStatementInfo()
Gets the ISQLStatementInfo associated with this input.

Returns:
the current ISQLStatementInfo object

getSQL

public java.lang.String getSQL()
Gets the SQLStatement contained in this input's File

Specified by:
getSQL in interface ISQLBuilderEditorInput
Returns:
String the SQL Statement for this input.

getStatementType

public int getStatementType()
Gets the StatementType for in this input. Statement type is used for creating new statements. The value must be one of StatementHelper's STATEMENT_TYPE constants.


setStatementType

public void setStatementType(int statementType)
Sets the StatementType for in this input. Statement type is used for creating new statements. The value must be one of StatementHelper's STATEMENT_TYPE constants.


getId

public java.lang.String getId()
Description copied from interface: ISQLEditorInput
Returns the unique identifier that distinguishes this editor input

Specified by:
getId in interface ISQLEditorInput
Returns:
A string id

isConnectionRequired

public boolean isConnectionRequired()
Description copied from interface: ISQLEditorInput
Returns whether database connection is required for this editor input to exist.

Specified by:
isConnectionRequired in interface ISQLEditorInput
Returns:

exists

public boolean exists()
Specified by:
exists in interface org.eclipse.ui.IEditorInput

getImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
Specified by:
getImageDescriptor in interface org.eclipse.ui.IEditorInput

getName

public java.lang.String getName()
Specified by:
getName in interface org.eclipse.ui.IEditorInput

getPersistable

public org.eclipse.ui.IPersistableElement getPersistable()
Specified by:
getPersistable in interface org.eclipse.ui.IEditorInput

getToolTipText

public java.lang.String getToolTipText()
Specified by:
getToolTipText in interface org.eclipse.ui.IEditorInput

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

getWindowStateInfo

public IWindowStateInfo getWindowStateInfo()
Description copied from interface: ISQLBuilderEditorInput
Gets the window state information which stores the control states of the SQL Query Builder.

Specified by:
getWindowStateInfo in interface ISQLBuilderEditorInput

setWindowStateInfo

public void setWindowStateInfo(IWindowStateInfo windowStateInfo)
Description copied from interface: ISQLBuilderEditorInput
Sets the window state information.

Specified by:
setWindowStateInfo in interface ISQLBuilderEditorInput

getInputUsageOptions

public ISQLBuilderEditorInputUsageOptions getInputUsageOptions()
Description copied from interface: ISQLBuilderEditorInput
Gets the usage options of the editor input. The options may be configured independent of the existence of specific input info.

Specified by:
getInputUsageOptions in interface ISQLBuilderEditorInput

setInputUsageOptions

public void setInputUsageOptions(ISQLBuilderEditorInputUsageOptions options)
Description copied from interface: ISQLBuilderEditorInput
Sets the usage options of the editor input.

Specified by:
setInputUsageOptions in interface ISQLBuilderEditorInput