|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractAction | +--com.borland.primetime.actions.UpdateAction
A UpdateAction functions as a regular Swing Action object - it stores the shortText, longText, icon, and enabled state for a single action. The primary difference is that an UpdateAction implements the UpdateableAction interface which also enables updating of an Action's state before the item is displayed in UI.
Subclasses of UpdateAction can optionally override the public method:
public void update(Object source)
to initialize the
UpdateAction object immediately before it is represented as UI somewhere in
the environment.
Several convenience methods surface the common properties of the Action object, like name, shortText, longText, and mnemonic.
Action
, Serialized FormField Summary | |
static java.lang.String |
ACCELERATOR
The storage attribute key for the ACCELERATOR (KeyStroke) property. |
static UpdateAction[] |
EMPTY_ARRAY
Used as a quick return for an empty array of UpdateAction objects. |
static java.lang.String |
HELP_TOPIC
The storage attribute key for the HELP_TOPIC (HelpTopic) property. |
static java.lang.String |
LARGE_ICON
The storage attribute key for the LARGE_ICON (Icon) property. |
static java.lang.String |
MNEMONIC
The storage attribute key for the MNEMONIC (Character) property. |
Fields inherited from class javax.swing.AbstractAction |
changeSupport,
enabled |
Fields inherited from interface javax.swing.Action |
DEFAULT,
LONG_DESCRIPTION,
NAME,
SHORT_DESCRIPTION,
SMALL_ICON |
Constructor Summary | |
UpdateAction()
Constructs an UpdateAction will all default properties. |
|
UpdateAction(java.lang.String shortText)
Constructs an UpdateAction will the specified short text. |
|
UpdateAction(java.lang.String shortText,
char mnemonic)
Constructs an UpdateAction will the specified short text and mnemonic. |
|
UpdateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText)
Constructs an UpdateAction will the specified short text, mnemonic, and long text. |
|
UpdateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon)
Constructs an UpdateAction will the specified short text, mnemonic, long text, and small icon. |
|
UpdateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon,
javax.swing.Icon largeIcon)
Constructs an UpdateAction will the specified short text, mnemonic, long text, small icon, and large icon. |
Method Summary | |
com.borland.primetime.help.HelpTopic |
getHelpTopic()
Returns the helpTopic property setting. |
javax.swing.Icon |
getLargeIcon()
Returns the largeIcon property setting. |
java.lang.String |
getLongText()
Returns the longText property setting. |
char |
getMnemonic()
Returns the mnemonic property setting. |
java.lang.String |
getShortText()
Returns the shortText property setting. |
javax.swing.Icon |
getSmallIcon()
Returns the smallIcon property setting. |
void |
setHelpTopic(com.borland.primetime.help.HelpTopic helpTopic)
Sets the helpTopic property. |
void |
setLargeIcon(javax.swing.Icon largeIcon)
Sets the largeIcon property. |
void |
setLongText(java.lang.String longText)
Sets the longText property. |
void |
setMnemonic(char mnemonic)
Sets the mnemonic property. |
void |
setShortText(java.lang.String shortText)
Sets the shortText property. |
void |
setSmallIcon(javax.swing.Icon smallIcon)
Sets the smallIcon property. |
void |
update(java.lang.Object source)
The update method is called when the UpdateAction is about to be displayed in UI. |
Methods inherited from class javax.swing.AbstractAction |
actionPerformed,
addPropertyChangeListener,
clone,
firePropertyChange,
getValue,
isEnabled,
putValue,
removePropertyChangeListener,
setEnabled |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final UpdateAction[] EMPTY_ARRAY
public static final java.lang.String MNEMONIC
public static final java.lang.String ACCELERATOR
public static final java.lang.String HELP_TOPIC
public static final java.lang.String LARGE_ICON
Constructor Detail |
public UpdateAction()
public UpdateAction(java.lang.String shortText)
shortText
- The short text for the actionpublic UpdateAction(java.lang.String shortText, char mnemonic)
shortText
- The short text for the actionmnemonic
- The mnemonic character for the actionpublic UpdateAction(java.lang.String shortText, char mnemonic, java.lang.String longText)
shortText
- The short text for the actionmnemonic
- The mnemonic character for the actionlongText
- The long text for the actionpublic UpdateAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon)
shortText
- The short text for the actionmnemonic
- The mnemonic character for the actionlongText
- The long text for the actionsmallIcon
- The small icon for the action (16x16)public UpdateAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, javax.swing.Icon largeIcon)
shortText
- The short text for the actionmnemonic
- The mnemonic character for the actionlongText
- The long text for the actionsmallIcon
- The small icon for the action (16x16)largeIcon
- The large icon for the action (32x32)Method Detail |
public void setShortText(java.lang.String shortText)
shortText
- The short text for the actionpublic java.lang.String getShortText()
public void setMnemonic(char mnemonic)
mnemonic
- The mnemonic character for the actionpublic char getMnemonic()
public void setLongText(java.lang.String longText)
longText
- The long text for the actionpublic java.lang.String getLongText()
public void setSmallIcon(javax.swing.Icon smallIcon)
smallIcon
- The small icon for the actionpublic javax.swing.Icon getSmallIcon()
public void setLargeIcon(javax.swing.Icon largeIcon)
largeIcon
- The large icon for the actionpublic javax.swing.Icon getLargeIcon()
public void setHelpTopic(com.borland.primetime.help.HelpTopic helpTopic)
helpTopic
- The helpTopic for the actionpublic com.borland.primetime.help.HelpTopic getHelpTopic()
public void update(java.lang.Object source)
The update method is called when the UpdateAction is about to be displayed in UI. At this point, the UpdateAction may optionally update it's enabled state, shortText, longText, icon, etc so that it may be represented in appropriate state for the passed source.
Subclasses can override this method to dynamically change their state
based on the current Node in the Browser, the current selected Node in the
ProjectView, or whatever they like. Typically, the static method:
public static Browser findBrowser(Object source)
is called
to acquire a Browser instance during the update process. If your action
*always* requires a browser, use the BrowserAction subclass in the ide
package.
NOTE: This method is called EVERY TIME a menu is about to display, or EVERY few milliseconds for toolbar buttons displaying this action. The code in the update method should be VERY SLIM and VERY FAST.
ANOTHER NOTE: This method is called EVERY few milliseconds if it is ever bound to a keystroke in the KeymapManager. When called from the KeymapManager, the passed source will *always* be the active Browser.
source
- The source of the action that is about to be displayed as UI.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |