|
Oculus Layout System API Documentation November 25, 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oculustech.layout.SelectionActions
Provides system for over-ridable actions, to be used, for instance to determine the actions to use for particular menu items based on the view, selection, etc. Can dynamically inherit said actions from another instance of SelectionActions, in case actions set is only partially overridden (i.e., text selected in a text widget doesn't change the fact that a certain module is being viewed).
This class works best when used in conjunction with the DynamicallyPropertiedComponent system's accumulated properties. In this case, instances of this class will be dynamically accumulated up the swing component tree. Accumulation consists of setting superActions on a child's SelectionAction's to its parent's actions, if applicable. Behavior between competing siblings over SelectionActions is undefined; since there is only one selection for any given level of specificity, there should be no instances in which two sibling components compete over SelectionActions. This enables any component in the component tree to override an action being referred to by the top-level Frame, which presumably controls menus, toolbars, etc.
Note that when used as a dynamically accumulated property, the result of getDynamicallyAccumulatedProperty will be the root of the SelectionActions hierarchy, whereas you want to call getAction() on the most-derived child of the hierarchy. You therefore should call getMostDerivedActions() on the return value of getDynamicallyAccumulatedProperty and use the result to get your actions.
The SelectionActions accumulated property should be set to null when a component has no selection (or corresponding actions).
Field Summary | |
protected java.util.HashMap |
actions
|
protected SelectionActions |
childActions
|
protected java.lang.String |
debugName
|
protected static java.io.PrintStream |
debugOut
|
protected SelectionActions |
superActions
|
Constructor Summary | |
SelectionActions(java.lang.String debugName,
javax.swing.Action[] actionsList)
Construct a new SelectionActions instance with the given debugging name, and the given actionsMap. |
|
SelectionActions(java.lang.String debugName,
java.util.Map actionsMap)
Construct a new SelectionActions instance with the given debugging name, and the given actionsMap. |
|
SelectionActions(java.lang.String debugName,
java.lang.Object[] actionsList)
Construct a new SelectionActions instance with the given debugging name, and the given actionsList. |
Method Summary | |
void |
addAction(javax.swing.Action action)
Add given action to SelectionActions instance. |
void |
addAction(ActionIdentifier actionId,
javax.swing.Action action)
Add given action to SelectionActions instance. |
void |
addActions(javax.swing.Action[] actionsList)
Adds given actions to SelectionActions instance. |
void |
addActions(java.lang.Object[] actionsList)
Adds given actions to SelectionActions instance. |
void |
clearLinkages()
Clears this.childActions and this.superActions |
javax.swing.Action |
getAction(ActionIdentifier actionId)
Gets action for given identifier. |
java.util.Map |
getActions()
returns a Map mapping ActionIdentifier->Action representing all the actions in this SelectionActions instance. |
SelectionActions |
getChildActions()
Returns the child-SelectionActions of this object. |
SelectionActions |
getMostDerivedActions()
Returns the most-derived successor (child) SelectionActions of this object. |
java.lang.String |
getSelectionActionsHierarchy()
Returns a string describing the dynamic ancestory and descendency of the SelectionActions hierarchy of which this instance is a part. |
SelectionActions |
getSuperActions()
Returns super-SelectionActions of this object. |
void |
removeAction(ActionIdentifier actionId)
Removes given action from this SelectionActions instance, if present. |
void |
setChildActions(SelectionActions actions)
Sets child-SelectionActions of this object, and changes super-SelectionActions of given actions object correspondingly. |
void |
setDebugName(java.lang.String debugName)
Sets the debugging name of this instance. |
static void |
setDebugOutStream(java.io.PrintStream ps)
Sets the PrintStream to which debugging information regarding SelectionActions may be printed. |
void |
setSuperActions(SelectionActions actions)
Sets super-SelectionActions of this object, and changes child-SelectionActions of given actions object correspondingly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.io.PrintStream debugOut
protected java.lang.String debugName
protected java.util.HashMap actions
protected SelectionActions superActions
protected SelectionActions childActions
Constructor Detail |
public SelectionActions(java.lang.String debugName, java.lang.Object[] actionsList)
public SelectionActions(java.lang.String debugName, java.util.Map actionsMap)
public SelectionActions(java.lang.String debugName, javax.swing.Action[] actionsList)
Method Detail |
public void addActions(java.lang.Object[] actionsList)
public void addActions(javax.swing.Action[] actionsList)
public void addAction(javax.swing.Action action)
public void addAction(ActionIdentifier actionId, javax.swing.Action action)
public void removeAction(ActionIdentifier actionId)
public void setDebugName(java.lang.String debugName)
public static void setDebugOutStream(java.io.PrintStream ps)
public java.util.Map getActions()
public void setSuperActions(SelectionActions actions)
public void setChildActions(SelectionActions actions)
public void clearLinkages()
public SelectionActions getChildActions()
public SelectionActions getMostDerivedActions()
public SelectionActions getSuperActions()
public java.lang.String getSelectionActionsHierarchy()
public javax.swing.Action getAction(ActionIdentifier actionId)
|
Oculus Layout System API Documentation November 25, 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |