01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.common;
05:
06: import java.awt.Toolkit;
07:
08: import javax.swing.Action;
09: import javax.swing.AbstractAction;
10: import javax.swing.KeyStroke;
11: import javax.swing.Icon;
12:
13: // XXX: DEPRECATED
14: public abstract class XAbstractAction extends AbstractAction {
15: protected static final int MENU_SHORTCUT_KEY_MASK = Toolkit
16: .getDefaultToolkit().getMenuShortcutKeyMask();
17:
18: public XAbstractAction() {
19: super ();
20: }
21:
22: public XAbstractAction(String name) {
23: super (name);
24: setShortDescription(name);
25: }
26:
27: public XAbstractAction(String name, Icon icon) {
28: super (name, icon);
29: setShortDescription(name);
30: }
31:
32: public void setName(String name) {
33: putValue(Action.NAME, name);
34: }
35:
36: public String getName() {
37: return (String) getValue(Action.NAME);
38: }
39:
40: public void setSmallIcon(Icon icon) {
41: putValue(Action.SMALL_ICON, icon);
42: }
43:
44: public Icon getSmallIcon() {
45: return (Icon) getValue(Action.SMALL_ICON);
46: }
47:
48: public void setAccelerator(KeyStroke ks) {
49: putValue(ACCELERATOR_KEY, ks);
50: }
51:
52: public KeyStroke getAccelerator() {
53: return (KeyStroke) getValue(ACCELERATOR_KEY);
54: }
55:
56: public void setShortDescription(String description) {
57: putValue(Action.SHORT_DESCRIPTION, description);
58: }
59:
60: public String getShortDescription() {
61: return (String) getValue(Action.SHORT_DESCRIPTION);
62: }
63:
64: public void setLongDescription(String description) {
65: putValue(Action.LONG_DESCRIPTION, description);
66: }
67:
68: public String getLongDescription() {
69: return (String) getValue(Action.LONG_DESCRIPTION);
70: }
71:
72: }
|