Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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
static java.lang.String GENERATE_CMD
          Command string for Generate.
static int GENERATE_CMD_ID
          Deprecated. use GENERATE_CMD instead
 
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 qname, java.lang.Class<? extends TransferTarget> target, Context context)
          Creates a new TransferDescriptor.
protected  IdeAction createGenerateAction(java.lang.String connName, java.lang.String qualifiedName)
           
protected  IdeAction createGenerateAction(oracle.ideimpl.db.transfer.extension.TransferHook.TransferTargetInfo info)
           
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  int getCommandId()
          Gets the id for the command this Controller is controlling.
protected  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  java.lang.Object getSourceIdentifier(Context context)
          Gets the identifier for the source provider from the given context.
protected abstract  Step getSourceStep()
           
protected  java.lang.String getSourceType(Context context)
          Gets the type of the source provider from the given context.
static Step getSQLScriptStep()
           
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

public static final java.lang.String GENERATE_CMD
Command string for Generate.

See Also:
getGenerateAction(), Constant Field Values

GENERATE_CMD_ID

@Deprecated
public static final int GENERATE_CMD_ID
Deprecated. use GENERATE_CMD instead
See Also:
Constant Field Values
Constructor Detail

GenerateController

protected GenerateController()
Method Detail

createNamespace

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

getCommandId

protected int getCommandId()
Gets the id for the command this Controller is controlling. By default this is the id for the "Generate..." command.

Returns:

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()

getSourceType

protected java.lang.String getSourceType(Context context)
Gets the type of the source provider from the given context. If this returns null generate is not available.


getSourceIdentifier

protected 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 final 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 qname,
                                              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:
qname - qualified 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 IdeAction createGenerateAction(java.lang.String connName,
                                         java.lang.String qualifiedName)

createGenerateAction

protected IdeAction createGenerateAction(oracle.ideimpl.db.transfer.extension.TransferHook.TransferTargetInfo info)

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.

getSQLScriptStep

public static Step getSQLScriptStep()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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