001: package org.osbl.client.wings.shell;
002:
003: import org.wings.SComponent;
004:
005: import java.beans.PropertyChangeListener;
006:
007: /**
008: * @author hengels
009: * @version $Revision$
010: */
011: public interface Tool {
012: public static final String DEFAULT = "Default";
013: /**
014: * The key identifying the <code>Tool</code>.
015: */
016: public static final String KEY = "Key";
017: /**
018: * The key used for storing the <code>String</code> name
019: * for the tool, used for the tab.
020: */
021: public static final String NAME = "Name";
022: /**
023: * The key used for storing a short <code>String</code>
024: * description for the tool, used for tooltip text.
025: */
026: public static final String SHORT_DESCRIPTION = "ShortDescription";
027: /**
028: * The key used for storing a longer <code>String</code>
029: * description for the tool, could be used for context-sensitive help.
030: */
031: public static final String LONG_DESCRIPTION = "LongDescription";
032: /**
033: * The key used for storing a small <code>SIcon</code>
034: * for the tool, maybe used for the tab.
035: */
036: public static final String SMALL_ICON = "SmallIcon";
037:
038: /**
039: * The key used for storing a <code>KeyStroke</code> to be used as the
040: * accelerator for the tool.
041: */
042: public static final String ACCELERATOR_KEY = "AcceleratorKey";
043:
044: /**
045: * Gets one of this object's properties
046: * using the associated key.
047: * @see #putValue
048: */
049: public Object getValue(String key);
050:
051: /**
052: * Sets one of this object's properties
053: * using the associated key. If the value has
054: * changed, a <code>PropertyChangeEvent</code> is sent
055: * to listeners.
056: *
057: * @param key a <code>String</code> containing the key
058: * @param value an <code>Object</code> value
059: */
060: public void putValue(String key, Object value);
061:
062: /**
063: * Sets the enabled state of the <code>Tool</code>. When enabled,
064: * the tab associated with this object is active.
065: * If the value has changed, a <code>PropertyChangeEvent</code> is sent
066: * to listeners.
067: *
068: * @param b true to enable this <code>Tool</code>, false to disable it
069: */
070: public void setEnabled(boolean b);
071:
072: /**
073: * Returns the enabled state of the <code>Tool</code>. When enabled,
074: * the tab associated with this object is active.
075: *
076: * @return true if this <code>Tool</code> is enabled
077: */
078: public boolean isEnabled();
079:
080: /**
081: * Adds a <code>PropertyChange</code> listener. Containers and attached
082: * components use these methods to register interest in this
083: * <code>Tool</code> object. When its enabled state or other property
084: * changes, the registered listeners are informed of the change.
085: *
086: * @param listener a <code>PropertyChangeListener</code> object
087: */
088: public void addPropertyChangeListener(
089: PropertyChangeListener listener);
090:
091: /**
092: * Removes a <code>PropertyChange</code> listener.
093: *
094: * @param listener a <code>PropertyChangeListener</code> object
095: * @see #addPropertyChangeListener
096: */
097: public void removePropertyChangeListener(
098: PropertyChangeListener listener);
099:
100: public SComponent getComponent();
101: }
|