org.fopps.ui.actions
Class FileAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.fopps.ui.actions.BaseAction
              |
              +--org.fopps.ui.actions.FileAction
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
Direct Known Subclasses:
NewAction, OpenAction, SaveAction, SaveAsAction, SelectDirectoryAction

public abstract class FileAction
extends BaseAction
implements ApplicationListener

Base class for all file based actions

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
FileAction(ActionHandler pListener)
          Constructor for FileAction without icon and 'all files' as file filter
FileAction(java.lang.String name, ActionHandler pListener)
          Constructor for FileAction without icon and 'all files' as file filter
FileAction(java.lang.String name, javax.swing.filechooser.FileFilter pFilter, ActionHandler pListener)
          Constructor for FileAction.
FileAction(java.lang.String name, javax.swing.Icon icon, javax.swing.filechooser.FileFilter pFilter, ActionHandler pListener)
          Constructor for FileAction.
 
Method Summary
 boolean addToPopup()
          Determines, if action should appear in popup menu.
 void documentChanged(ApplicationEvent pEvent)
          Called on document changes.
 javax.swing.filechooser.FileFilter getFilter()
          Returns the filter.
 void setFilter(javax.swing.filechooser.FileFilter filter)
          Sets the filter.
 
Methods inherited from class org.fopps.ui.actions.BaseAction
acceptSelection, actionPerformed, addToMenu, addToToolBar, clearSelection, compareTo, getAccelerator, getActionHandler, getApplication, getContainer, getGroup, getIcon, getLocaleName, getLongDescription, getMnemonic, getName, getSelectedItems, getSelectionSize, getShortDescription, isStringPropertySet, isTogglable, itemInSelection, itemStateChanged, setAccelerator, setAccelerator, setAcceleratorWithAlt, setAcceleratorWithCtrl, setAcceleratorWithShift, setGroup, setLocaleName, setLongDescription, setMnemonic, setMnemonic, setShortDescription, toString, updateState
 
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

FileAction

public FileAction(ActionHandler pListener)
Constructor for FileAction without icon and 'all files' as file filter

Parameters:
pListener - Action handler

FileAction

public FileAction(java.lang.String name,
                  ActionHandler pListener)
Constructor for FileAction without icon and 'all files' as file filter

Parameters:
name -
pListener -

FileAction

public FileAction(java.lang.String name,
                  javax.swing.filechooser.FileFilter pFilter,
                  ActionHandler pListener)
Constructor for FileAction.

Parameters:
name -
pFilter -
pListener -

FileAction

public FileAction(java.lang.String name,
                  javax.swing.Icon icon,
                  javax.swing.filechooser.FileFilter pFilter,
                  ActionHandler pListener)
Constructor for FileAction.

Parameters:
name -
icon -
pListener -
Method Detail

getFilter

public javax.swing.filechooser.FileFilter getFilter()
Returns the filter.

Returns:
FileFilter

setFilter

public void setFilter(javax.swing.filechooser.FileFilter filter)
Sets the filter.

Parameters:
filter - The filter to set

documentChanged

public void documentChanged(ApplicationEvent pEvent)
Called on document changes. This method does nothing, subclasses may override this method to change their state correctly (e. g. activate 'save' button if document changed)

Specified by:
documentChanged in interface ApplicationListener
Parameters:
pEvent - Change event

addToPopup

public boolean addToPopup()
Determines, if action should appear in popup menu. All file actions return false.

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.