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

E13403-05

oracle.jdeveloper.uieditor
Class AbstractFactory

java.lang.Object
  extended by oracle.ide.view.ViewAdapter
      extended by oracle.jdeveloper.uieditor.AbstractFactory
All Implemented Interfaces:
java.util.EventListener, DynamicMenuListener, ViewListener, ModelFactory

public abstract class AbstractFactory
extends ViewAdapter
implements ModelFactory

AbstractFactory provides an implementation of ModelFactory. Integrators are encouraged to extend this class for any ModelFactory introduced.

See Also:
ModelFactory

Field Summary
protected  java.util.HashMap commands
          Hashmap of IdeAction keyed upon command IDs.
protected  java.util.HashMap views
          HashMap UIEditorCanvas keyed upon instances of UIEditor.
 
Fields inherited from interface oracle.jdeveloper.uieditor.ModelFactory
DEFAULT_SECTION, DEFAULT_WEIGHT, NO_PARENT
 
Constructor Summary
AbstractFactory()
          Constructor.
 
Method Summary
protected abstract  UIEditorCanvas createView()
          Create a custom instance of UIEditorCanvas specific to this factory.
 javax.swing.JComponent[] gatherDynamicActions(Context context)
          Get an array of objects to be hosted in the dynamic menu associated with the View of the given Context.
 IdeAction[] getActions()
          Get an array of all registered IdeActions for this ModelFactory.
protected abstract  java.lang.String getCategory()
          Get the accellerator category to use when constructing IdeAction instances from registerAction.
 XMLKeyStrokeContext getKeyStrokeContext()
          Get an XMLKeyStrokeContext for use with the UIEditorCanavs objects produced by this ModelFactory.
 UIEditorCanvas getView(UIEditor editor)
          Get a UIEditorCanvas instance associated with the given UIEditor.
 boolean isRegistered(IdeAction action)
          Determine whether the given IdeAction has been registered with this ModelFactory.
 IdeAction registerAction(int cmdID, java.lang.String name, java.lang.Integer mnemonic, ArrayResourceBundle bundle, int bundleKey, int parentID, float weight, float section)
          Generate an IdeAction for use when interacting with instances of the UIEditorCanvas produced by this factory.
 IdeAction registerAction(int cmdID, java.lang.String name, java.lang.Integer mnemonic, javax.swing.Icon icon, int parentID, float weight, float section)
          Generate an IdeAction for use when interacting with instances of the UIEditorCanvas produced by this factory.
 int registerSubMenu(int parentID, java.lang.String name, java.lang.Integer mnemonic, float weight, float section)
          Create a unique identifier for a given submenu name within a given submenu parent.
 void viewClosed(ViewEvent e)
          Respond to a UIEditor closing by sending a stateChanged message to the UIEditorCanvas that we have associated with that UIEditor and removing self as a ViewListener from the UIEditor.
 
Methods inherited from class oracle.ide.view.ViewAdapter
viewActivated, viewDeactivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jdeveloper.uieditor.ModelFactory
annotate, getModelClass
 

Field Detail

views

protected java.util.HashMap views
HashMap UIEditorCanvas keyed upon instances of UIEditor.


commands

protected java.util.HashMap commands
Hashmap of IdeAction keyed upon command IDs.

Constructor Detail

AbstractFactory

public AbstractFactory()
Constructor. Adds self as a DynamicMenuListener upon the Ide's MainWindow.

Method Detail

getView

public final UIEditorCanvas getView(UIEditor editor)
Get a UIEditorCanvas instance associated with the given UIEditor. Adds self as a ViewListener to the UIEditor and stores the association such that the same UIEditorCanvas will be returned for each request using the given UIEditor.

Specified by:
getView in interface ModelFactory
Parameters:
editor - the UIEditor for which a UIEditorCanvas is desired.
Returns:
a UIEditorCanvas dedicated to the given UIEditor.
See Also:
views

getKeyStrokeContext

public XMLKeyStrokeContext getKeyStrokeContext()
Description copied from interface: ModelFactory
Get an XMLKeyStrokeContext for use with the UIEditorCanavs objects produced by this ModelFactory.

Specified by:
getKeyStrokeContext in interface ModelFactory
Returns:
an XMLKeyStrokeContext
See Also:
XMLKeyStrokeContext

registerSubMenu

public int registerSubMenu(int parentID,
                           java.lang.String name,
                           java.lang.Integer mnemonic,
                           float weight,
                           float section)
Description copied from interface: ModelFactory
Create a unique identifier for a given submenu name within a given submenu parent. The resulting identifier may be used as the parentID argument when registering additional submenus or registering actions via registerAction. If a submenu of the same name within the same parent has already been registered, the identifier for the existing menu will be returned and its mnemonic and weight will be left unchanged.

Specified by:
registerSubMenu in interface ModelFactory
Parameters:
parentID - the identifier for the parent submenu, else NO_PARENT.
name - the caption appearing on the menu.
mnemonic - the mnemonic appearing on the menu.
weight - the weight for positioning the menu relative to its siblings within the same section as used by oracle.ide.MenuManager.
section - the section in which to group the menu.
Returns:
a unique menu identifier.
See Also:
oracle.ide.MenuManager

registerAction

public IdeAction registerAction(int cmdID,
                                java.lang.String name,
                                java.lang.Integer mnemonic,
                                javax.swing.Icon icon,
                                int parentID,
                                float weight,
                                float section)
Description copied from interface: ModelFactory
Generate an IdeAction for use when interacting with instances of the UIEditorCanvas produced by this factory. The generated action is stored internally for later retrieval. All registered IdeAction will be displayed on the dynamic menu associated with the UIEditor unless that action has a Boolean.TRUE value set for its IdeAction.HIDDEN key.

Specified by:
registerAction in interface ModelFactory
Parameters:
cmdID - the Command ID for which an IdeAction is desired
name - the name for the resulting IdeAction
mnemonic - the mnemonic for the resulting IdeAction
icon - the Icon for the resulting IdeAction
parentID - the submenu ID onto which to add the IdeAction, else NO_PARENT
weight - the weight of the associated menu item.
section - the section of the associated menu item.
Returns:
an IdeAction for the given Command ID
See Also:
oracle.ide.addin.Command, oracle.ide.IdeAction, oracle.ide.MenuManager

registerAction

public IdeAction registerAction(int cmdID,
                                java.lang.String name,
                                java.lang.Integer mnemonic,
                                ArrayResourceBundle bundle,
                                int bundleKey,
                                int parentID,
                                float weight,
                                float section)
Description copied from interface: ModelFactory
Generate an IdeAction for use when interacting with instances of the UIEditorCanvas produced by this factory. The generated action is stored internally for later retrieval. All registered IdeAction will be displayed on the dynamic menu associated with the UIEditor unless that action has a Boolean.TRUE value set for its IdeAction.HIDDEN key.

Specified by:
registerAction in interface ModelFactory
Parameters:
cmdID - the Command ID for which an IdeAction is desired
name - the name for the resulting IdeAction
mnemonic - the mnemonic for the resulting IdeAction
bundle - the ArrayResourceBundle from which to fetch the Icon
bundleKey - the resource key to use when fetching an Icon for the resulting IdeAction
parentID - the submenu ID onto which to add the IdeAction, else NO_PARENT
weight - the weight of the associated menu item.
section - the section of the associated menu item.
Returns:
an IdeAction for the given Command ID
See Also:
oracle.ide.addin.Command, oracle.ide.IdeAction

getActions

public IdeAction[] getActions()
Description copied from interface: ModelFactory
Get an array of all registered IdeActions for this ModelFactory.

Specified by:
getActions in interface ModelFactory
Returns:
an array of IdeAction.
See Also:
ModelFactory.registerAction(int, java.lang.String, java.lang.Integer, javax.swing.Icon, int, float, float)

isRegistered

public boolean isRegistered(IdeAction action)
Description copied from interface: ModelFactory
Determine whether the given IdeAction has been registered with this ModelFactory.

Specified by:
isRegistered in interface ModelFactory
Parameters:
action - the IdeAction to check.
Returns:
true if the IdeAction has been registered with this ModelFactory.

viewClosed

public final void viewClosed(ViewEvent e)
Respond to a UIEditor closing by sending a stateChanged message to the UIEditorCanvas that we have associated with that UIEditor and removing self as a ViewListener from the UIEditor.

Specified by:
viewClosed in interface ViewListener
Overrides:
viewClosed in class ViewAdapter
Parameters:
e - the close event of a UIEditor.

createView

protected abstract UIEditorCanvas createView()
Create a custom instance of UIEditorCanvas specific to this factory. This is used by getView.

Returns:
a UIEditorCanvas.
See Also:
getView(oracle.jdeveloper.uieditor.UIEditor)

getCategory

protected abstract java.lang.String getCategory()
Get the accellerator category to use when constructing IdeAction instances from registerAction.

Returns:
the category name to use when constructing IdeAction.
See Also:
registerAction(int, String, Integer, Icon), registerAction(int, String, Integer, ArrayResourceBundle, int), oracle.ide.IdeAction

gatherDynamicActions

public javax.swing.JComponent[] gatherDynamicActions(Context context)
Get an array of objects to be hosted in the dynamic menu associated with the View of the given Context. Subclasses should first verify that the View of the Context is of the correct UIEditorCanvas type before deferring to this implementation.

Specified by:
gatherDynamicActions in interface DynamicMenuListener
Parameters:
context - the Context for which dynamic menu items are requested.
Returns:
an array of menu items relevant to the View of the Context.

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

E13403-05

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