bibliothek.gui.dock.station.screen
Class FullscreenActionSource

java.lang.Object
  extended by bibliothek.gui.dock.action.AbstractDockActionSource
      extended by bibliothek.gui.dock.station.screen.FullscreenActionSource
All Implemented Interfaces:
DockActionSource, Iterable<DockAction>

public abstract class FullscreenActionSource
extends AbstractDockActionSource

A DockActionSource that adds or removes a DockAction depending on the result of the ScreenDockFullscreenFilters that are currently registered at a ScreenDockStation.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
listeners
 
Constructor Summary
FullscreenActionSource(DockAction action, LocationHint hint)
          Creates a new source.
 
Method Summary
 void addDockActionSourceListener(DockActionSourceListener listener)
          Adds a listener to this source.
 DockAction getDockAction(int index)
          Gets the index'th DockAction of this source.
 int getDockActionCount()
          Gets the number of DockActions which are provided by this source.
 LocationHint getLocationHint()
          Gets a hint where to put this source in relation to other sources.
protected abstract  boolean isFullscreenEnabled()
          Tells whether the action should be shown or not.
 Iterator<DockAction> iterator()
           
protected abstract  void listen(boolean listening)
          Tells whether this DockActionSource has listeners or not.
 void removeDockActionSourceListener(DockActionSourceListener listener)
          Removes an earlier added listener.
 void update()
          Checks whether the action should be shown or not, and fires events if the value changed since the last update.
 
Methods inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
fireAdded, fireRemoved, hasListeners, indexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullscreenActionSource

public FullscreenActionSource(DockAction action,
                              LocationHint hint)
Creates a new source.

Parameters:
action - the action to show
hint - tells where to show this source
Method Detail

getLocationHint

public LocationHint getLocationHint()
Description copied from interface: DockActionSource
Gets a hint where to put this source in relation to other sources. Note that an ActionOffer can choose to ignore these hints, or interpret them in an unexpected way.

Returns:
the preferred location of this source

addDockActionSourceListener

public void addDockActionSourceListener(DockActionSourceListener listener)
Description copied from interface: DockActionSource
Adds a listener to this source. The DockActionSourceListener should be informed whenever some DockActions are added or removed from this source.

Specified by:
addDockActionSourceListener in interface DockActionSource
Overrides:
addDockActionSourceListener in class AbstractDockActionSource
Parameters:
listener - The listener

removeDockActionSourceListener

public void removeDockActionSourceListener(DockActionSourceListener listener)
Description copied from interface: DockActionSource
Removes an earlier added listener.

Specified by:
removeDockActionSourceListener in interface DockActionSource
Overrides:
removeDockActionSourceListener in class AbstractDockActionSource
Parameters:
listener - The listener to remove
See Also:
DockActionSource.addDockActionSourceListener(DockActionSourceListener)

update

public void update()
Checks whether the action should be shown or not, and fires events if the value changed since the last update.


getDockActionCount

public int getDockActionCount()
Description copied from interface: DockActionSource
Gets the number of DockActions which are provided by this source.

Returns:
The number of DockActions

getDockAction

public DockAction getDockAction(int index)
Description copied from interface: DockActionSource
Gets the index'th DockAction of this source.

Parameters:
index - The index of the action
Returns:
The DockAction

iterator

public Iterator<DockAction> iterator()

isFullscreenEnabled

protected abstract boolean isFullscreenEnabled()
Tells whether the action should be shown or not.

Returns:
true if the action should be shown

listen

protected abstract void listen(boolean listening)
Tells whether this DockActionSource has listeners or not.

Parameters:
listening - whether there are listeners or not