com.lightdev.app.shtm
Class FrmMain.ToggleAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by com.lightdev.app.shtm.FrmMain.ToggleAction
All Implemented Interfaces:
AttributeComponent, SHTMLAction, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Enclosing class:
FrmMain

public class FrmMain.ToggleAction
extends javax.swing.AbstractAction
implements SHTMLAction, AttributeComponent

action to toggle an attribute

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
FrmMain.ToggleAction(java.lang.String name, java.lang.Object key, java.lang.Object sVal)
          construct a ToggleFontAction
FrmMain.ToggleAction(java.lang.String name, java.lang.Object key, java.lang.Object sVal, java.lang.Object uVal)
          construct a ToggleFontAction
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          do the format change for the associated attribute
 java.lang.Object getAttributeKey()
          get the attribute this action represents values for
 void getProperties()
          get image, etc.
 javax.swing.text.AttributeSet getValue()
          get the value of this AttributeComponent
 javax.swing.text.AttributeSet getValue(boolean includeUnchanged)
           
 boolean setValue(javax.swing.text.AttributeSet a)
          set the value of this AttributeComponent
 void update()
          update the action's state
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

FrmMain.ToggleAction

public FrmMain.ToggleAction(java.lang.String name,
                            java.lang.Object key,
                            java.lang.Object sVal,
                            java.lang.Object uVal)
construct a ToggleFontAction

Parameters:
name - the name and command for this action
key - the attribute this action represents values for
sVal - the value for the attribute being selected
uVal - the value for the attribute not being selected

FrmMain.ToggleAction

public FrmMain.ToggleAction(java.lang.String name,
                            java.lang.Object key,
                            java.lang.Object sVal)
construct a ToggleFontAction

Parameters:
name - the name and command for this action
key - the attribute this action represents values for
sVal - the value for the attribute being selected
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
do the format change for the associated attribute

This reverses the current setting for the associated attribute

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent describing the cause for this action

getAttributeKey

public java.lang.Object getAttributeKey()
get the attribute this action represents values for

Returns:
the attribute this action represents values for

setValue

public boolean setValue(javax.swing.text.AttributeSet a)
set the value of this AttributeComponent

Specified by:
setValue in interface AttributeComponent
Parameters:
a - the set of attributes possibly having an attribute this component can display
Returns:
true, if the set of attributes had a matching attribute, false if not

getValue

public javax.swing.text.AttributeSet getValue()
get the value of this AttributeComponent

Specified by:
getValue in interface AttributeComponent
Returns:
the value selected from this component

getValue

public javax.swing.text.AttributeSet getValue(boolean includeUnchanged)
Specified by:
getValue in interface AttributeComponent

update

public void update()
update the action's state

Specified by:
update in interface SHTMLAction

getProperties

public void getProperties()
get image, etc. from resource

Specified by:
getProperties in interface SHTMLAction