Package com.tagtraum.core.app
Class ActionLocation
- java.lang.Object
-
- com.tagtraum.core.app.ActionLocation
-
- Direct Known Subclasses:
AbsoluteActionLocation
,RelativeActionLocation
public abstract class ActionLocation extends Object
Specifies where in the UI an action should be installed.- Author:
- Hendrik Schreiber
- See Also:
ApplicationAction.getActionLocations()
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
insertMenuItemSeparatorAfterAction
protected boolean
insertMenuItemSeparatorBeforeAction
-
Constructor Summary
Constructors Modifier Constructor Description ActionLocation(UIRegion uiRegion)
protected
ActionLocation(String uiRegionPath)
Path segments have to consist of properties.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract int
getInsertIndex(Container container)
String
getUIRegionPath()
boolean
install(Object root, ApplicationAction action)
Installs the given action in pathgetUIRegionPath()
of the given object.String
toString()
-
-
-
Constructor Detail
-
ActionLocation
public ActionLocation(UIRegion uiRegion)
-
ActionLocation
protected ActionLocation(String uiRegionPath)
Path segments have to consist of properties. Indexed properties can be selected using thispropertyName:arrayIndex
notation. The path uses '.' as delimiter.Example:
mainWindow.JMenuBar.components:2
denotes the third (index is zero-based) menu in MainWindow's menubar, assuming a method getMainWindow() exists in the object used as root (e.g. com.tagtraum.beatunes.BeaTunes).- Parameters:
uiRegionPath
- path- See Also:
install(Object, ApplicationAction)
,UIRegion
-
-
Method Detail
-
getInsertIndex
protected abstract int getInsertIndex(Container container)
-
getUIRegionPath
public String getUIRegionPath()
-
install
public boolean install(Object root, ApplicationAction action)
Installs the given action in pathgetUIRegionPath()
of the given object. Success depends mostly on an accurate path, which is followed using reflection.- Parameters:
root
- main objectaction
- the action to install- Returns:
- true if the installation succeeded, false if not
-
-