public final class DBEditorConfig
extends java.lang.Object
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.
config.getResult()
will return a DBEditorConfig.Result
object which indicates success or failure.
final DBEditorConfig config = dataContext.find( DBEditorConfig.class );
DBEditorFactory.launchDialog(DBEditorConfig)
Modifier and Type | Class and Description |
---|---|
static class |
DBEditorConfig.Result
Result class for the commit operation to the provider.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<SystemObject> |
getAdditionalObjects()
Deprecated.
with no replacement
|
DBObject |
getChildObject()
Gets the child object being edited (if there is one).
|
static DBEditorConfig |
getConfig(Context context)
Gets the DBEditorConfig
|
DBEditorFactory.EditorType |
getEditorType()
Available after launch, this gets the type of DBEditor that has been launched.
|
DBException |
getException()
If the dialog result is
Result.FAILED this method will return the exception encountered in commiting to the DBObjectProvider. |
Table |
getIndexParent()
If this config was created for a new Index in the context of a specific Table, this returns that Table.
|
SystemObject |
getNewObject()
Deprecated.
renamed to
getUpdatedObject() for consistency across the API. |
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.
|
java.lang.String |
getProperty()
Gets the property that should be focused on when the editor or edit dialog is shown.
|
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.
|
java.lang.String |
getStartPage()
Gets the page that should be selected initialy when the editor is first launched.
|
SystemObject |
getUpdatedObject()
Gets the "updatedObject".
|
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 |
isEdit()
Convenience method for checking that there is no original object.
|
boolean |
isEditable()
Returns true if the object in the dialog can be edited, or false if the object is read only.
|
boolean |
isInFlatEditor()
Convinience method to test whether the editor type that was launched is a flat editor.
|
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 |
newClonedConfig(DBEditorConfig config)
Clones the given config to create another config that has the same launch information as the original config, but the result etc are reset.
|
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.
|
static DBEditorConfig |
newEmptyConfig(DBObjectProvider pro)
Creates a new config containing only the provider.
|
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.
|
static void |
setConfig(Context context, DBEditorConfig config)
Sets the given config as a property on the Context so that it can be passed to the EditorManager.
|
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)
Deprecated.
renamed to
setUpdatedObject(SystemObject) for consistency across the API. |
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 |
setProperty(java.lang.String property)
Sets the specific property that an edit is required for.
|
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 |
setStartPage(java.lang.String startPage)
Sets the page that should be selected initially when the editor is first launched.
|
void |
setUpdatedObject(SystemObject updatedObject)
Sets the "updated object" - i.e.
|
void |
setUseBackgroundTask(boolean backgroundTask)
Not used yet.
|
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 DBEditorFactory.EditorType getEditorType()
public boolean isInFlatEditor()
getEditorType()
public void setStartPage(java.lang.String startPage)
startPage
- the editor's starting pagepublic java.lang.String getStartPage()
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()
getUpdatedObject()
public void setProperty(java.lang.String property)
setChildObject(oracle.javatools.db.DBObject)
.public java.lang.String getProperty()
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.@Deprecated public void setNewObject(SystemObject newObject)
setUpdatedObject(SystemObject)
for consistency across the API.public void setUpdatedObject(SystemObject updatedObject)
newObject
- the object the panels in the dialog can edit@Deprecated public SystemObject getNewObject()
getUpdatedObject()
for consistency across the API.public SystemObject getUpdatedObject()
public void setOriginalObject(SystemObject originalObject)
public SystemObject getOriginalObject()
public boolean isEdit()
@Deprecated public java.util.List<SystemObject> getAdditionalObjects()
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 Table getIndexParent()
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)
public static DBEditorConfig newEmptyConfig(DBObjectProvider pro)
pro
- the context providerpublic static void setConfig(Context context, DBEditorConfig config)
public static DBEditorConfig getConfig(Context context)
context
-public static DBEditorConfig newClonedConfig(DBEditorConfig config)
config
- the config to clone