com.mucommander.ui.action
Class SelectedFileAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by com.mucommander.ui.action.MuAction
          extended by com.mucommander.ui.action.FileAction
              extended by com.mucommander.ui.action.SelectedFileAction
All Implemented Interfaces:
ActivePanelListener, TableSelectionListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
InternalEditAction, InternalViewAction, LocalCopyAction, OpenInBothPanelsAction, OpenInOtherPanelAction, RenameAction, SelectedFilesAction

public abstract class SelectedFileAction
extends FileAction

SelectedFileAction is an abstract action that operates on the currently active FileTable, and that is enabled only when a file other than the parent folder file '..' is selected.

Optionally, a FileFilter can be specified using setSelectedFileFilter to further restrict the enabled condition to files that match the filter.

Author:
Maxence Bernard
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mucommander.ui.action.FileAction
filter
 
Fields inherited from class com.mucommander.ui.action.MuAction
ALTERNATE_ACCELERATOR_PROPERTY_KEY, mainFrame
 
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
SelectedFileAction(MainFrame mainFrame, java.util.Hashtable properties)
           
 
Method Summary
protected  boolean getFileTableCondition(FileTable fileTable)
          This method is called to determine if the current FileTable state allows this action to be enabled.
 void setSelectedFileFilter(FileFilter filter)
          Restricts the enabled condition to selected files that match the specified filter.
 
Methods inherited from class com.mucommander.ui.action.FileAction
activePanelChanged, markedFilesChanged, selectedFileChanged, updateEnabledState
 
Methods inherited from class com.mucommander.ui.action.MuAction
actionPerformed, getAccelerator, getAcceleratorText, getAlternateAccelerator, getIcon, getKeyStrokeRepresentation, getLabel, getMainFrame, getModifiersRepresentation, getStandardAccelerator, getStandardAccelerator, getStandardAlternateAccelerator, getStandardAlternateAccelerator, getStandardIcon, getStandardIcon, getStandardIconPath, getStandardIconPath, getStandardLabel, getStandardLabel, getStandardLabelKey, getStandardLabelKey, getStandardTooltip, getStandardTooltip, getStandardTooltipKey, getStandardTooltipKey, getToolTipText, honourNoEventsMode, isAccelerator, performAction, performActionInSeparateThread, reportError, reportError, reportGenericError, setAccelerator, setAlternateAccelerator, setHonourNoEventsMode, setIcon, setLabel, setPerformActionInSeparateThread, setToolTipText
 
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
 

Constructor Detail

SelectedFileAction

public SelectedFileAction(MainFrame mainFrame,
                          java.util.Hashtable properties)
Method Detail

setSelectedFileFilter

public void setSelectedFileFilter(FileFilter filter)
Restricts the enabled condition to selected files that match the specified filter.

Parameters:
filter - FileFilter instance

getFileTableCondition

protected boolean getFileTableCondition(FileTable fileTable)
Description copied from class: FileAction
This method is called to determine if the current FileTable state allows this action to be enabled. If false is returned, the action will be disabled. If true is returned, the action will be enabled if the file filter (if there is one) matches the selected file.

Specified by:
getFileTableCondition in class FileAction
Parameters:
fileTable - currently active FileTable


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard