|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.db.dialogs.DBEditorConfig
public final class DBEditorConfig
Configuration class for launching a database object "Create" or "Edit" dialog.
Create a new config using the static methods newCreateConfig or newEditConfig as appropriate, the methods are overloaded for the various scenarios of create or edit.
Example 1: config for creating a new Table in a provider in schema1
final DBEditorConfig config = DBEditorConfig.newCreateConfig( pro, Table.TYPE, schema1 );
Example 2: config for editing an existing Table (table1) in a provider
final DBEditorConfig config = DBEditorConfig.newEditConfig( pro, table1 );
Once you have a config, launch it using launchDialog method on the appropriate DBEditorFactory.
After the dialog has been launched, the config can be inspected to find out what the result of the edit was. Calling config.getResult()
will return a DBEditorConfig.Result
object which indicates success or failure.
For traversable panels in the dialog, the config is accessed via the context passed into onEntry or onExit as follows:
final DBEditorConfig config = dataContext.find( DBEditorConfig.class );
DBEditorFactory.launchDialog(DBEditorConfig)
Nested Class Summary | |
---|---|
static class |
DBEditorConfig.Result Result class for the commit operation to the provider. |
Method Summary | |
---|---|
java.util.List<SystemObject> |
getAdditionalObjects() Gets any additional objects that have been created as part of the create or edit operation. |
DBObject |
getChildObject() Gets the child object being edited (if there is one). |
DBException |
getException() If the dialog result is Result.FAILED this method will return the exception encountered in commiting to the DBObjectProvider. |
SystemObject |
getNewObject() Gets the "newObject". |
java.lang.String |
getObjectType() Gets the type of SystemObject that the create or edit operation is for. |
SystemObject |
getOriginalObject() For an edit operation, this returns the original objec that the DBObjectProvider has in memory. |
DBObjectNode |
getOriginalObjectNode() If this config was created using a DBObjectNode representing the object to edit, this returns that node. |
DBObjectProvider |
getProvider() Gets the DBObjectProvider for the create or edit operation. |
DBEditorConfig.Result |
getResult() Gets the dialog result. |
Schema |
getSchema() Gets the schema for the current dialog. |
Schema[] |
getSchemaList() Gets the list of Schemas to use in the dialog for any schema pickers. |
boolean |
isChildEditOnly() Checks whether we are editing a child object in isolation rather than within the context of the parent's edit dialog. |
boolean |
isCommitToProvider() Tests whether this dialog invocation should commit any changes to the underlying DBObjectProvider on exit. |
boolean |
isEditable() Returns true if the object in the dialog can be edited, or false if the object is read only. |
boolean |
isReplaceAllowed() Tests whether the commit is allowed to replace existing objects (drop/create) rather than just update them. |
boolean |
isUseBackgroundTask() Not used yet. |
static DBEditorConfig |
newCreateConfig(DBObjectProvider pro, DBObject obj) Creates a new config for launching a database object create dialog. |
static DBEditorConfig |
newCreateConfig(DBObjectProvider pro, java.lang.String type, DBObject parent) Creates a new config for launching a database object create dialog. |
static DBEditorConfig |
newCreateConfig(DBObjectProvider pro, java.lang.String type, Schema schema) Creates a new config for launching a database object create dialog. |
static DBEditorConfig |
newCreateConfig(DBObjectTypeNode node) Creates a new config for launching a database object create dialog. |
static DBEditorConfig |
newEditConfig(DBObjectNode node) Creates a new config for launching a database object edit dialog. |
static DBEditorConfig |
newEditConfig(DBObjectProvider pro, DBObject obj) Creates a new config for launching a database object edit dialog. |
void |
setChildEditOnly(boolean childEditOnly) If there is a child object, this property governs whether the dialog launched is solely for that object, or edits the parent SystemObject and initial focus is on the child object. |
void |
setChildObject(DBObject childObject) Sets the child object. |
void |
setCommitToProvider(boolean commit) Sets whether the dialog should commit any changes to the underlying DBObjectProvider on exit, or just update the memory model. |
void |
setEditable(boolean editable) Sets whether the object should be editable or not. |
void |
setException(DBException exception) If the commit operation fails with a DBException, this method is used by the framework to specify the failure. |
void |
setNewObject(SystemObject newObject) Sets the newObject - i.e. |
void |
setObjectType(java.lang.String objectType) Sets the type of SystemObject that the create or edit operation is for. |
void |
setOriginalObject(SystemObject originalObject) Sets the original object for an edit operation. |
void |
setReplaceAllowed(boolean allowReplace) If the operation is an edit, this sets whether the operation is allowed to replace objects in the database rather than just update. |
void |
setReplaceAlwaysAllowed(boolean allowReplace) Registers that the object being edited can always be replaced regardless of the properties that are changed. |
void |
setResult(DBEditorConfig.Result dialogResult) Sets the dialog result. |
void |
setSchema(Schema schema) Sets the default schema to use in the dialog for any schema pickers. |
void |
setSchemaList(Schema[] schemaList) Sets the schema list for the dialog. |
void |
setUseBackgroundTask(boolean backgroundTask) Not used yet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public DBObjectProvider getProvider()
public void setReplaceAlwaysAllowed(boolean allowReplace)
allowReplace
- true if the api can replace objects rather than just update them.public void setReplaceAllowed(boolean allowReplace)
allowReplace
- true if the api can replace objects rather than just update them.public boolean isReplaceAllowed()
public void setCommitToProvider(boolean commit)
commit
- whether to commit changes to the providerpublic boolean isCommitToProvider()
public void setChildObject(DBObject childObject)
isChildEditOnly()
then the launched dialog will be solely for this object. When editing, during creation of the config (i.e. before launch) this should be a child of the originalObject.childObject
- a child of the original object to edit.public DBObject getChildObject()
getNewObject()
public void setSchema(Schema schema)
schema
- a schema in the underlying DBObjectProvider to use by default when picking a schema.public Schema getSchema()
setSchema
this will query (and remember) the default schema for the underlying DBObjectProvider.public void setSchemaList(Schema[] schemaList)
schemaList
- the list of schemas available to the user.public Schema[] getSchemaList()
setSchemaList
, this will list (and cache) the schemas visible to the current user in the underlying DBObjectProvider.public void setNewObject(SystemObject newObject)
newObject
- the object the panels in the dialog can editpublic SystemObject getNewObject()
public void setOriginalObject(SystemObject originalObject)
public SystemObject getOriginalObject()
public java.util.List<SystemObject> getAdditionalObjects()
The list is modifiable so any new objects can be added to the returned list for them to be recorded in this config.
public void setUseBackgroundTask(boolean backgroundTask)
Sets whether to do the commit as background task, rather than with a progress bar, when the user ok's the dialog.
backgroundTask
- if true a progress bar isn't used on commit and the create or update is fired in the background instead.public boolean isUseBackgroundTask()
Gets whether the commit should happen in the background, or in a progress bar
public void setEditable(boolean editable)
editable
- whether the object is actually editable (e.g. the current user has permissions to alter the object).public boolean isEditable()
public void setChildEditOnly(boolean childEditOnly)
childEditOnly
-public boolean isChildEditOnly()
public void setResult(DBEditorConfig.Result dialogResult)
public DBEditorConfig.Result getResult()
Result.SUCCESS
then the operation has fully commited to the underlying DBObjectProvider.public void setException(DBException exception)
exception
- an exception encountered on commit.public DBException getException()
Result.FAILED
this method will return the exception encountered in commiting to the DBObjectProvider.public void setObjectType(java.lang.String objectType)
public java.lang.String getObjectType()
public DBObjectNode getOriginalObjectNode()
public static DBEditorConfig newEditConfig(DBObjectNode node)
node
- the node for the object to be editedDBEditorFactory.launchDialog(DBEditorConfig)
public static DBEditorConfig newEditConfig(DBObjectProvider pro, DBObject obj)
pro
- the containing object providerobj
- the object to edit in a dialogDBEditorFactory.launchDialog(DBEditorConfig)
public static DBEditorConfig newCreateConfig(DBObjectTypeNode node)
node
- the node containing the type/schema/provider needed for the createDBEditorFactory.launchDialog(DBEditorConfig)
public static DBEditorConfig newCreateConfig(DBObjectProvider pro, java.lang.String type, Schema schema)
pro
- the provider the object will be created intype
- the type of object to createschema
- the Schema to create the object in (ignored if the type is not a SchemaObject.DBEditorFactory.launchDialog(DBEditorConfig)
public static DBEditorConfig newCreateConfig(DBObjectProvider pro, DBObject obj)
pro
- the provider the object will be created inobj
- a new object definition to "edit" in the dialog before commiting to the provider.DBEditorFactory.launchDialog(DBEditorConfig)
public static DBEditorConfig newCreateConfig(DBObjectProvider pro, java.lang.String type, DBObject parent)
pro
- the provider the object will be created intype
- the type of object to createparent
- the parent object to create the new object under (e.g. the Table if type is Column.TYPE
.DBEditorFactory.launchDialog(DBEditorConfig)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |