public abstract class AbstractFactory extends ViewAdapter implements ModelFactory
ModelFactory| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap |
commands
Hashmap of IdeAction keyed upon command IDs.
|
protected java.util.HashMap |
views
HashMap UIEditorCanvas keyed upon instances of UIEditor.
|
DEFAULT_SECTION, DEFAULT_WEIGHT, NO_PARENT| Constructor and Description |
|---|
AbstractFactory()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
viewActivated, viewDeactivatedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitannotate, getModelClassprotected java.util.HashMap views
protected java.util.HashMap commands
public AbstractFactory()
public final UIEditorCanvas getView(UIEditor editor)
getView in interface ModelFactoryeditor - the UIEditor for which a UIEditorCanvas is desired.viewspublic XMLKeyStrokeContext getKeyStrokeContext()
ModelFactorygetKeyStrokeContext in interface ModelFactoryXMLKeyStrokeContextpublic int registerSubMenu(int parentID,
java.lang.String name,
java.lang.Integer mnemonic,
float weight,
float section)
ModelFactoryregisterSubMenu in interface ModelFactoryparentID - 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.oracle.ide.MenuManagerpublic IdeAction registerAction(int cmdID, java.lang.String name, java.lang.Integer mnemonic, javax.swing.Icon icon, int parentID, float weight, float section)
ModelFactoryregisterAction in interface ModelFactorycmdID - the Command ID for which an IdeAction is desiredname - the name for the resulting IdeActionmnemonic - the mnemonic for the resulting IdeActionicon - the Icon for the resulting IdeActionparentID - the submenu ID onto which to add the IdeAction,
else NO_PARENTweight - the weight of the associated menu item.section - the section of the associated menu item.oracle.ide.addin.Command,
oracle.ide.IdeAction,
oracle.ide.MenuManagerpublic IdeAction registerAction(int cmdID, java.lang.String name, java.lang.Integer mnemonic, ArrayResourceBundle bundle, int bundleKey, int parentID, float weight, float section)
ModelFactoryregisterAction in interface ModelFactorycmdID - the Command ID for which an IdeAction is desiredname - the name for the resulting IdeActionmnemonic - the mnemonic for the resulting IdeActionbundle - the ArrayResourceBundle from which to fetch the IconbundleKey - the resource key to use when fetching an Icon for the
resulting IdeActionparentID - the submenu ID onto which to add the IdeAction,
else NO_PARENTweight - the weight of the associated menu item.section - the section of the associated menu item.oracle.ide.addin.Command,
oracle.ide.IdeActionpublic IdeAction[] getActions()
ModelFactorygetActions in interface ModelFactoryModelFactory.registerAction(int, java.lang.String, java.lang.Integer, javax.swing.Icon, int, float, float)public boolean isRegistered(IdeAction action)
ModelFactoryisRegistered in interface ModelFactoryaction - the IdeAction to check.public final void viewClosed(ViewEvent e)
viewClosed in interface ViewListenerviewClosed in class ViewAdaptere - the close event of a UIEditor.protected abstract UIEditorCanvas createView()
getView(oracle.jdeveloper.uieditor.UIEditor)protected abstract java.lang.String getCategory()
registerAction(int, String, Integer, Icon),
registerAction(int, String, Integer, ArrayResourceBundle, int),
oracle.ide.IdeActionpublic javax.swing.JComponent[] gatherDynamicActions(Context context)
gatherDynamicActions in interface DynamicMenuListenercontext - the Context for which dynamic menu items are requested.