Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.db.dialogs
Class BaseDBEditorFactory

java.lang.Object
  extended by oracle.ide.db.dialogs.BaseDBEditorFactory
All Implemented Interfaces:
DBEditorFactory

public class BaseDBEditorFactory
extends java.lang.Object

Default implementation of DBEditorFactory that uses registered PanelLibrary classes to determine which objects are supported, and to drive the use of the default db object editor.

Since:
11.0

Constructor Summary
protected BaseDBEditorFactory()
           
 
Method Summary
 boolean canCreateDBObject(DBObjectTypeNode node)
          Whether this DBEditorFactory will be able to create a new database object under the given node.
 boolean canCreateDBObject(Schema schema, DBObjectProvider pro, java.lang.String dbObjectType)
          Whether this DBEditorFactory will be able to create a new dabtabase object of a specific type in a specific context.
 boolean canEditDBObject(DBObject obj, DBObjectProvider pro)
          Whether this DBEditorFactory will be able to edit an existing provider object of a specific type in a specific context.
 boolean canEditDBObject(DBObjectNode node)
          Deprecated. 
 boolean canEditDBObject(SchemaObject obj, DBObjectProvider pro)
           
protected  boolean canUpdateObject(DBObject obj, DBObjectProvider pro)
          If canEditDBObject returns true, then this method is used to determine whether the verifiers are set to be editable or not.
 boolean createDBObject(DBObject newObj, DBObjectProvider pro)
          Creates a new schema object using the given starting object in the given provider.
 boolean createDBObject(DBObject newObj, DBObjectProvider pro, boolean commitToProvider)
          Creates a new schema object using the given starting object in the given provider.
 DBObject createDBObject(DBObjectNode node, java.lang.String dbObjectType)
          Creates a new database object of given type using the given node's object as a parent.
<T extends DBObject>
T
createDBObject(DBObjectProvider pro, T template, DBObject parent, boolean commitToProvider)
          Creates a new database object using the given template.
 SchemaObject createDBObject(DBObjectTypeNode node)
          Creates a new database object.
 SchemaObject createDBObject(Schema schema, DBObjectProvider pro, java.lang.String dbObjectType)
          Creates a new database object of a specific type in the given schema and provider.
 DBObject createDBObject(Schema schema, DBObjectProvider pro, java.lang.String dbObjectType, DBObject parent, boolean commitToProvider)
          Creates a new database object of a specific type in the given schema and provider using the given parent object.
<T extends SystemObject>
T
createDBObject(Schema schema, DBObjectProvider pro, T template, boolean commitToProvider)
          Creates a new database object using the given object as a template in the given schema and provider using the given parent object.
protected
<T extends DBObject>
T
createDBObject(Schema schema, DBObjectProvider pro, T template, DBObject parent, boolean commitToProvider)
           
protected  Namespace createNamespace(DBObjectProvider provider, DBObject object, DBObject child, java.util.Map<java.lang.String,java.lang.Class> verifiers, boolean isEdit, boolean commitToProvider)
           
 boolean editDBObject(DBObject obj, DBObjectProvider pro)
          Edits an existing database object in a provider.
 boolean editDBObject(DBObject obj, DBObjectProvider pro, boolean commitToProvider)
          Edits an existing database object in a provider.
 boolean editDBObject(DBObject obj, DBObjectProvider pro, DBObject child)
          Edits an existing database object in a provider.
 boolean editDBObject(DBObject obj, DBObjectProvider pro, DBObject child, boolean commitToProvider)
          Edits an existing database object in a provider.
 boolean editDBObject(DBObjectNode node)
          Edits and existing database object in a provider.
 boolean editDBObject(SchemaObject obj, DBObjectProvider pro)
           
 java.lang.String getCreateLabel(java.lang.String dbObjectType)
          Retrieves the menu label for creating new objects of the specified type.
protected  PanelLibrary getPanelLibrary(java.lang.String dbObjectType)
           
protected  void initializeLibrary(PanelLibrary lib)
          This is called when each library is created.
 boolean isCreateSupported(java.lang.String dbObjectType)
          Whether this DBEditorFactory supports the creation of objects of the specified type.
 java.lang.String[] listSupportedTypes()
          Lists all the types that create/edit is supported for.
protected  void registerLibrary(java.lang.String dbObjectType, java.lang.Class<? extends PanelLibrary> libClass)
           
protected  boolean supportsObjectType(java.lang.String dbObjectType, DBObjectProvider pro)
           
protected  void unregisterLibrary(java.lang.String dbObjectType, java.lang.Class<? extends PanelLibrary> libClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDBEditorFactory

protected BaseDBEditorFactory()
Method Detail

getPanelLibrary

protected PanelLibrary getPanelLibrary(java.lang.String dbObjectType)

initializeLibrary

protected void initializeLibrary(PanelLibrary lib)
This is called when each library is created. At this stage default panels can be added to the library.

See Also:
PanelLibrary.setDefaultPanels(oracle.ide.panels.Navigable[])

registerLibrary

protected void registerLibrary(java.lang.String dbObjectType,
                               java.lang.Class<? extends PanelLibrary> libClass)

unregisterLibrary

protected void unregisterLibrary(java.lang.String dbObjectType,
                                 java.lang.Class<? extends PanelLibrary> libClass)

listSupportedTypes

public java.lang.String[] listSupportedTypes()
Lists all the types that create/edit is supported for.

Specified by:
listSupportedTypes in interface DBEditorFactory
Returns:
an array of the types edit dialogs are available for.
See Also:
DBObject.getType()

isCreateSupported

public boolean isCreateSupported(java.lang.String dbObjectType)
Whether this DBEditorFactory supports the creation of objects of the specified type. This is primarily used to determine whether a context menu item should be added for the type; the menu may or may not be enabled depending on whether the factory can create objects in a particular context.

Specified by:
isCreateSupported in interface DBEditorFactory
Parameters:
dbObjectType - the type of object
Returns:
whether the 'New' menu item should be added
See Also:
DBObject.getType()

canCreateDBObject

public boolean canCreateDBObject(Schema schema,
                                 DBObjectProvider pro,
                                 java.lang.String dbObjectType)
Whether this DBEditorFactory will be able to create a new dabtabase object of a specific type in a specific context.

Specified by:
canCreateDBObject in interface DBEditorFactory
Parameters:
schema - The schema to create the object in
pro - The DBObjectProvider instance to create the object in
dbObjectType - The type of database object to create
See Also:
DBObjectProvider, DBObject.getType()

supportsObjectType

protected boolean supportsObjectType(java.lang.String dbObjectType,
                                     DBObjectProvider pro)

createDBObject

public final DBObject createDBObject(Schema schema,
                                     DBObjectProvider pro,
                                     java.lang.String dbObjectType,
                                     DBObject parent,
                                     boolean commitToProvider)
Creates a new database object of a specific type in the given schema and provider using the given parent object.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
schema - The schema to create the object in
pro - The DBObjectProvider instance to create the object in
dbObjectType - The type of database object to create
parent - the owning object of the object to be created (e.g. Table for a new Index)
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, create a new Index as part of the edit and commit the whole lot together later).
Returns:
the new object if it was successfully created
See Also:
DBObjectProvider, DBObject.getType()

createDBObject

protected <T extends DBObject> T createDBObject(Schema schema,
                                                DBObjectProvider pro,
                                                T template,
                                                DBObject parent,
                                                boolean commitToProvider)

createDBObject

public final boolean createDBObject(DBObject newObj,
                                    DBObjectProvider pro,
                                    boolean commitToProvider)
Creates a new schema object using the given starting object in the given provider.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
newObj - the new object being created
pro - The DBObjectProvider instance to create the object in
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, create a new Index as part of the edit and commit the whole lot together later).
Returns:
whether the object was sucessfully created.
See Also:
DBObjectProvider

canEditDBObject

public boolean canEditDBObject(DBObject obj,
                               DBObjectProvider pro)
Whether this DBEditorFactory will be able to edit an existing provider object of a specific type in a specific context.

Specified by:
canEditDBObject in interface DBEditorFactory
Parameters:
obj - The SchemaObject to be edited
pro - The DBObjectProvider instance to create the object in

editDBObject

public boolean editDBObject(DBObject obj,
                            DBObjectProvider pro,
                            DBObject child,
                            boolean commitToProvider)
Edits an existing database object in a provider.

Specified by:
editDBObject in interface DBEditorFactory
Parameters:
obj - The SchemaObject to be edited
pro - The DBObjectProvider instance to create the object in
child - a specific child object to edit
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, edit an Index as part of the table edit and commit the whole lot together later).
Returns:
whether the object was sucessfully edited.

getCreateLabel

public java.lang.String getCreateLabel(java.lang.String dbObjectType)
Retrieves the menu label for creating new objects of the specified type.

Specified by:
getCreateLabel in interface DBEditorFactory
Parameters:
dbObjectType - the type of object
Returns:
the menu label
See Also:
DBObject.getType()

createNamespace

protected Namespace createNamespace(DBObjectProvider provider,
                                    DBObject object,
                                    DBObject child,
                                    java.util.Map<java.lang.String,java.lang.Class> verifiers,
                                    boolean isEdit,
                                    boolean commitToProvider)

canUpdateObject

protected boolean canUpdateObject(DBObject obj,
                                  DBObjectProvider pro)
If canEditDBObject returns true, then this method is used to determine whether the verifiers are set to be editable or not. If not then all edits within the dialog should be disabled.

By default this just returns true - i.e. allowing the edit of any object canEditDBObject returns true for.

Returns:
whether the edit dialog will allow the user to change anything

canCreateDBObject

public final boolean canCreateDBObject(DBObjectTypeNode node)
Whether this DBEditorFactory will be able to create a new database object under the given node.

Specified by:
canCreateDBObject in interface DBEditorFactory

createDBObject

public final SchemaObject createDBObject(Schema schema,
                                         DBObjectProvider pro,
                                         java.lang.String dbObjectType)
Creates a new database object of a specific type in the given schema and provider.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
schema - The schema to create the object in
pro - The DBObjectProvider instance to create the object in
dbObjectType - The type of database object to create
Returns:
the new object if it was successfully created
See Also:
DBObjectProvider, DBObject.getType()

createDBObject

public final SchemaObject createDBObject(DBObjectTypeNode node)
Creates a new database object. The type, schema and provider are all taken from the given node.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
node - the node describing the schema, type and provider
Returns:
the new object if it was successfully created

createDBObject

public final <T extends SystemObject> T createDBObject(Schema schema,
                                                       DBObjectProvider pro,
                                                       T template,
                                                       boolean commitToProvider)
Creates a new database object using the given object as a template in the given schema and provider using the given parent object.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
schema - The schema to create the object in
pro - The DBObjectProvider instance to create the object in
template - An object to use as a template for the new object
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, create a new Index as part of the edit and commit the whole lot together later).
Returns:
the new object if it was successfully created
See Also:
DBObjectProvider, DBObject.getType()

createDBObject

public final <T extends DBObject> T createDBObject(DBObjectProvider pro,
                                                   T template,
                                                   DBObject parent,
                                                   boolean commitToProvider)
Creates a new database object using the given template.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
pro - The DBObjectProvider instance to create the object in
template - the template for the new object
parent - the owning object of the object to be created (e.g. Table for a new Index)
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, create a new Index as part of the edit and commit the whole lot together later).
Returns:
the new object if it was successfully created
See Also:
DBObjectProvider, DBObject.getType()

createDBObject

public final DBObject createDBObject(DBObjectNode node,
                                     java.lang.String dbObjectType)
Creates a new database object of given type using the given node's object as a parent. So, for example, if the node is a Table node and dbObjectType is Index.TYPE this will fire the new Index dialog using the Table as a base.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
node - the node for the parent object
dbObjectType - the type of child object to be created
Returns:
the newly object if it was successfully created

createDBObject

public final boolean createDBObject(DBObject newObj,
                                    DBObjectProvider pro)
Creates a new schema object using the given starting object in the given provider.

Specified by:
createDBObject in interface DBEditorFactory
Parameters:
newObj - the new object being created
pro - The DBObjectProvider instance to create the object in
Returns:
whether the object was sucessfully created.
See Also:
DBObjectProvider

canEditDBObject

public final boolean canEditDBObject(SchemaObject obj,
                                     DBObjectProvider pro)
Specified by:
canEditDBObject in interface DBEditorFactory
See Also:
canEditDBObject(DBObject,DBObjectProvider)

canEditDBObject

@Deprecated
public final boolean canEditDBObject(DBObjectNode node)
Deprecated. 

Specified by:
canEditDBObject in interface DBEditorFactory

editDBObject

public final boolean editDBObject(DBObject obj,
                                  DBObjectProvider pro)
Edits an existing database object in a provider.

Specified by:
editDBObject in interface DBEditorFactory
Parameters:
obj - The SchemaObject to be edited
pro - The DBObjectProvider instance to create the object in
Returns:
whether the object was sucessfully edited.

editDBObject

public final boolean editDBObject(SchemaObject obj,
                                  DBObjectProvider pro)
Specified by:
editDBObject in interface DBEditorFactory
See Also:
#editObject(DBObject,DBObjectProvider)

editDBObject

public boolean editDBObject(DBObject obj,
                            DBObjectProvider pro,
                            boolean commitToProvider)
Edits an existing database object in a provider.

Specified by:
editDBObject in interface DBEditorFactory
Parameters:
obj - The SchemaObject to be edited
pro - The DBObjectProvider instance to create the object in
commitToProvider - whether the dialog should commit the change back to the DBObjectProvider as well as the parent object. This allows a dialog to be fired from within another editor context (e.g. the modeler) and the edit absorbed into the edit of the parent (e.g. editing a Table, edit an Index as part of the table edit and commit the whole lot together later).
Returns:
whether the object was sucessfully edited.

editDBObject

public final boolean editDBObject(DBObject obj,
                                  DBObjectProvider pro,
                                  DBObject child)
Edits an existing database object in a provider.

Specified by:
editDBObject in interface DBEditorFactory
Parameters:
obj - The SchemaObject to be edited
pro - The DBObjectProvider instance to create the object in
child - a specific child object to edit
Returns:
whether the object was sucessfully edited.

editDBObject

public final boolean editDBObject(DBObjectNode node)
Edits and existing database object in a provider. The object to edit is represented by the given node.

Specified by:
editDBObject in interface DBEditorFactory
Parameters:
node - the node representing the object to edit.
Returns:
whether the object was sucessfully edited.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.