Package be.gaudry.swing.file.action
Class FileDesktopAction
java.lang.Object
javax.swing.AbstractAction
be.gaudry.swing.file.action.FileDesktopAction
- All Implemented Interfaces:
ActionListener
,PropertyChangeListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
BrowseFileAction
,DeleteFileAction
,EditFileAction
,OpenFileAction
,OpenWithFileAction
,PrintFileAction
,SynchroAction
,TagAndRenameFileAction
Provided by the broldev.file.finder.swing project.
- Since:
- 1.0 (Mar 8, 2009), broldev.file.finder.swing 1.0.10-SNAPSHOT dependency
- Version:
- 1.2 (Dec 25, 2011)
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionprotected Component
component associated to the action (i.e.protected String
protected Desktop
protected EFileAction
protected String
protected String
protected String
(package private) String
protected String
protected boolean
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
ConstructorDescriptionFileDesktopAction(EFileAction _eAction, Component _component)
If you want to use an undefined action, you must provide an identifier by using theFileDesktopAction(EFileAction, String, Component)
constructor.FileDesktopAction(EFileAction _eAction, String id, Component _component)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed(ActionEvent event)
version 1.2 (Dec 25, 2011)protected void
finalize()
protected String
protected String
getDescription(File file)
Provides a description of the action to put i.e.getFiles()
protected boolean
Override this method to allow to callmayEnable(File)
method to perform a check on files to enable or disable this action.protected boolean
protected abstract void
processFile(File file)
void
Invoked when task's progress property changes.void
setComponent(Component component)
void
setEnabled(boolean newValue)
void
setFiles(Collection<File> _files)
since 1.0 (Mar 8, 2009)
version 1.1 (Dec 05, 2011)protected void
setPopupDelay(int millisToDecideToPopup, int millisToPopup)
Specifies delay before taking a decision about showing or not the progress, and before showing it.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener
-
Field Details
-
files
-
eAction
-
desktop
-
name
-
component
component associated to the action (i.e. a panel, used as owner to show popups) -
descriptionFormat
-
invalidAction
-
errorTitle
-
noFileSelected
-
filesCountStr
-
supported
protected boolean supported
-
-
Constructor Details
-
FileDesktopAction
- Parameters:
_eAction
-id
-_component
-
-
FileDesktopAction
If you want to use an undefined action, you must provide an identifier by using theFileDesktopAction(EFileAction, String, Component)
constructor.- Parameters:
_eAction
-_component
-- Throws:
IllegalArgumentException
- with aEFileAction.CUSTOM
argument
-
-
Method Details
-
getComponent
- Returns:
- the component
- See Also:
component
-
setComponent
- Parameters:
component
- the component to set- See Also:
component
-
finalize
-
actionPerformed
version 1.2 (Dec 25, 2011)- Specified by:
actionPerformed
in interfaceActionListener
- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
-
propertyChange
Invoked when task's progress property changes.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Since:
- 1.2 (Dec 25, 2011)
-
processFile
- Throws:
IOException
-
getFiles
- Returns:
- the files
-
setFiles
since 1.0 (Mar 8, 2009)
version 1.1 (Dec 05, 2011)- Parameters:
_files
- the files to set
-
getDescription
Provides a description of the action to put i.e. on aJToolTip
.- Parameters:
file
-- Returns:
-
isEnabledByFilesCheck
protected boolean isEnabledByFilesCheck()Override this method to allow to callmayEnable(File)
method to perform a check on files to enable or disable this action.- Returns:
- false by default
- Since:
- 1.1 (Dec 05, 2011)
-
mayEnable
- Parameters:
file
-- Returns:
- Since:
- 1.1 (Dec 05, 2011)
-
getCustomName
-
setEnabled
public void setEnabled(boolean newValue)- Specified by:
setEnabled
in interfaceAction
- Overrides:
setEnabled
in classAbstractAction
-
setPopupDelay
protected void setPopupDelay(int millisToDecideToPopup, int millisToPopup)Specifies delay before taking a decision about showing or not the progress, and before showing it.- millisToDecideToPopup specifies the amount of time to wait before deciding whether or not to popup a progress monitor.
- millisToPopup specifies the amount of time it will take for the popup to appear. (If the predicted time remaining is less than this time, the popup won't be displayed.)
- Parameters:
millisToDecideToPopup
- an int specifying the time to wait, in millisecondsmillisToPopup
- an int specifying the time in milliseconds- Since:
- 1.2 (Dec 25, 2011)
- See Also:
ProgressMonitor.getMillisToDecideToPopup()
,ProgressMonitor.getMillisToPopup()
-