org.fopps.ui.actions
Class UndoAction

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

public class UndoAction
extends BaseAction
implements ApplicationListener

Performs an undo. UndoAction behaves different from other actions since it does not depend on selections. It only checks if undo items available and disables itself, if no items available.

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
UndoAction(ActionHandler pListener)
           
UndoAction(java.lang.String name, ActionHandler pListener)
           
UndoAction(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 addToPopup()
          Determines, if action should appear in popup menu
 void documentChanged(ApplicationEvent pEvent)
           
 void itemStateChanged(java.awt.event.ItemEvent e)
          Handler of itemListener.
 void updateState()
          Force refresh of action
 
Methods inherited from class org.fopps.ui.actions.BaseAction
addToMenu, addToToolBar, clearSelection, compareTo, getAccelerator, getActionHandler, getApplication, getContainer, getGroup, getIcon, getLocaleName, getLongDescription, getMnemonic, getName, getSelectedItems, getSelectionSize, getShortDescription, isStringPropertySet, isTogglable, itemInSelection, 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

UndoAction

public UndoAction(ActionHandler pListener)

UndoAction

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

UndoAction

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

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Handler of itemListener.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Overrides:
itemStateChanged in class BaseAction

documentChanged

public void documentChanged(ApplicationEvent pEvent)
Specified by:
documentChanged in interface ApplicationListener

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

Overrides:
acceptSelection in class BaseAction
Returns:
true, if action is able to operate on current selection

updateState

public void updateState()
Force refresh of action

Overrides:
updateState in class BaseAction

actionPerformed

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

addToPopup

public boolean addToPopup()
Determines, if action should appear in popup menu

Specified by:
addToPopup in class BaseAction
Returns:
true, if action should added to context menu, otherwise false


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