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
FieldsModifier and TypeFieldDescriptionprotected Componentcomponent associated to the action (i.e.protected Stringprotected Desktopprotected EFileActionprotected Stringprotected Stringprotected String(package private) Stringprotected Stringprotected booleanFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsConstructorDescriptionFileDesktopAction(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 TypeMethodDescriptionvoidactionPerformed(ActionEvent event)version 1.2 (Dec 25, 2011)protected voidfinalize()protected Stringprotected StringgetDescription(File file)Provides a description of the action to put i.e.getFiles()protected booleanOverride this method to allow to callmayEnable(File)method to perform a check on files to enable or disable this action.protected booleanprotected abstract voidprocessFile(File file)voidInvoked when task's progress property changes.voidsetComponent(Component component)voidsetEnabled(boolean newValue)voidsetFiles(Collection<File> _files)since 1.0 (Mar 8, 2009)
version 1.1 (Dec 05, 2011)protected voidsetPopupDelay(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.CUSTOMargument
-
-
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:
actionPerformedin interfaceActionListener- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
-
propertyChange
Invoked when task's progress property changes.- Specified by:
propertyChangein 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:
setEnabledin interfaceAction- Overrides:
setEnabledin 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()
-