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

E13403-04

oracle.ide.db.transfer.generate
Class GenerateController

java.lang.Object
  extended by oracle.ide.db.transfer.generate.GenerateController
All Implemented Interfaces:
Controller

public abstract class GenerateController
extends java.lang.Object
implements Controller

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)
           
protected  boolean canGenerate(Context context)
          Called just before generation to give subclasses an opportunity to bail out.
 void checkCommit(ApplyEvent event)
           
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)
           
 SystemObject[] 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)
           
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

GENERATE_CMD

protected static final java.lang.String GENERATE_CMD
See Also:
Constant Field Values

GENERATE_CMD_ID

public static final int GENERATE_CMD_ID
Command ID for the generate action.

See Also:
getGenerateAction()
Constructor Detail

GenerateController

protected GenerateController()
Method Detail

createNamespace

protected abstract Namespace createNamespace(TransferDescriptor desc,
                                             Context context)
                                      throws DBException
Throws:
DBException

update

public boolean update(IdeAction action,
                      Context context)
Enables the generate action ( getGenerateAction() ) if there is a provider source available in the given Context.

Specified by:
update in interface Controller
Parameters:
action - action whose command is to be executed.
context - the current context
Returns:
true if the controller handles the specified command.

isGenerateEnabled

protected boolean isGenerateEnabled(Context context)
Checks whether the generate action should be enabled because this controller can handle the event for the given context. Called by update.


canGenerate

protected boolean canGenerate(Context context)
Called just before generation to give subclasses an opportunity to bail out. By default this simply calls isGenerateEnabled(oracle.ide.Context)

Parameters:
context -
Returns:
false if generation should not proceed

handleEvent

public boolean handleEvent(IdeAction action,
                           Context context)
Description copied from interface: Controller
This method is called when a user interaction with a View triggers the execution of a command.

Specified by:
handleEvent in interface Controller
Parameters:
action - action whose command is to be executed.
Returns:
true if the controller handles the specified command.

invokeWizard

protected void invokeWizard(TransferDescriptor td,
                            Context context)
Invokes the appropriate wizard for the given descriptor and context. The descriptor is inspected and the following courses followed:

Parameters:
td - the TransferDescriptor for the transfer
context - the current IDE Context

doTransfer

public SystemObject[] doTransfer(TransferDescriptor td)
                          throws TransferFailedException
Performs the actual transfer of the given TransferDescriptor. Default implementation uses a TransferProgressBar.

Throws:
TransferFailedException

areCompatible

protected abstract boolean areCompatible(DBObjectProvider source,
                                         DBObjectProvider target)

getSourceStep

protected abstract Step getSourceStep()

getTargetStep

protected abstract Step getTargetStep()

getChooseOpStep

protected Step getChooseOpStep()

getManualReconcileStep

protected abstract Step getManualReconcileStep()

getSourceIdentifier

protected abstract java.lang.Object getSourceIdentifier(Context context)
Gets the identifier for the source provider from the given context. If this returns null generate is not available.


getDBTarget

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. all the databases in the database list).


getTransferPolicy

protected abstract java.lang.Class<? extends TransferPolicy> getTransferPolicy(TransferDescriptor desc)
Gets the TransferPolicy to use for the given descriptor.


createDescriptor

protected TransferDescriptor createDescriptor(java.lang.String name,
                                              java.lang.Class<? extends TransferTarget> target,
                                              Context context)
Creates a new TransferDescriptor. The name is a connection name and is only used if the target class is null.

Parameters:
name - connection name (if no transfer target class)
target - transfer target to use in the descriptor
context - current context
Returns:
a new TransferDescriptor
See Also:
setupDescriptor(oracle.ide.db.transfer.TransferDescriptor, oracle.ide.Context), setDescriptorObjects(oracle.ide.db.transfer.TransferDescriptor, oracle.ide.Context)

setupDescriptor

protected void setupDescriptor(TransferDescriptor desc,
                               Context context)
Sets up the TransferDescriptor ready for transfer. This sets any necessary information on the descriptor for the transfer process.


setDescriptorObjects

protected abstract void setDescriptorObjects(TransferDescriptor desc,
                                             Context context)
Given the Context sets the objects to be generated on the TransferDescriptor.


getTitle

protected java.lang.String getTitle(TransferDescriptor td)

getDefaultConnection

protected abstract java.lang.String getDefaultConnection(Context context)
Returns the default connection (if there is one) to use for the given Context. A default connection will appear in the top of the list of connections in its own section if returned.


cancel

public void cancel(ApplyEvent event)

checkCommit

public void checkCommit(ApplyEvent event)
                 throws TraversalException
Throws:
TraversalException

rollback

public void rollback(ApplyEvent event)

createGenerateAction

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. The transfer target can be null which signifies a database target where the name is the database.

Parameters:
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.
Returns:
a new IdeAction for the menu item.

createGenerateMenu

public 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. The submenu is not added to the ContextMenu so that the caller can add it where they wish.

Parameters:
cm - context menu to create the submenu for (cannot be null).
name - the name of the new submenu option, if null "Generate To" is used
controller - the controller to use for the menu items (cannot be null).
Returns:
a submenu that can be added to the ContextMenu

getGenerateAction

public static final IdeAction getGenerateAction()
The Generate Action is the IdeAction that bring up the full Generate Wizard.

Returns:
the IdeAction for generating objects.

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

E13403-04

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