Class NewFolderAction
- 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.NewFolderAction
-
- All Implemented Interfaces:
ApplicationComponent<BeaTunes>,ActionListener,Serializable,Cloneable,EventListener,Action
public class NewFolderAction extends NewPlayListAction
Create a new folder.- 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 NewFolderAction(BeaTunes beaTunes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PlayListcreateEmptyPlayList()Create the empty (but persistent)PlayListobject.booleanfillPlayList(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()returnstruealso in the context menu.StringgetId()Returns a unique id for this action.voidinit()Initializes this action.-
Methods inherited from class com.tagtraum.beatunes.action.standard.NewPlayListAction
actionPerformed, isRequiresSelectedSongs, loadResources, setRequiresSelectedSongs
-
Methods inherited from class com.tagtraum.beatunes.action.BaseAction
bindListeners, bindListeners, getApplication, getFocusedPlayList, getFocusOwner, getMostRecentlyFocused, getPlayListTreeNode, getSelectedPlayList, getSelectedPlayListTreeNode, getSelectedSong, getSelectedSongCount, getSelectedSongIds, getSelectedSongs, getSelectedSongs, 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
-
NewFolderAction
public NewFolderAction(BeaTunes beaTunes)
- Parameters:
beaTunes- beatunes
-
-
Method Detail
-
getActionLocations
public ActionLocation[] getActionLocations()
Description copied from class:NewPlayListActionBy default installs this action in the File menu below the New Folder action and—ifNewPlayListAction.isRequiresSelectedSongs()returnstruealso in the context menu. If you require different locations, override this method.- Overrides:
getActionLocationsin classNewPlayListAction- Returns:
- action locations
-
init
public void init()
Description copied from class:BaseActionInitializes this action. This method is called byActionManager.init(), after all components are instantiated and set up. The default implementation is empty.- Specified by:
initin interfaceApplicationComponent<BeaTunes>- Overrides:
initin classBaseAction
-
getId
public String getId()
Description copied from class:ApplicationActionReturns a unique id for this action. Typically follows thex.y.znotation from general to specific.- Specified by:
getIdin interfaceApplicationComponent<BeaTunes>- Specified by:
getIdin classApplicationAction- Returns:
- unique id for this action
-
fillPlayList
public boolean fillPlayList(PlayList newPlayList, long[] selectedSongIds)
Description copied from class:NewPlayListActionThis 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, useMediaLibraryto 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:
fillPlayListin classNewPlayListAction- Parameters:
newPlayList- new, empty playlistselectedSongIds- selected song ids or an empty array, ifNewPlayListAction.isRequiresSelectedSongs()isfalse- Returns:
trueon success,falseon cancel
-
createEmptyPlayList
protected PlayList createEmptyPlayList()
Description copied from class:NewPlayListActionCreate the empty (but persistent)PlayListobject. If you want to create another kind of object (e.g. a folder) or an object somewhere else in the playlist hierarchy, override this method.- Overrides:
createEmptyPlayListin classNewPlayListAction- Returns:
- playlist
-
-