org.eclipse.datatools.sqltools.sqlbuilder.actions
Class ActionHelper

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqlbuilder.actions.ActionHelper

public class ActionHelper
extends java.lang.Object

This class provides a set of helpful functions that support New and Open actions.


Constructor Summary
ActionHelper()
           
 
Method Summary
static org.eclipse.ui.IEditorInput createEditorInput(org.eclipse.core.resources.IResource resource, java.lang.String editorID, ISQLEditorConnectionInfo connInfo)
          Creates and returns an IEditorInput object that is suitable for the given editor.
static java.lang.String[] getTemplateDDLStatements()
          Gets an array of strings containing a set of template DDL statements.
static java.lang.String[] getTemplateDMLStatements()
          Gets an array of strings containing a set of template DML statements.
static java.lang.String getTemplateSQLForStatementType(int statementType)
          Gets template SQL for the given statement type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionHelper

public ActionHelper()
Method Detail

createEditorInput

public static org.eclipse.ui.IEditorInput createEditorInput(org.eclipse.core.resources.IResource resource,
                                                            java.lang.String editorID,
                                                            ISQLEditorConnectionInfo connInfo)
Creates and returns an IEditorInput object that is suitable for the given editor.

Parameters:
resource - the resource (typically a file resource) with which to create the editor input
editorID - the editor ID (defined in the editor's plugin.xml) for which an IEditorInput object is needed. The supported editors are the SQL Builder and the SQL Editor.
connInfo - a ISQLEditorConnectionInfo object to use to create the editor input
Returns:
the edit input object

getTemplateDDLStatements

public static java.lang.String[] getTemplateDDLStatements()
Gets an array of strings containing a set of template DDL statements.

Returns:
the array of DDL statements

getTemplateDMLStatements

public static java.lang.String[] getTemplateDMLStatements()
Gets an array of strings containing a set of template DML statements.

Returns:
the array of DML statements

getTemplateSQLForStatementType

public static java.lang.String getTemplateSQLForStatementType(int statementType)
Gets template SQL for the given statement type. Depending on the statement type, the template may be one or several SQL statements. The statement types are defined in StatementHelper, plus some additional SQL Editor-specific statement types defined in NewSQLStatementControl The statement types defined in StatementHelper return a single template SQL statement. The statement types defined in NewSQLStatementControl return either several template SQL statements or none.

Parameters:
statementType - the type of statement for which the SQL template is needed
Returns:
the template SQL for the statement type
See Also:
StatementHelper, NewSQLStatementComposite