public class DisplayerCollection extends Object implements Iterable<DockableDisplayer>
DockableDisplayer
s. Clients may
fetch
a new displayer at any time. They
should release
a displayer which
is no longer used. The collection ensures that various properties of the
displayers are set in the proper order.Constructor and Description |
---|
DisplayerCollection(DockStation station,
DefaultDisplayerFactoryValue factory,
String displayerId)
Creates a new collection
|
DisplayerCollection(DockStation station,
DisplayerFactory factory,
String displayerId)
Creates a new collection
|
Modifier and Type | Method and Description |
---|---|
void |
addDockableDisplayerListener(DockableDisplayerListener listener)
Adds
listener to all DockableDisplayer s that are
in this collection. |
DockableDisplayer |
fetch(Dockable dockable,
DockTitle title)
Creates a new
DockableDisplayer using the factory
of this collection. |
boolean |
isDisplayerComponent(Component component)
Tells whether
component is the root component of any DockableDisplayer . |
Iterator<DockableDisplayer> |
iterator() |
void |
release(DockableDisplayer displayer)
Releases a displayer that was created by this collection.
|
void |
removeDockableDisplayerListener(DockableDisplayerListener listener)
Removes
listener from all DockableDisplayer s
that are in this collection. |
void |
setController(DockController controller)
Sets the current
DockController , that controller will be made
known to all DockableDisplayer created by this collection. |
void |
setFactory(DisplayerFactory factory)
Sets the factory that will create new
DockableDisplayer when
needed. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DisplayerCollection(DockStation station, DisplayerFactory factory, String displayerId)
station
- the station for which DockableDisplayer
will be createdfactory
- the factory that is initially used to create displayersdisplayerId
- an identifier depending on station
, this identifier is forwarded to
Extension
s allowing them an easy solution to filter uninteresting requestspublic DisplayerCollection(DockStation station, DefaultDisplayerFactoryValue factory, String displayerId)
station
- the station for which DockableDisplayer
s will be createdfactory
- the factory that is used create displayersdisplayerId
- an identifier depending on station
, this identifier is forwarded to
Extension
s allowing them an easy solution to filter uninteresting requestspublic void addDockableDisplayerListener(DockableDisplayerListener listener)
listener
to all DockableDisplayer
s that are
in this collection.listener
- a new listener, not null
public void removeDockableDisplayerListener(DockableDisplayerListener listener)
listener
from all DockableDisplayer
s
that are in this collection.listener
- the listener to removepublic boolean isDisplayerComponent(Component component)
component
is the root component of any DockableDisplayer
.component
- the component to searchtrue
if at least one DockableDisplayer.getComponent()
returns component
public Iterator<DockableDisplayer> iterator()
iterator
in interface Iterable<DockableDisplayer>
public DockableDisplayer fetch(Dockable dockable, DockTitle title)
DockableDisplayer
using the factory
of this collection. This method also sets the title
,
station
and the controller
property of
the displayer.released
dockable
- the Dockable which will be shown on the displayer.title
- the title which will be shown on the displayer, might be null
public void release(DockableDisplayer displayer)
displayer
- the displayer to releasepublic void setFactory(DisplayerFactory factory)
DockableDisplayer
when
needed.factory
- the new factory, not null
public void setController(DockController controller)
DockController
, that controller will be made
known to all DockableDisplayer
created by this collection.controller
- the new controller, can be null