public abstract class DisplayerRequest extends ResourceRequest<DockableDisplayer>
DisplayerRequest
is an object that can create new DockableDisplayer
s by
calling several factories.Constructor and Description |
---|
DisplayerRequest(DockStation parent,
Dockable target,
DisplayerFactory defaultFactory,
java.lang.String displayerId)
Creates a new request.
|
Modifier and Type | Method and Description |
---|---|
void |
answer(DockableDisplayer displayer)
Sets the
DockableDisplayer which should be shown. |
protected void |
executeRequestList()
Asks all sources for a new resource, needs to stop as soon
as one source called
ResourceRequest.answer(Object) (this can be queried
with ResourceRequest.isAnswered() ). |
DockController |
getController()
Gets the controller in whose realm this request is issued.
|
DockStation |
getParent()
Gets the
DockStation which is going to show the DockableDisplayer . |
Dockable |
getTarget()
Gets the
Dockable which is going to be shown in the DockableDisplayer . |
DockTitle |
getTitle()
Gets the title that should be shown on the displayer.
|
void |
request(DockTitle title)
Creates a new
DockableDisplayer . |
void |
setController(DockController controller)
Sets the
DockController in whose realm this DisplayerRequest is used. |
protected void |
validate(DockableDisplayer resource)
Called by
ResourceRequest.answer(Object) , this method ensure that resource is a valid answer. |
answer, getAnswer, isAnswered, request, requestNull
public DisplayerRequest(DockStation parent, Dockable target, DisplayerFactory defaultFactory, java.lang.String displayerId)
parent
- the station which is going to show the DockableDisplayer
.target
- the element which is going to be shown in the displayerdefaultFactory
- the default factory, to be used if no other way was found to create the DockableDisplayer
displayerId
- a unique identifier that depends on the type of parent
, this identifier will be forwarded to
Extension
s allowing them an easy way to filter uninteresting DisplayerRequest
s, must not be null
public void setController(DockController controller)
DockController
in whose realm this DisplayerRequest
is used. The DockController
can
be used to load extensions.controller
- the controller, can be null
public DockController getController()
null
public void request(DockTitle title)
DockableDisplayer
.title
- the title that should be shown on the displayer, may be null
public Dockable getTarget()
Dockable
which is going to be shown in the DockableDisplayer
.null
public DockStation getParent()
DockStation
which is going to show the DockableDisplayer
.null
public DockTitle getTitle()
null
public void answer(DockableDisplayer displayer)
DockableDisplayer
which should be shown. A valid displayer must meet the following
conditions:
null
DockableDisplayer.getDockable()
must be getTarget()
answer
in class ResourceRequest<DockableDisplayer>
displayer
- the new resource or null
java.lang.IllegalStateException
- if ResourceRequest.request()
was not calledjava.lang.IllegalArgumentException
- if displayer
is null
protected void executeRequestList()
ResourceRequest
ResourceRequest.answer(Object)
(this can be queried
with ResourceRequest.isAnswered()
).executeRequestList
in class ResourceRequest<DockableDisplayer>
protected void validate(DockableDisplayer resource)
ResourceRequest
ResourceRequest.answer(Object)
, this method ensure that resource
is a valid answer. The method
throws an IllegalArgumentException
if not.validate
in class ResourceRequest<DockableDisplayer>
resource
- the resource to check