Class NewEmptyPlayListAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.tagtraum.core.app.ApplicationAction
-
- com.tagtraum.beatunes.action.BaseAction
-
- com.tagtraum.beatunes.action.standard.NewPlayListAction
-
- com.tagtraum.beatunes.action.standard.NewEmptyPlayListAction
-
- All Implemented Interfaces:
ApplicationComponent<BeaTunes>
,ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class NewEmptyPlayListAction extends NewPlayListAction
New empty playList action.- Author:
- Hendrik Schreiber
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 NewEmptyPlayListAction(BeaTunes beaTunes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
fillPlayList(PlayList newPlayList, long[] selectedSongIds)
This method is called by the action as part of itsNewPlayListAction.actionPerformed(ActionEvent)
method.ActionLocation[]
getActionLocations()
By default installs this action in the File menu below the New Folder action and—ifNewPlayListAction.isRequiresSelectedSongs()
returnstrue
also in the context menu.String
getId()
Returns a unique id for this action.protected void
loadResources()
Installs enabled/disabled listeners that turn the action on and off, depending on whether any songs are selected.-
Methods inherited from class com.tagtraum.beatunes.action.standard.NewPlayListAction
actionPerformed, createEmptyPlayList, isRequiresSelectedSongs, setRequiresSelectedSongs
-
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, numberOfSelectedSongs, numberOfSelectedSongs, setApplication, shutdown
-
Methods inherited from class com.tagtraum.core.app.ApplicationAction
getButtonModel, getIconButtonFacade, getMenuFacade, getToolbarButtonFacade, isVisible, register, setButtonModel, setVisible
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
NewEmptyPlayListAction
public NewEmptyPlayListAction(BeaTunes beaTunes)
- Parameters:
beaTunes
- beatunes
-
-
Method Detail
-
loadResources
protected void loadResources()
Description copied from class:NewPlayListAction
Installs enabled/disabled listeners that turn the action on and off, depending on whether any songs are selected. The listeners are only installed, ifNewPlayListAction.isRequiresSelectedSongs()
returnstrue
. This method is called fromBaseAction.init()
, so you should callNewPlayListAction.setRequiresSelectedSongs(boolean)
from the constructor (or useNewPlayListAction(BeaTunes, boolean)
). Override this method, if you desire a different enable/disable behavior.- Overrides:
loadResources
in classNewPlayListAction
-
getId
public String getId()
Description copied from class:ApplicationAction
Returns a unique id for this action. Typically follows thex.y.z
notation from general to specific.- Specified by:
getId
in interfaceApplicationComponent<BeaTunes>
- Specified by:
getId
in classApplicationAction
- Returns:
- unique id for this action
-
getActionLocations
public ActionLocation[] getActionLocations()
Description copied from class:NewPlayListAction
By default installs this action in the File menu below the New Folder action and—ifNewPlayListAction.isRequiresSelectedSongs()
returnstrue
also in the context menu. If you require different locations, override this method.- Overrides:
getActionLocations
in classNewPlayListAction
- Returns:
- action locations
-
fillPlayList
public boolean fillPlayList(PlayList newPlayList, long[] selectedSongIds)
Description copied from class:NewPlayListAction
This method is called by the action as part of its
NewPlayListAction.actionPerformed(ActionEvent)
method. You are given an empty, new playlist and the ids of the currently selected songs, ifNewPlayListAction.isRequiresSelectedSongs()
istrue
. The idea is to add songs to the playlist using thePlayList.addSongIds(java.util.List)
method. If you don't just want to add any of the selected songs, useMediaLibrary
to find other songs you want to add to this playlist.You may also modify the playlist object itself, e.g. change the default name programmatically.
Note that you are not called from either the EDT or the default database thread, but an independent thread. This means, that you may block this thread indefinitely (of course you shouldn't though!). It also means, that from this thread you should invoke UI code using
SwingUtilities.invokeAndWait(Runnable)
.After this method returns, beaTunes adds the playlist to the
PlayListTree
, selects it, and allows the user to edit its name.- Specified by:
fillPlayList
in classNewPlayListAction
- Parameters:
newPlayList
- new, empty playlistselectedSongIds
- selected song ids or an empty array, ifNewPlayListAction.isRequiresSelectedSongs()
isfalse
- Returns:
true
on success,false
on cancel
-
-