org.fopps.ui.actions
Class ToggleDefaultAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.fopps.ui.actions.BaseAction
              |
              +--org.fopps.ui.actions.FeatureAction
                    |
                    +--org.fopps.ui.actions.ToggleDefaultAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable

public class ToggleDefaultAction
extends FeatureAction
implements javax.swing.event.ChangeListener

ToggleOptionalAction is an action to toggle the optional flag of a feature.

Author:
Oliver Wieland
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.fopps.ui.actions.BaseAction
GROUP, selectedItems
 
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
ToggleDefaultAction(ActionHandler pListener)
           
ToggleDefaultAction(java.lang.String name, ActionHandler pListener)
           
ToggleDefaultAction(java.lang.String name, javax.swing.Icon icon, ActionHandler pListener)
           
 
Method Summary
 boolean acceptSelection()
          Indicates, if an action is able to work with the selected items.
 void actionPerformed(java.awt.event.ActionEvent e)
           
 boolean addToMenu()
          Return true, if action should be added to menu.
 boolean isTogglable()
          Returns true, if action is a toggle action (behaves similar to a checkbox).
 void stateChanged(javax.swing.event.ChangeEvent e)
          Invoked when the target of the listener has changed its state.
 void updateState()
          Force refresh of action
 
Methods inherited from class org.fopps.ui.actions.FeatureAction
addToPopup
 
Methods inherited from class org.fopps.ui.actions.BaseAction
addToToolBar, clearSelection, compareTo, getAccelerator, getActionHandler, getApplication, getContainer, getGroup, getIcon, getLocaleName, getLongDescription, getMnemonic, getName, getSelectedItems, getSelectionSize, getShortDescription, isStringPropertySet, itemInSelection, itemStateChanged, setAccelerator, setAccelerator, setAcceleratorWithAlt, setAcceleratorWithCtrl, setAcceleratorWithShift, setGroup, setLocaleName, setLongDescription, setMnemonic, setMnemonic, setShortDescription, toString
 
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, wait, wait, wait
 

Constructor Detail

ToggleDefaultAction

public ToggleDefaultAction(ActionHandler pListener)

ToggleDefaultAction

public ToggleDefaultAction(java.lang.String name,
                           ActionHandler pListener)

ToggleDefaultAction

public ToggleDefaultAction(java.lang.String name,
                           javax.swing.Icon icon,
                           ActionHandler pListener)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Specified by:
actionPerformed in class FeatureAction
See Also:
ActionListener.actionPerformed(ActionEvent)

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Invoked when the target of the listener has changed its state.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
e - a ChangeEvent object

isTogglable

public boolean isTogglable()
Returns true, if action is a toggle action (behaves similar to a checkbox). Default is false

Overrides:
isTogglable in class BaseAction

updateState

public void updateState()
Force refresh of action

Overrides:
updateState in class BaseAction

addToMenu

public boolean addToMenu()
Return true, if action should be added to menu. Default is false

Overrides:
addToMenu in class BaseAction

acceptSelection

public boolean acceptSelection()
Indicates, if an action is able to work with the selected items. If acceptSelection returns false, the action will be disabled. This method is called after every selection change. ToggleOptionalAction accepts only 1 selected feature

Overrides:
acceptSelection in class FeatureAction
Returns:
true, if selection contains only features


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.