|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.fopps.ui.actions.ActionHandler
ActionHandler is the mediator between data model and UI actions. All views shold register themselves to an instance of action handler. Each action knows its handler, so that they can react properly on selections.
The ActionHandler knows also the data container and the application instance to realize actions that affects all data or even the whole application.
| Nested Class Summary | |
class |
ActionHandler.DummyApplication
'Null' application |
| Field Summary | |
static java.lang.Class[] |
ACTIONS
|
| Constructor Summary | |
ActionHandler(ActionHandler pOldHandler)
Copy constructor for ActionHandler. |
|
ActionHandler(ProjectContainer pContainer,
Application pApp)
Constructor for ActionHandler. |
|
| Method Summary | |
boolean |
allowMultipleSelection()
Returns true if view allows multiple selection. |
boolean |
canZoom()
Returns true if view can be zoomed |
void |
clearSelection()
Clear selection and refresh all actions |
void |
exportActions()
For validation purpose only (makes nothing until fopps.debug is set) |
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus. |
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus. |
BaseAction |
getActionByName(java.lang.String pName)
Returns the action with the given name or null, if action not exist |
java.util.Collection |
getActionNames()
Returns a list containing all action names |
java.util.List |
getActions()
Returns a list containing all actions. |
java.util.List |
getActionsForGroup(java.lang.String pGroupName)
Returns all actions for a given group. |
java.util.Map |
getAllGroups()
Returns the map with all groups and their actions |
Application |
getApp()
Returns the app. |
javax.swing.AbstractButton |
getComponentForAction(java.lang.String pName)
Returns the corresponding component for an action. |
ProjectContainer |
getContainer()
Returns the container. |
java.util.Set |
getGroupNames()
Return the set with all group names |
javax.swing.JMenuItem |
getMenuComponentForAction(java.lang.String pName)
Returns the corresponding menu component for an action. |
java.util.List |
getPossibleActionsForSelection()
Returns a list with all actions which accepts the current selection |
ViewActionReceiver |
getViewActionReceiver()
Returns the view which will receive the view actions |
void |
invertSelection()
Inverts current selection |
void |
itemStateChanged(java.awt.event.ItemEvent e)
|
void |
narrow()
Narrows current view, if applicable |
void |
register(java.lang.Object pComponent)
Registers a component. |
void |
registerAction(BaseAction pAction)
Registers an action. |
void |
registerContainerComponent(ContainerSelectable pItem)
|
protected void |
registerController(Controller pItem)
|
void |
selectAll()
Selects all items in a view |
void |
selectItem(java.lang.Object pObject)
Select an object in the view |
void |
setContainer(ProjectContainer container)
Sets the container and passes the new container to all registered components |
void |
setViewActionReceiver(ViewActionReceiver pReceiver)
Sets the view which will receive all following view actions. |
void |
unselectAll()
Unselects all items in a view |
void |
widen()
Widens current view, if applicable |
void |
zoomIn()
Zooms current view, if applicable |
void |
zoomOut()
Unzooms current view, if applicable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.Class[] ACTIONS
| Constructor Detail |
public ActionHandler(ProjectContainer pContainer,
Application pApp)
public ActionHandler(ActionHandler pOldHandler)
| Method Detail |
public java.util.List getActionsForGroup(java.lang.String pGroupName)
pGroupName - Name of group
public java.util.Map getAllGroups()
public java.util.Set getGroupNames()
public BaseAction getActionByName(java.lang.String pName)
public java.util.Collection getActionNames()
public void registerAction(BaseAction pAction)
pAction - Action to registerpublic void clearSelection()
public void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListenerpublic void register(java.lang.Object pComponent)
ViewActionReceiver,
ContainerSelectable,
ItemSelectablepublic void registerContainerComponent(ContainerSelectable pItem)
protected void registerController(Controller pItem)
public void setViewActionReceiver(ViewActionReceiver pReceiver)
If the view instance changes, the existing selection will be dropped
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerItemListener.itemStateChanged(ItemEvent)public ViewActionReceiver getViewActionReceiver()
public java.util.List getActions()
public Application getApp()
public ProjectContainer getContainer()
public void setContainer(ProjectContainer container)
container - The container to setpublic void selectAll()
selectAll in interface ViewActionReceiverpublic void unselectAll()
unselectAll in interface ViewActionReceiverpublic void invertSelection()
invertSelection in interface ViewActionReceiverpublic void selectItem(java.lang.Object pObject)
selectItem in interface ViewActionReceiverpObject - Object to select in viewpublic void zoomIn()
zoomIn in interface ViewActionReceiverpublic void zoomOut()
zoomOut in interface ViewActionReceiverpublic void narrow()
narrow in interface ViewActionReceiverpublic void widen()
widen in interface ViewActionReceiverpublic boolean canZoom()
canZoom in interface ViewActionReceiverpublic boolean allowMultipleSelection()
allowMultipleSelection in interface ViewActionReceiverpublic javax.swing.AbstractButton getComponentForAction(java.lang.String pName)
pName - name of the actionpublic javax.swing.JMenuItem getMenuComponentForAction(java.lang.String pName)
pName - name of the actionpublic void exportActions()
public java.util.List getPossibleActionsForSelection()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||