public final class ProviderOperator
extends java.lang.Object
It is safe to use this in code that runs in headless junit tests. When running headless all commits will happen in the calling thread and exceptions will be logged rather than using an error dialog.
Constructor and Description |
---|
ProviderOperator(DBObjectProvider pro)
Creates a new operator for making changes in the given provider.
|
ProviderOperator(DBObjectProvider pro,
Context context)
Creates a new operator for making changes in the given provider.
|
Modifier and Type | Method and Description |
---|---|
boolean |
commitTransaction(DBObjectTransaction txn)
Commits the changes in the given transaction.
|
boolean |
createObjects(SystemObject[] objs)
Creates the given objects in the provider.
|
Difference |
difference(SystemObject[] orig,
SystemObject[] upd)
Diffs the two sets of objects using the provider's DiffEngine.
|
static java.lang.String |
getTitle(DBEditorConfig config)
Gets a default generic title appropriate for the given editor config.
|
void |
setTitle(java.lang.String title)
Optionally sets a title that will be used for the progress bar and any
error dialog shown to the user.
|
boolean |
updateObjects(DBEditorConfig config)
Creates or updates the object in the given editor config using the
CascadeConfirmDialog.
|
boolean |
updateObjects(SystemObject[] old,
SystemObject[] updateObjs)
Updates the given objects in the provider.
|
public ProviderOperator(DBObjectProvider pro)
pro
- the provider the operations will be performed inpublic ProviderOperator(DBObjectProvider pro, Context context)
pro
- the provider the operations will be performed incontext
- the IDE context we're working withinpublic void setTitle(java.lang.String title)
title
- the title to use for any dialogs.public Difference difference(SystemObject[] orig, SystemObject[] upd)
public boolean createObjects(SystemObject[] objs)
the
- objects to createDBObjectProvider.createObjects(SystemObject[],boolean)
public boolean updateObjects(SystemObject[] old, SystemObject[] updateObjs)
public boolean updateObjects(DBEditorConfig config)
config
- contains provider, new object and (when editing) original
object to update with.public boolean commitTransaction(DBObjectTransaction txn)
txn
- the changes to committrue
if the update was successfulpublic static java.lang.String getTitle(DBEditorConfig config)