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

E13403-04

oracle.jdeveloper.uieditor
Interface ModelFactory

All Superinterfaces:
DynamicMenuListener, java.util.EventListener
All Known Implementing Classes:
AbstractFactory

public interface ModelFactory
extends DynamicMenuListener

ModelFactory describes the API by which an integrator may extend the UIEditor to provide custom design surfaces, known as UIEditorCanvas, which may be used by the user to manipulate an associated custom CmtModel implementation.

For example; a ModelFactory implementation might be provided to produce instances of 'UICanvas' which in turn manipulates instances of its custom model 'UIModel'. Additionally, a ModelFactory implementation might be provided to produce instaces of a 'MenuCanvas' which in turn manipulates instances of its custom model 'MenuModel'.

Implementations of this interface are expected to be singletons. A ModelFactory is expected upon a call to annotate to generate relevant custom CmtModel instances which are then to be held by the target CmtComponentSource. Likewise, a ModelFactory instance is expected to keep track of an associated UIEditorCanvas on a UIEdiotr by UIEditor basis.

See Also:
UIEditorCanvas, CmtComponentSource

Field Summary
static float DEFAULT_SECTION
          Default section for use when registering submenus, actions
static float DEFAULT_WEIGHT
          Default weight for use when registering submenus, actions
static int NO_PARENT
          Identifier meaning no parent for use when registering submenus, actions
 
Method Summary
 void annotate(CmtComponentSource source, CmtComponents mgr)
          Called by the UIManager to parse the CmtComponentSource to produce any applicable CmtModel instances.
 IdeAction[] getActions()
          Get an array of all registered IdeActions for this ModelFactory.
 XMLKeyStrokeContext getKeyStrokeContext()
          Get an XMLKeyStrokeContext for use with the UIEditorCanavs objects produced by this ModelFactory.
 java.lang.Class getModelClass()
          Get the class of CmtModel produced by this ModelFactory.
 UIEditorCanvas getView(UIEditor editor)
          Find or create, for the given UIEditor, a UIEditorCanvas which is capable of manipulating instance of the CmtModel class produced by this ModelFactory.
 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 key, 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.
 
Methods inherited from interface oracle.ide.controller.DynamicMenuListener
gatherDynamicActions
 

Field Detail

NO_PARENT

static final int NO_PARENT
Identifier meaning no parent for use when registering submenus, actions

See Also:
Constant Field Values

DEFAULT_WEIGHT

static final float DEFAULT_WEIGHT
Default weight for use when registering submenus, actions

See Also:
Constant Field Values

DEFAULT_SECTION

static final float DEFAULT_SECTION
Default section for use when registering submenus, actions

See Also:
Constant Field Values
Method Detail

annotate

void annotate(CmtComponentSource source,
              CmtComponents mgr)
Called by the UIManager to parse the CmtComponentSource to produce any applicable CmtModel instances. Any CmtModel instances produced are expected to be added to the CmtComponentSource provided for subsequent use by Cmt clients.

Parameters:
source - the CmtComponentSource to be parsed
mgr - the CmtComponents instance that produced the source
See Also:
CmtComponentSource, UIManager

getView

UIEditorCanvas getView(UIEditor editor)
Find or create, for the given UIEditor, a UIEditorCanvas which is capable of manipulating instance of the CmtModel class produced by this ModelFactory.

Parameters:
editor - the UIEditor for which a UIEditorCanvas is desired
Returns:
an associated UIEditorCanvas
See Also:
UIEditor, UIEditorCanavs, getModelClass()

getModelClass

java.lang.Class getModelClass()
Get the class of CmtModel produced by this ModelFactory.

Returns:
a CmtModel implementation class
See Also:
CmtModel

getKeyStrokeContext

XMLKeyStrokeContext getKeyStrokeContext()
Get an XMLKeyStrokeContext for use with the UIEditorCanavs objects produced by this ModelFactory.

Returns:
an XMLKeyStrokeContext
See Also:
XMLKeyStrokeContext

registerSubMenu

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. 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.

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

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. 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.

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

IdeAction registerAction(int cmdID,
                         java.lang.String name,
                         java.lang.Integer mnemonic,
                         ArrayResourceBundle bundle,
                         int key,
                         int parentID,
                         float weight,
                         float section)
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.

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
key - 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

IdeAction[] getActions()
Get an array of all registered IdeActions for this ModelFactory.

Returns:
an array of IdeAction.
See Also:
registerAction(int, java.lang.String, java.lang.Integer, javax.swing.Icon, int, float, float)

isRegistered

boolean isRegistered(IdeAction action)
Determine whether the given IdeAction has been registered with this ModelFactory.

Parameters:
action - the IdeAction to check.
Returns:
true if the IdeAction has been registered with this ModelFactory.

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.