org.eclipse.datatools.sqltools.schemaobjecteditor.ui.util
Class SchemaObjectEditorUtils

java.lang.Object
  extended by org.eclipse.datatools.sqltools.schemaobjecteditor.ui.util.SchemaObjectEditorUtils

public class SchemaObjectEditorUtils
extends java.lang.Object

Contains some static utility methods for schama object editor.

Author:
Idull

Constructor Summary
SchemaObjectEditorUtils()
           
 
Method Summary
static void expandNode(SQLObject obj)
          Expand the tree node and reveal the editing object after refresh For editor, we do not know the status of the tree in the DSE when editing, so we have to expand every node on the path from the root to the editing object.
static org.eclipse.swt.widgets.TreeItem findAndExpandObjectNode(org.eclipse.swt.widgets.TreeItem item, SQLObject obj, org.eclipse.ui.navigator.CommonViewer viewer)
           
static org.eclipse.swt.widgets.TreeItem findAndExpandVirtualNode(org.eclipse.swt.widgets.TreeItem item, java.lang.String NodeType, org.eclipse.ui.navigator.CommonViewer viewer)
           
static IEditorDescriptor getEditorById(java.lang.String editorId)
          Returns the editor given the editor id, there may be several editors with the same id, we always return the first one
static IEditorDescriptor getEditorByObjectType(java.lang.String dbName, java.lang.String dbVersion, org.eclipse.emf.ecore.EClass objectType)
          Returns the editor instance containing extension information given the database object of the given database type.
static IEditorDescriptor[] getEditorsByName(java.lang.String editorName)
          Returns the editors of the given name
static IEditorDescriptor[] getEditorsByVendorName(java.lang.String vendorName)
          Returns the editors for the given database
static java.util.Map getEditorsCatalogedByDBDefinition()
          Returns all the defined editors, cataloged by db definition
static org.eclipse.ui.IEditorPart openEditor(java.lang.String editorId, ISchemaObjectEditModel modelObject, org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier)
          Opens the editor given the editor id
static org.eclipse.ui.IEditorPart openEditor(java.lang.String dbName, java.lang.String dbVersion, java.lang.String objectTypeId, ISchemaObjectEditModel modelObject, org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier)
          Opens the editor for the given database object of the given database type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaObjectEditorUtils

public SchemaObjectEditorUtils()
Method Detail

openEditor

public static org.eclipse.ui.IEditorPart openEditor(java.lang.String dbName,
                                                    java.lang.String dbVersion,
                                                    java.lang.String objectTypeId,
                                                    ISchemaObjectEditModel modelObject,
                                                    org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier)
Opens the editor for the given database object of the given database type.

Parameters:
dbName - the name of the database
dbVersion - the version of the database
objectTypeId - the id of the database object
Returns:
an IEditorPart instance if succeeded, null otherwise

openEditor

public static org.eclipse.ui.IEditorPart openEditor(java.lang.String editorId,
                                                    ISchemaObjectEditModel modelObject,
                                                    org.eclipse.datatools.sqltools.core.DatabaseIdentifier databaseIdentifier)
Opens the editor given the editor id

Parameters:
editorId - the id of the editor
modelObject - the model
databaseIdentifier -
Returns:

getEditorByObjectType

public static IEditorDescriptor getEditorByObjectType(java.lang.String dbName,
                                                      java.lang.String dbVersion,
                                                      org.eclipse.emf.ecore.EClass objectType)
Returns the editor instance containing extension information given the database object of the given database type. Always returns the first match.

Parameters:
dbName - the database name
dbVersion - the database version
objectType - the database object type to be edit
Returns:
the editor instance containing editor extension information and pages information, null if the extension can not be found

getEditorById

public static IEditorDescriptor getEditorById(java.lang.String editorId)
Returns the editor given the editor id, there may be several editors with the same id, we always return the first one

Parameters:
editorId -
Returns:

getEditorsByName

public static IEditorDescriptor[] getEditorsByName(java.lang.String editorName)
Returns the editors of the given name

Parameters:
editorName -
Returns:

getEditorsByVendorName

public static IEditorDescriptor[] getEditorsByVendorName(java.lang.String vendorName)
Returns the editors for the given database

Parameters:
vendorName -
Returns:

getEditorsCatalogedByDBDefinition

public static java.util.Map getEditorsCatalogedByDBDefinition()
Returns all the defined editors, cataloged by db definition

Returns:

expandNode

public static void expandNode(SQLObject obj)
Expand the tree node and reveal the editing object after refresh For editor, we do not know the status of the tree in the DSE when editing, so we have to expand every node on the path from the root to the editing object.


findAndExpandVirtualNode

public static org.eclipse.swt.widgets.TreeItem findAndExpandVirtualNode(org.eclipse.swt.widgets.TreeItem item,
                                                                        java.lang.String NodeType,
                                                                        org.eclipse.ui.navigator.CommonViewer viewer)

findAndExpandObjectNode

public static org.eclipse.swt.widgets.TreeItem findAndExpandObjectNode(org.eclipse.swt.widgets.TreeItem item,
                                                                       SQLObject obj,
                                                                       org.eclipse.ui.navigator.CommonViewer viewer)