com.evolution.player.ui.artwork
Class SongContextView

java.lang.Object
  extended by com.evolution.player.ui.artwork.SongContextView
Direct Known Subclasses:
AlbumCoverView

public abstract class SongContextView
extends java.lang.Object

An song context view can show any content inside a given composite. It is expected, that the context view shows context information about the current song, i.e. the corresponding album cover, band information, lyrics, concert information... See AlbumCoverView if you want to show the album cover for the current song.

A song context view can be contributed through the com.evolution.player.ui.artworkCoverView extension point defined in the com.evolution.player.ui project.

The following protocol is guaranteed to hold First call is initialize(IInitializationData) followed by a call to createContent(Composite). Both methods are only called once only called once.
Anytime activate() is called followed by any number of calls to setCurrentSong(MediaInfo) followed by a call to deactivate()

All methods are called in the UI thread.

Since:
0.4
See Also:
AlbumCoverView

Nested Class Summary
static interface SongContextView.IInitializationData
          A set of data which can be used to initialize this object.
 
Constructor Summary
SongContextView()
           
 
Method Summary
abstract  void activate()
          Activate that view.
abstract  Control createContent(Composite parent)
          Create the content of this view.
abstract  void deactivate()
          Deactivate this view.
abstract  Action[] getToolBarActions()
          All actions to show in the views tool bar.
abstract  void initialize(SongContextView.IInitializationData data)
          Initialize this view with the given data.
abstract  void setCurrentSong(MediaInfo info)
          Set the current song info.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SongContextView

public SongContextView()
Method Detail

initialize

public abstract void initialize(SongContextView.IInitializationData data)
Initialize this view with the given data. It's guaranteed that this method is called first and only once.

Parameters:
data - the data to use to initialize this object

createContent

public abstract Control createContent(Composite parent)
Create the content of this view. Add it to the given parent and return the content.

Parameters:
parent - the parent of the view
Returns:
the created control

activate

public abstract void activate()
Activate that view. Prepare for calls to setCurrentSong(MediaInfo) and deactivate()


setCurrentSong

public abstract void setCurrentSong(MediaInfo info)
Set the current song info.

Parameters:
info - the info about the current song

deactivate

public abstract void deactivate()
Deactivate this view.


getToolBarActions

public abstract Action[] getToolBarActions()
All actions to show in the views tool bar.

Returns:
the actions for this view