kawigi.cmd
Class DefaultAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by kawigi.cmd.DefaultAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
EditorAction, FindReplaceAction, GlobalActionAdapter, LocalTestAction, SettingAction, SnippetAction, TemplateAction, TestCasesAction

public abstract class DefaultAction
extends javax.swing.AbstractAction

Superclass of all KawigiEdit actions.

See Also:
Serialized Form

Field Summary
protected  ActID cmdid
          The ActID for this Action.
static java.lang.String COLOR
          Color property for the currently selected color in a color-selection control.
protected  boolean enableSet
          Last set value for enable property.
static java.lang.String FONT
          Font property stored for a kawigi.widget.FontPanel
static java.lang.String LARGE_ICON
          Image property for icon if it should show a larger (24x24 instead of 16x16) icon.
static java.lang.String SELECTED
          Boolean property of the state of a check box or something similar.
static java.lang.String SPINNER_MODEL
          SpinnerModel property (provides an object that implements SpinnerModel)
static java.lang.String SPINNER_VALUE
          Value of a spinner - the type depends on the SpinnerModel implementation
static java.lang.String TEXT
          String property to override the text of a text box.
protected  boolean visible
          Visibility state
static java.lang.String VISIBLE
          Boolean visibility property to show or hide controls.
protected  boolean visibleSet
          Last set value for visible property.
 
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
protected DefaultAction(ActID cmdid)
          Constructor for DefaultAction - requires an ActID.
 
Method Summary
abstract  void actionPerformed(java.awt.event.ActionEvent e)
          Must override to define what the action does when it launches an event.
 boolean equals(java.lang.Object o)
          Determines if this action is equal to another one.
 ActID getID()
          returns the ActID for this Action.
 boolean isNeedTrackEnabled()
          Shows if it's needed to track changes in "enabled" or "visible" properties.
 boolean isVisible()
          Override to allow the control to hide dynamically.
protected  void reportError(java.lang.Throwable t, boolean warning)
          Prints a stack trace to the console and if it's not a warning, brings up an error dialog.
 void setVisible(boolean newValue)
          Sets the visibility property.
 void UIRefresh()
          Refreshes the values of all properties.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LARGE_ICON

public static final java.lang.String LARGE_ICON
Image property for icon if it should show a larger (24x24 instead of 16x16) icon.

See Also:
Constant Field Values

COLOR

public static final java.lang.String COLOR
Color property for the currently selected color in a color-selection control.

See Also:
Constant Field Values

VISIBLE

public static final java.lang.String VISIBLE
Boolean visibility property to show or hide controls.

See Also:
Constant Field Values

TEXT

public static final java.lang.String TEXT
String property to override the text of a text box.

See Also:
Constant Field Values

SELECTED

public static final java.lang.String SELECTED
Boolean property of the state of a check box or something similar.

See Also:
Constant Field Values

FONT

public static final java.lang.String FONT
Font property stored for a kawigi.widget.FontPanel

See Also:
Constant Field Values

SPINNER_MODEL

public static final java.lang.String SPINNER_MODEL
SpinnerModel property (provides an object that implements SpinnerModel)

See Also:
Constant Field Values

SPINNER_VALUE

public static final java.lang.String SPINNER_VALUE
Value of a spinner - the type depends on the SpinnerModel implementation

See Also:
Constant Field Values

cmdid

protected ActID cmdid
The ActID for this Action.


visible

protected boolean visible
Visibility state


enableSet

protected boolean enableSet
Last set value for enable property.


visibleSet

protected boolean visibleSet
Last set value for visible property.

Constructor Detail

DefaultAction

protected DefaultAction(ActID cmdid)
Constructor for DefaultAction - requires an ActID. It also sets a bunch of properties based on the values in the ActID.

Method Detail

UIRefresh

public void UIRefresh()
Refreshes the values of all properties.


isNeedTrackEnabled

public boolean isNeedTrackEnabled()
Shows if it's needed to track changes in "enabled" or "visible" properties. When this tracking is on first changing of textbox, for example, leads to losing its focus. This method is useful for overriding in descendant classes where we need not this unpredictable focus changing


getID

public ActID getID()
returns the ActID for this Action.


isVisible

public boolean isVisible()
Override to allow the control to hide dynamically. This won't work on any control, but it will work on many of the controls in kawigi.widget.


setVisible

public void setVisible(boolean newValue)
Sets the visibility property.


actionPerformed

public abstract void actionPerformed(java.awt.event.ActionEvent e)
Must override to define what the action does when it launches an event.


reportError

protected void reportError(java.lang.Throwable t,
                           boolean warning)
Prints a stack trace to the console and if it's not a warning, brings up an error dialog.


equals

public boolean equals(java.lang.Object o)
Determines if this action is equal to another one.

Overrides:
equals in class java.lang.Object