Source code: javax/ide/command/UpdateHandler.java
1 package javax.ide.command;
2
3 import javax.ide.menu.IDEAction;
4
5 /**
6 * <tt>UpdateHandler</tt>s decide when actions are enabled or disabled based
7 * on a context.
8 */
9 public interface UpdateHandler
10 {
11 /**
12 * Update the specified action based on the specified context. Typically an
13 * implementation will evaluate the <tt>context</tt> and enable or disable
14 * the action using {@link IDEAction#setEnabled( boolean )}.
15 *
16 * @param action the action to update.
17 * @param context the context to use for the update.
18 *
19 * @return true if this handler changed the state of the action.
20 */
21 boolean update( IDEAction action, Context context );
22 }