Class LibraryBatchAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.tagtraum.core.app.ApplicationAction
-
- com.tagtraum.beatunes.action.BaseAction
-
- com.tagtraum.beatunes.action.standard.LibraryBatchAction
-
- All Implemented Interfaces:
ApplicationComponent<BeaTunes>
,ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
EmbedSpecialFieldsAction
,LookupWithFingerprint
,SubmitFingerprintsAction
,SubmitLibraryAction
public abstract class LibraryBatchAction extends BaseAction
An action that iterates over the whole library and calls a
LibraryBatchAction.EachSongProcessor
for each song that is encountered.Before the action is started a confirmation dialog is displayed, that explains what this action actually does (see
getConfirmationMessage()
).Progress is visualized with a
DiscreteProgressDialog
.This action should be used for tasks that don't take very long. Unlike the
AnalysisQueue
, status and progress is not persisted and processing cannot be paused.- Author:
- Hendrik Schreiber
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LibraryBatchAction.EachSongProcessor
Processor that is notified of start, each song and finish of the batch process.-
Nested classes/interfaces inherited from class com.tagtraum.beatunes.action.BaseAction
BaseAction.EnabledView, BaseAction.Location, BaseAction.SelectionCount
-
Nested classes/interfaces inherited from class com.tagtraum.core.app.ApplicationAction
ApplicationAction.ApplicationActionFacade
-
-
Field Summary
-
Fields inherited from class com.tagtraum.beatunes.action.BaseAction
ITEMS_EDITABLE
-
Fields inherited from class com.tagtraum.core.app.ApplicationAction
BUTTON_MODEL, DISABLED_ICON, DISABLED_SELECTED_ICON, PRESSED_ICON, ROLLOVER_ICON, SELECTED_ICON, SHORT_NAME
-
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
Constructors Constructor Description LibraryBatchAction()
LibraryBatchAction(BeaTunes beaTunes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
protected abstract LibraryBatchAction.EachSongProcessor
createEachSongProcessor()
Creates theLibraryBatchAction.EachSongProcessor
to be used.ActionLocation[]
getActionLocations()
Specifies where in the UI this action should be installed.protected abstract String
getConfirmationMessage()
The return value of this method will be displayed in the confirmation dialog.protected Preferences
getPreferences()
protected String
getPreferencesConfirmationKey()
-
Methods inherited from class com.tagtraum.beatunes.action.BaseAction
bindListeners, bindListeners, getApplication, getFocusedPlayList, getFocusOwner, getMostRecentlyFocused, getPlayListTreeNode, getSelectedPlayList, getSelectedPlayListTreeNode, getSelectedSong, getSelectedSongCount, getSelectedSongIds, getSelectedSongs, getSelectedSongs, init, isAnalysisQueueFocused, isMatchTableFocused, isPlayListTreeFocused, isSimpleSongTableFocused, isSongTableFocused, loadResources, numberOfSelectedSongs, numberOfSelectedSongs, setApplication, shutdown
-
Methods inherited from class com.tagtraum.core.app.ApplicationAction
getButtonModel, getIconButtonFacade, getId, getMenuFacade, getToolbarButtonFacade, isVisible, register, setButtonModel, setVisible
-
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
-
Methods inherited from interface com.tagtraum.core.app.ApplicationComponent
getId
-
-
-
-
Constructor Detail
-
LibraryBatchAction
public LibraryBatchAction()
-
LibraryBatchAction
public LibraryBatchAction(BeaTunes beaTunes)
-
-
Method Detail
-
getActionLocations
public ActionLocation[] getActionLocations()
Description copied from class:ApplicationAction
Specifies where in the UI this action should be installed.- Overrides:
getActionLocations
in classApplicationAction
- Returns:
- installation locations for this action - the default is an empty array
-
getPreferences
protected Preferences getPreferences()
-
getConfirmationMessage
protected abstract String getConfirmationMessage()
The return value of this method will be displayed in the confirmation dialog.- Returns:
- confirmation dialog text
-
getPreferencesConfirmationKey
protected String getPreferencesConfirmationKey()
-
createEachSongProcessor
protected abstract LibraryBatchAction.EachSongProcessor createEachSongProcessor()
Creates theLibraryBatchAction.EachSongProcessor
to be used. This method needs to be implemented in a sub-class.- Returns:
- new
LibraryBatchAction.EachSongProcessor
-
actionPerformed
public void actionPerformed(ActionEvent e)
-
-