KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sshtools > ui > awt > Action


1 package com.sshtools.ui.awt;
2
3 import java.awt.event.ActionListener JavaDoc;
4 import java.beans.PropertyChangeListener JavaDoc;
5
6 /**
7  * An extended ActionListener for AWT.
8  *
9  * @author $Author: lee $
10  */

11 public interface Action extends ActionListener JavaDoc {
12
13   // We use the sm
14

15   /**
16    * Key used for storing the action name
17    */

18   public static final String JavaDoc NAME = "Name"; //$NON-NLS-1$
19
/**
20    * Key for a short description for the action, used for tooltip text.
21    */

22   public static final String JavaDoc SHORT_DESCRIPTION = "ShortDescription"; //$NON-NLS-1$
23

24   /**
25    * Key for storing a long description for the action.
26    */

27   public static final String JavaDoc LONG_DESCRIPTION = "LongDescription"; //$NON-NLS-1$
28

29   /**
30    *
31    */

32   public static final String JavaDoc ACTION_COMMAND_KEY = "ActionCommandKey"; //$NON-NLS-1$
33

34   /**
35    * Key used for storing a <code>KeyStroke</code> for the accelerator for the
36    * action.
37    */

38   public static final String JavaDoc ACCELERATOR_KEY = "AcceleratorKey"; //$NON-NLS-1$
39

40   /**
41    * Key for storing an <code>Integer</code> object to be used as the mnemonic
42    * for the action.
43    */

44   public static final String JavaDoc MNEMONIC_KEY = "MnemonicKey"; //$NON-NLS-1$
45

46   /**
47    * Key for a <code>String</code> value to specify the resource name for the
48    * small icon
49    */

50   public final static String JavaDoc SMALL_IMAGE_PATH = "SmallImagePath"; //$NON-NLS-1$
51

52   /**
53    * Key for a <code>String</code> value to specify the resource name for the
54    * icon
55    */

56   public final static String JavaDoc IMAGE_PATH = "ImagePath"; //$NON-NLS-1$
57

58   /**
59    * <code>Boolean</code> value to specify if text should be shown when this
60    * action is used to build components for an <code>ActionBar</code>
61    */

62   public final static String JavaDoc HIDE_TOOLBAR_TEXT = "HideToolBarText"; //$NON-NLS-1$
63

64   /**
65    * Actions can have any number of attributes, each referenced by a key (a
66    * string). <code>null</code> will be returned if no such attribute exists
67    *
68    * @param key
69    * key
70    * @return action attribute value
71    */

72   public Object JavaDoc getValue(String JavaDoc key);
73
74   /**
75    * Actions can have any number of attributes, each referenced by a key (a
76    * string).
77    *
78    * @param key
79    * key
80    * @param value
81    * value
82    */

83   public void putValue(String JavaDoc key, Object JavaDoc value);
84
85   /**
86    * Return the name of the action. Same as doing {@link AppAction.getValue}
87    * using a key of {@link AppAction.NAME}.
88    *
89    * @return action name
90    */

91   public String JavaDoc getName();
92
93   /**
94    * Get if the component(s) that were built from this action should be
95    * enabled or not.
96    *
97    * @return enabled
98    */

99   public boolean isEnabled();
100
101   /**
102    * Set if the component(s) that were built from this action should be
103    * enabled or not.
104    *
105    * @param enabled action enaqbled
106    */

107   public void setEnabled(boolean enabled);
108
109   /**
110    * Add a <code>PropertyChangeListener</code> that will be notified when
111    * either a value changes or the enabled state changes
112    *
113    * @param l listener to add
114    */

115   public void addPropertyChangeListener(PropertyChangeListener JavaDoc l);
116
117   /**
118    * Remove a <code>PropertyChangeListener</code> from the list
119    * that will be notified when either a value changes or the enabled state changes
120    *
121    * @param l listener to remove
122    */

123   public void removePropertyChangeListener(PropertyChangeListener JavaDoc l);
124
125 }
Popular Tags