1 package siouxsie.desktop.commands;
2
3 import java.beans.PropertyChangeListener;
4
5 /**
6 * Interface for command (i.e. Swing actions)
7 * @author Arnaud Cogoluegnes
8 * @version $Id$
9 */
10 public interface ICommand {
11
12 public static final String COMMAND_EXIT ="exit";
13
14 public static final String PROPERTY_ENABLED = "enabled";
15
16 /**
17 * Enable/disable the action, thus all its dependant widgets.
18 * @param enable
19 */
20 public void setEnabled(boolean enable);
21
22 /**
23 * Is the command enabled?
24 * @return
25 */
26 public boolean isEnabled();
27
28 /**
29 * Execution
30 *
31 */
32 public void execute();
33
34 /**
35 * Add a listener interested in the command changes.
36 * @param lst
37 */
38 public void addPropertyChangeListener(PropertyChangeListener lst);
39
40 /**
41 * Remove a listener.
42 * @param lst
43 */
44 public void removePropertyChangeListener(PropertyChangeListener lst);
45
46 }