kawigi.cmd
Class FindReplaceAction

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

public class FindReplaceAction
extends DefaultAction

Action implementation for Find/Replace related actions. Actions here are not global, because they act on a specific CodePane.

See Also:
Serialized Form

Field Summary
protected  CodePane codepane
          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
FindReplaceAction(ActID cmdid, CodePane codepane)
          Constructs a new FindReplaceAction to execute the given ActID on the given CodePane.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Runs this action.
 void doReplaceAll()
          Does a global replacement with the current search and replacement strings.
 void doReplacement()
          Does the replacement action with the replacement pattern if the current selection matches the search string.
 java.lang.Object getValue(java.lang.String key)
          Overridden to override the TEXT property of text fields and SELECTED property of the check boxes and radio buttons.
 boolean isEnabled()
          Returns true if this Action should show up as enabled.
 boolean isVisible()
          Returns true if this action should be showing at all.
 void putValue(java.lang.String key, java.lang.Object value)
          Overridden to save the TEXT property from the text fields and the SELECTED property from the checkboxes and radio buttons.
 
Methods inherited from class kawigi.cmd.DefaultAction
equals, getID, 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

codepane

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

Constructor Detail

FindReplaceAction

public FindReplaceAction(ActID cmdid,
                         CodePane codepane)
Constructs a new FindReplaceAction to execute the given ActID on the given CodePane.

Method Detail

isEnabled

public boolean isEnabled()
Returns true if this Action should show up as enabled.

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

isVisible

public boolean isVisible()
Returns true if this action should be showing at all.

Overrides:
isVisible in class DefaultAction

actionPerformed

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

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

doReplacement

public void doReplacement()
Does the replacement action with the replacement pattern if the current selection matches the search string.


doReplaceAll

public void doReplaceAll()
Does a global replacement with the current search and replacement strings.


getValue

public java.lang.Object getValue(java.lang.String key)
Overridden to override the TEXT property of text fields and SELECTED property of the check boxes and radio buttons.

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 save the TEXT property from the text fields and the SELECTED property from the checkboxes and radio buttons.

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