com.borland.primetime.actions
Interface UpdateableAction

All Known Implementing Classes:
UpdateAction

public interface UpdateableAction
extends javax.swing.Action

The UpdatedateableAction interface allows actions to have an efficient transient state. An UpdateableAction's update method is called every time the action is about to be displayed in UI - allowing the action to poll whatever information it wishes to update its state before being displayed.

For example, a 'cut' action my be enabled or disabled based on the state of the selection in a text component. Just before the edit menu is displayed, the cut action is given the opporitunity to update itself, and will appear in the menu with the correct state.


Fields inherited from interface javax.swing.Action
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Method Summary
 void update(java.lang.Object source)
           The update method is called when the UpdateableAction is about to be displayed in UI.
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Method Detail

update

public void update(java.lang.Object source)

The update method is called when the UpdateableAction is about to be displayed in UI. At this point, the UpdateableAction may optionally update it's enabled state, shortText, longText, icon, etc so that it may be represented in appropriate state for the passed source.

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.

Parameters:
source - The source of the action that is about to be displayed in UI.