01: package abbot.editor.actions;
02:
03: import java.awt.event.*;
04:
05: /** Encapsulate GUI attributes for an editor action. */
06:
07: public class EditorToggleAction extends EditorAction {
08:
09: public static final String STATE = "STATE";
10:
11: public EditorToggleAction(String base) {
12: super (base);
13: setSelected(false);
14: }
15:
16: // FIXME
17: public void actionPerformed(ActionEvent ev) {
18: setSelected(!isSelected());
19: //super.actionPerformed(ev);
20: }
21:
22: public boolean isSelected() {
23: return getValue(STATE) == Boolean.TRUE;
24: }
25:
26: public void setSelected(boolean state) {
27: putValue(STATE, state ? Boolean.TRUE : Boolean.FALSE);
28: }
29: }
|