kawigi.cmd
Class SnippetAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by kawigi.cmd.DefaultAction
          extended by kawigi.cmd.SnippetAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class SnippetAction
extends DefaultAction

This class executes all snippet-related commands, including using a snippet, launching the snippet dialog and all the controls on the snippet dialog.

See Also:
Serialized Form

Field Summary
protected static javax.swing.JDialog addSnippetDialog
          The global reference to the "Add Snippet" dialog, if it has been created.
protected  CodePane context
          The CodePane that this action should act on.
 
Fields inherited from class kawigi.cmd.DefaultAction
cmdid, COLOR, enableSet, FONT, LARGE_ICON, SELECTED, SPINNER_MODEL, SPINNER_VALUE, TEXT, visible, VISIBLE, visibleSet
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
SnippetAction(ActID cmdid, CodePane context)
          Constructs a new SnippetAction for the given ActID to act on the given CodePane.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Executes this action.
 java.lang.Object getValue(java.lang.String key)
          Overridden to return the right values for the TEXT property.
 boolean isEnabled()
          Returns true if this command should be enabled.
 void putValue(java.lang.String key, java.lang.Object value)
          Overridden to properly save the TEXT property.
 
Methods inherited from class kawigi.cmd.DefaultAction
equals, getID, isNeedTrackEnabled, isVisible, reportError, setVisible, UIRefresh
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected CodePane context
The CodePane that this action should act on.


addSnippetDialog

protected static javax.swing.JDialog addSnippetDialog
The global reference to the "Add Snippet" dialog, if it has been created.

Constructor Detail

SnippetAction

public SnippetAction(ActID cmdid,
                     CodePane context)
Constructs a new SnippetAction for the given ActID to act on the given CodePane.

Method Detail

isEnabled

public boolean isEnabled()
Returns true if this command should be enabled.

Specified by:
isEnabled in interface javax.swing.Action
Overrides:
isEnabled in class javax.swing.AbstractAction

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Executes this action.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Specified by:
actionPerformed in class DefaultAction

getValue

public java.lang.Object getValue(java.lang.String key)
Overridden to return the right values for the TEXT property.

Specified by:
getValue in interface javax.swing.Action
Overrides:
getValue in class javax.swing.AbstractAction

putValue

public void putValue(java.lang.String key,
                     java.lang.Object value)
Overridden to properly save the TEXT property.

Specified by:
putValue in interface javax.swing.Action
Overrides:
putValue in class javax.swing.AbstractAction