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

public abstract class FileDesktopAction extends AbstractAction implements PropertyChangeListener
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 Details

    • files

      protected ArrayList<File> files
    • eAction

      protected EFileAction eAction
    • desktop

      protected Desktop desktop
    • name

      final String name
    • component

      protected Component component
      component associated to the action (i.e. a panel, used as owner to show popups)
    • descriptionFormat

      protected String descriptionFormat
    • invalidAction

      protected String invalidAction
    • errorTitle

      protected String errorTitle
    • noFileSelected

      protected String noFileSelected
    • filesCountStr

      protected String filesCountStr
    • supported

      protected boolean supported
  • Constructor Details

  • Method Details

    • getComponent

      public Component getComponent()
      Returns:
      the component
      See Also:
      component
    • setComponent

      public void setComponent(Component component)
      Parameters:
      component - the component to set
      See Also:
      component
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      version 1.2 (Dec 25, 2011)
      Specified by:
      actionPerformed in interface ActionListener
      See Also:
      ActionListener.actionPerformed(java.awt.event.ActionEvent)
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Invoked when task's progress property changes.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Since:
      1.2 (Dec 25, 2011)
    • processFile

      protected abstract void processFile(File file) throws IOException
      Throws:
      IOException
    • getFiles

      public Collection<File> getFiles()
      Returns:
      the files
    • setFiles

      public final void setFiles(Collection<File> _files)
      since 1.0 (Mar 8, 2009)
      version 1.1 (Dec 05, 2011)
      Parameters:
      _files - the files to set
    • getDescription

      protected String getDescription(File file)
      Provides a description of the action to put i.e. on a JToolTip.
      Parameters:
      file -
      Returns:
    • isEnabledByFilesCheck

      protected boolean isEnabledByFilesCheck()
      Override this method to allow to call mayEnable(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

      protected boolean mayEnable(File file)
      Parameters:
      file -
      Returns:
      Since:
      1.1 (Dec 05, 2011)
    • getCustomName

      protected String getCustomName()
    • setEnabled

      public void setEnabled(boolean newValue)
      Specified by:
      setEnabled in interface Action
      Overrides:
      setEnabled in class AbstractAction
    • 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 milliseconds
      millisToPopup - an int specifying the time in milliseconds
      Since:
      1.2 (Dec 25, 2011)
      See Also:
      ProgressMonitor.getMillisToDecideToPopup(), ProgressMonitor.getMillisToPopup()