com.virtuosotechnologies.asaph.maingui
Interface SelectionManager


public interface SelectionManager

The selection manager API exported by the maingui plugin


Method Summary
 void addSelectionListener(SelectionListener listener)
          Add a SelectionListener to the main gui.
 SongDatabase getSelectedDatabase()
          Get the currently selected database.
 SongID[] getSelectedSongs()
          Get currently selected songs.
 void removeSelectionListener(SelectionListener listener)
          Remove a SelectionListener from the main gui.
 void selectDatabase(SongDatabase database)
          Select the specified database in the gui.
 

Method Detail

getSelectedDatabase

public SongDatabase getSelectedDatabase()
Get the currently selected database.

Returns:
a SongDatabase, or null for no selection

getSelectedSongs

public SongID[] getSelectedSongs()
Get currently selected songs.

Returns:
an array of SongIDs. Returns the empty array for no selection

selectDatabase

public void selectDatabase(SongDatabase database)
Select the specified database in the gui.

Parameters:
database - the database to select
Throws:
IllegalArgumentException - the given database is not open.

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Add a SelectionListener to the main gui. Note that it is added as a weak listener, so make sure it is strongly referenced elsewhere.

Parameters:
listener - SelectionListener

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Remove a SelectionListener from the main gui. Does nothing if the listener is not added.

Parameters:
listener - SelectionListener