|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.uif.application.ActionReader
public final class ActionReader
Sets Action properties from values that are specified in a ResourceMap. Looks up the action's name, icon, short and long descriptions, mnemonic, and mnemonic index. Values may be specialized for different platforms using a platform suffix. Currently only the .mac suffix for Mac OS X is supported.
Find below the resource key suffixes used to read values
Suffix | Value | Type | Default |
.label | name | mandatory | none |
.accelerator | accelerator key | optional | none |
.tooltip | short description | optional | name |
.helptext | long description | optional | short description |
.icon | small icon | optional | null |
.largeIcon | large icon | optional | null |
The action name may contain the mnemonic marker character & to indicate the mnemonic and mnemonic index. The & character itself can be described by a double ampersand, &&. Find below an example of properties used to describe three actions:
print.label=&Print print.icon=images/print.gif openPrintDialog.label=&Print? openPrintDialog.icon=images/print.gif openPrintDialog.tooltip=Open print dialog openHelpContents.label=&Contents openHelpContents.label.mac=JDiskReport Help openHelpContents.icon=images/help.gif openHelpContents.tooltip=Show Help Contents openHelpContents.helptext=Opens the help viewer and shows the help contents.
This class is used by the Actions class to initialize Actions that are looked up from methods annotated with the Action annotation. The icon lookup and conversion from icon paths to icons is done by a ResourceMap.
Action
,
Action
,
Actions
,
ResourceMap
Method Summary | |
---|---|
static boolean |
getPlatformResourcesEnabled()
|
static void |
readAndPutValues(Action action,
ResourceMap map,
String prefix)
Reads action properties for prefix in map
and sets the associated values in the given action . |
static void |
setPlatformResourcesEnabled(boolean b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean getPlatformResourcesEnabled()
public static void setPlatformResourcesEnabled(boolean b)
public static void readAndPutValues(Action action, ResourceMap map, String prefix)
prefix
in map
and sets the associated values in the given action
.
action
- the Action to be initializedmap
- the ResourceMap used to resolve texts and pathsprefix
- the prefix used for the resource map lookup
MissingResourceException
- if the action name and the action icon
are missing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |