allensoft.javacvs.client.ui.swing
Class DefaultGraphicalClientFilesAction

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--allensoft.javacvs.client.ui.swing.DefaultGraphicalClientAction
              |
              +--allensoft.javacvs.client.ui.swing.DefaultGraphicalClientFilesAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, CVSAction, CVSFilesAction, java.util.EventListener, java.lang.Runnable, java.io.Serializable
Direct Known Subclasses:
AddAction, CheckForFilesToAddOrRemoveAction, CommitAction, DiffAction, LogAction, RemoveAction, StatusAction, TagAction, UpdateAction

public abstract class DefaultGraphicalClientFilesAction
extends DefaultGraphicalClientAction
implements CVSFilesAction, java.lang.Runnable

The base class for actions that perform CVS requests through a CVSClient.

See Also:
Serialized Form

Fields inherited from class allensoft.javacvs.client.ui.swing.DefaultGraphicalClientAction
LARGE_ICON, m_Event, MEDIUM_ICON
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface allensoft.javacvs.client.ui.swing.CVSAction
ABORT, ADD, ANNOTATE, CHECKOUT, COMMIT, DIFF, EXPORT, IMPORT, LOG, REMOVE, STATUS, TAG, UPDATE
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected DefaultGraphicalClientFilesAction(DefaultGraphicalClient client, java.lang.String sID, java.lang.String sName, java.lang.String sDescription)
           
protected DefaultGraphicalClientFilesAction(DefaultGraphicalClient client, java.lang.String sID, java.lang.String sName, java.lang.String sDescription, javax.swing.Icon small, javax.swing.Icon medium, javax.swing.Icon large)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  boolean canRunOnFile(java.io.File file)
          Determines if this action can be run on the specified file.
 void dispose()
           
protected  java.awt.event.ActionEvent getActionEvent()
          Gets the ActionEvent that caused this action to run.
 java.io.File[] getSelectedFiles()
          Gets the currently selected files for this action.
 void setSelectedFiles(java.io.File[] files)
          Sets the currently selected files for this action.
protected  boolean shouldBeEnabled(java.io.File[] files)
          Determines if the action should be enabled for the specified files.
 void updateEnabled()
          Determines if this action should be enabled based on the currently selected files.
 
Methods inherited from class allensoft.javacvs.client.ui.swing.DefaultGraphicalClientAction
askQuestion, displayError, displayInformation, getClient, getDescription, getGraphicalClient, getID, getLargeIcon, getMediumIcon, getParentFrameForDialog, getSmallIcon, getSourceComponent, getSourceWindow, invoke, loadIcon, setDescription, setLargeIcon, setMediumIcon, setSmallIcon
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, 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
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

DefaultGraphicalClientFilesAction

protected DefaultGraphicalClientFilesAction(DefaultGraphicalClient client,
                                            java.lang.String sID,
                                            java.lang.String sName,
                                            java.lang.String sDescription,
                                            javax.swing.Icon small,
                                            javax.swing.Icon medium,
                                            javax.swing.Icon large)

DefaultGraphicalClientFilesAction

protected DefaultGraphicalClientFilesAction(DefaultGraphicalClient client,
                                            java.lang.String sID,
                                            java.lang.String sName,
                                            java.lang.String sDescription)
Method Detail

dispose

public void dispose()
Overrides:
dispose in class DefaultGraphicalClientAction

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class DefaultGraphicalClientAction

getSelectedFiles

public java.io.File[] getSelectedFiles()
Gets the currently selected files for this action. When this action runs it will operate on these files.
Specified by:
getSelectedFiles in interface CVSFilesAction

setSelectedFiles

public void setSelectedFiles(java.io.File[] files)
Sets the currently selected files for this action. When this action runs it will operate on the files specified.
Specified by:
setSelectedFiles in interface CVSFilesAction

updateEnabled

public void updateEnabled()
Determines if this action should be enabled based on the currently selected files.
Specified by:
updateEnabled in interface CVSAction
Overrides:
updateEnabled in class DefaultGraphicalClientAction

shouldBeEnabled

protected boolean shouldBeEnabled(java.io.File[] files)
Determines if the action should be enabled for the specified files. The default is to enable the action if files is not null and contains at least one file and all the files can be run with this action.

getActionEvent

protected java.awt.event.ActionEvent getActionEvent()
Gets the ActionEvent that caused this action to run.

canRunOnFile

protected boolean canRunOnFile(java.io.File file)
Determines if this action can be run on the specified file.