home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-09-29 | 1.9 KB | 89 lines |
- import java.awt.*;
- import java.awt.event.*;
- import com.sun.java.swing.*;
- import com.symantec.itools.swing.icons.ImageIcon;
- import com.symantec.itools.swing.actions.*;
- import java.io.*;
- import java.beans.*;
-
- public class BasicAction extends com.symantec.itools.swing.actions.Action implements java.io.Serializable
- {
- public BasicAction()
- {
- //{{INIT_CONTROLS
- setEnabled(true);
- //}}
- }
-
- public void setShortDescription(String desc)
- {
- putValue(SHORT_DESCRIPTION, desc);
- }
- public String getShortDescription()
- {
- try
- {
- return (String)getValue(SHORT_DESCRIPTION);
- }
- catch(Throwable t)
- {
- t.printStackTrace();
- return null;
- }
- }
-
- public void setLongDescription(String desc)
- {
- putValue(LONG_DESCRIPTION, desc);
- }
- public String getLongDescription()
- {
- try
- {
- return (String)getValue(LONG_DESCRIPTION);
- }
- catch(Throwable t)
- {
- t.printStackTrace();
- return null;
- }
- }
-
- public void setDefaultValue(String val)
- {
- putValue(DEFAULT, val);
- }
- public String getDefaultValue()
- {
- try
- {
- return (String)getValue(DEFAULT);
- }
- catch(Throwable t)
- {
- t.printStackTrace();
- return null;
- }
- }
-
- public void actionPerformed(java.awt.event.ActionEvent e)
- {
- if(listener==null)
- {
- return;
- }
- listener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, e.getActionCommand()));
- }
- public synchronized void addActionListener(ActionListener l)
- {
- listener = AWTEventMulticaster.add(listener, l);
- }
- public synchronized void removeActionListener(ActionListener l)
- {
- listener = AWTEventMulticaster.remove(listener, l);
- }
- ActionListener listener=null;
- //{{DECLARE_CONTROLS
- //}}
- }
-