|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.ide.db.transfer.generate.GenerateController
public abstract class GenerateController
Controller class for generation. Includes support for creating the generate submenu and handling the action within that. Must be subclasses to provide generate support for a given View.
Field Summary | |
---|---|
protected static java.lang.String |
GENERATE_CMD
|
static int |
GENERATE_CMD_ID
Command ID for the generate action. |
Fields inherited from interface oracle.ide.controller.Controller |
---|
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGED |
Constructor Summary | |
---|---|
protected |
GenerateController()
|
Method Summary | |
---|---|
protected abstract boolean |
areCompatible(DBObjectProvider source,
DBObjectProvider target)
|
void |
cancel(ApplyEvent event)
Called to cancel the FSMWizard . |
protected boolean |
canGenerate(Context context)
Called just before generation to give subclasses an opportunity to bail out. |
void |
checkCommit(ApplyEvent event)
Called to see if the listener is ready to commit. |
void |
commit(ApplyEvent event)
Called to have the listener perform the commit action. |
protected TransferDescriptor |
createDescriptor(java.lang.String name,
java.lang.Class<? extends TransferTarget> target,
Context context)
Creates a new TransferDescriptor. |
protected static IdeAction |
createGenerateAction(java.lang.String name,
java.lang.Class<? extends TransferTarget> target,
GenerateController controller)
Creates an IdeAction for the given name and transfer target. |
static javax.swing.JMenu |
createGenerateMenu(ContextMenu cm,
java.lang.String name,
GenerateController controller)
Creates a submenu for the given ContextMenu for all the registered generate options. |
protected abstract Namespace |
createNamespace(TransferDescriptor desc,
Context context)
|
protected SchemaObject[] |
doTransfer(TransferDescriptor td)
Performs the actual transfer of the given TransferDescriptor. |
protected Step |
getChooseOpStep()
|
protected abstract java.lang.Class<? extends oracle.ideimpl.db.transfer.ProviderTransferTarget> |
getDBTarget()
Gets the ProviderTransferTarget implementation class to use for any connection transfer target (i.e. |
protected abstract java.lang.String |
getDefaultConnection(Context context)
Returns the default connection (if there is one) to use for the given Context. |
static IdeAction |
getGenerateAction()
The Generate Action is the IdeAction that bring up the full Generate Wizard. |
protected abstract Step |
getManualReconcileStep()
|
protected abstract java.lang.Object |
getSourceIdentifier(Context context)
Gets the identifier for the source provider from the given context. |
protected abstract Step |
getSourceStep()
|
protected abstract Step |
getTargetStep()
|
protected java.lang.String |
getTitle(TransferDescriptor td)
|
protected abstract java.lang.Class<? extends TransferPolicy> |
getTransferPolicy(TransferDescriptor desc)
Gets the TransferPolicy to use for the given descriptor. |
boolean |
handleEvent(IdeAction action,
Context context)
This method is called when a user interaction with a View
triggers the execution of a command. |
protected void |
invokeWizard(TransferDescriptor td,
Context context)
Invokes the appropriate wizard for the given descriptor and context. |
protected boolean |
isGenerateEnabled(Context context)
Checks whether the generate action should be enabled because this controller can handle the event for the given context. |
void |
rollback(ApplyEvent event)
Called to have the listener rollback the commit. |
protected abstract void |
setDescriptorObjects(TransferDescriptor desc,
Context context)
Given the Context sets the objects to be generated on the TransferDescriptor. |
protected void |
setupDescriptor(TransferDescriptor desc,
Context context)
Sets up the TransferDescriptor ready for transfer. |
boolean |
update(IdeAction action,
Context context)
Enables the generate action ( getGenerateAction() ) if there is
a provider source available in the given Context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String GENERATE_CMD
public static final int GENERATE_CMD_ID
getGenerateAction()
Constructor Detail |
---|
protected GenerateController()
Method Detail |
---|
protected abstract Namespace createNamespace(TransferDescriptor desc, Context context) throws DBException
DBException
public boolean update(IdeAction action, Context context)
getGenerateAction()
) if there is
a provider source available in the given Context.
update
in interface Controller
action
- action whose command is to be executed.context
- the current context
protected boolean isGenerateEnabled(Context context)
protected boolean canGenerate(Context context)
isGenerateEnabled(oracle.ide.Context)
context
-
public boolean handleEvent(IdeAction action, Context context)
Controller
View
triggers the execution of a command.
handleEvent
in interface Controller
action
- action whose command is to be executed.
protected void invokeWizard(TransferDescriptor td, Context context)
invokeFullWizard(oracle.ide.db.transfer.TransferDescriptor, oracle.ide.Context)
GenerateTargetRegistry
- doTransfer(oracle.ide.db.transfer.TransferDescriptor)
invokeTargettedWizard(oracle.ide.db.transfer.TransferDescriptor, java.util.List, oracle.ide.Context)
td
- the TransferDescriptor for the transfercontext
- the current IDE Contextprotected SchemaObject[] doTransfer(TransferDescriptor td) throws TransferFailedException
TransferFailedException
protected abstract boolean areCompatible(DBObjectProvider source, DBObjectProvider target)
protected abstract Step getSourceStep()
protected abstract Step getTargetStep()
protected Step getChooseOpStep()
protected abstract Step getManualReconcileStep()
protected abstract java.lang.Object getSourceIdentifier(Context context)
protected abstract java.lang.Class<? extends oracle.ideimpl.db.transfer.ProviderTransferTarget> getDBTarget()
protected abstract java.lang.Class<? extends TransferPolicy> getTransferPolicy(TransferDescriptor desc)
protected TransferDescriptor createDescriptor(java.lang.String name, java.lang.Class<? extends TransferTarget> target, Context context)
name
- connection name (if no transfer target class)target
- transfer target to use in the descriptorcontext
- current context
setupDescriptor(oracle.ide.db.transfer.TransferDescriptor, oracle.ide.Context)
,
setDescriptorObjects(oracle.ide.db.transfer.TransferDescriptor, oracle.ide.Context)
protected void setupDescriptor(TransferDescriptor desc, Context context)
protected abstract void setDescriptorObjects(TransferDescriptor desc, Context context)
protected java.lang.String getTitle(TransferDescriptor td)
protected abstract java.lang.String getDefaultConnection(Context context)
public void commit(ApplyEvent event) throws TraversalException
CommitListener
commit
on any listeners, FSMWizard
will first
call checkCommit
on every listener.
If a listener wishes to abort the commit, a TraversalException
should be thrown. Aborting a commit will cause rollback
to be called on every listener, in reverse order, that already commited.
Note that rollback is not called on the listener that causes the commit
to be aborted.
commit
in interface CommitListener
event
- The ApplyEvent
that provides contextual
information about when the ApplyEvent
was fired.
TraversalException
- if the commit should be aborted.public void cancel(ApplyEvent event)
CommitListener
FSMWizard
. Listeners should revert to the
initial state.
cancel
in interface CommitListener
event
- The ApplyEvent
that provides contextual
information about when the ApplyEvent
was fired.public void checkCommit(ApplyEvent event) throws TraversalException
CommitListener
checkCommit
will be called on every registered listener
as the first stage of the commit. If any listener vetoes the commit
by throwing a TraversalException
, the commit will be immediately
aborted. checkCommit
will not be called on any other listeners,
and no further actions will be taken.
checkCommit
in interface CommitListener
event
- The ApplyEvent
that provides contextual
information about when the ApplyEvent
was fired.
TraversalException
- if the commit should be aborted.public void rollback(ApplyEvent event)
CommitListener
rollback
in interface CommitListener
event
- The ApplyEvent
that provides contextual
information about when the ApplyEvent
was fired.protected static IdeAction createGenerateAction(java.lang.String name, java.lang.Class<? extends TransferTarget> target, GenerateController controller)
name
- the name for the menu item (includes mneumonic)target
- the TransferTarget the item is for (can be null)controller
- the controller for the action.
public static javax.swing.JMenu createGenerateMenu(ContextMenu cm, java.lang.String name, GenerateController controller)
cm
- context menu to create the submenu for (cannot be null).name
- the name of the new submenu option, if null "Generate To" is
usedcontroller
- the controller to use for the menu items (cannot be
null).
public static final IdeAction getGenerateAction()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |