bibliothek.gui.dock.layout.location
Interface AsideRequest

All Known Implementing Classes:
DefaultAsideRequest

public interface AsideRequest

An AsideRequest represents the action of generating a DockableProperty that is "aside" another property, this includes modifying DockStations and layouts to store a placeholder for the new property.
One AsideRequest is always tied to exactly one DockStation or Combiner, forwarding a request to another DockStation will produce very strange results.

Author:
Benjamin Sigg

Field Summary
static PropertyKey<AsideRequestFactory> REQUEST_FACTORY
          Property key for getting the default AsideRequestFactory.
 
Method Summary
 void answer()
          Shortcut for calling answer(DockableProperty) with a value of null.
 void answer(DockableProperty location)
          Sets the result of this request, location will be merged with other results from the parent and children stations using the successor property.
 void answer(DockableProperty location, PlaceholderMap station)
          Sets the result of this request, and tells how the layout of a non-existent stations looks after the request has been handled.
 void answer(PlaceholderMap station)
          Tells this request how the layout of a non-existent station looks after the request has been handled.
 AsideAnswer execute(DockStation station)
          Executes this request calling the aside method of station.
 AsideAnswer forward(Combiner combiner)
          Calls the Combiner.aside(AsideRequest) method of combiner with the successor of the current location.
 AsideAnswer forward(Combiner combiner, PlaceholderMap layout)
          Calls the Combiner.aside(AsideRequest) method of combiner with the successor of the current location.
 AsideAnswer forward(DockStation station)
          Calls the DockStation.aside(AsideRequest) method of station with the successor of the current location.
 PlaceholderMap getLayout()
          Gets the layout of the current non-existent station.
 DockableProperty getLocation()
          Gets the old location, the location whose neighbor is searched.
 DockStation getParentStation()
          Gets the DockStation that is the parent of the current DockStation or Combiner.
 Path getPlaceholder()
          The placeholder that should be used for the new location.
 

Field Detail

REQUEST_FACTORY

static final PropertyKey<AsideRequestFactory> REQUEST_FACTORY
Property key for getting the default AsideRequestFactory.

Method Detail

execute

AsideAnswer execute(DockStation station)
Executes this request calling the aside method of station.

Parameters:
station - the station whose aside method is to be called
Returns:
a new location
Throws:
IllegalStateException - if this request is already executed

getLocation

DockableProperty getLocation()
Gets the old location, the location whose neighbor is searched. The property may have a successor.

Returns:
the old location, can be null

getPlaceholder

Path getPlaceholder()
The placeholder that should be used for the new location.

Returns:
the placeholder, may be null

getLayout

PlaceholderMap getLayout()
Gets the layout of the current non-existent station. The layout is only set in situations where no DockStation is available, and it is only set if it is known.

Returns:
the layout as it was created by DockStation.getPlaceholders(), null if not known or not necessary

getParentStation

DockStation getParentStation()
Gets the DockStation that is the parent of the current DockStation or Combiner.

Returns:
the parent station, may be null either for a root station or if the recursion of Combiners is too high

answer

void answer()
Shortcut for calling answer(DockableProperty) with a value of null.


answer

void answer(DockableProperty location)
Sets the result of this request, location will be merged with other results from the parent and children stations using the successor property. If location already has a successor, then the successor of the last DockableProperty in the chain may be modified by this method.
By not calling this method at all, clients can tell the action that no "neighbor" location was found, in this case the request will be cancled. Note how "not calling" and "calling with null" are two different things.

Parameters:
location - the location describing the "neighbor" of DockableProperty, a value of null indicates that the parent and child request should be merged directly

answer

void answer(PlaceholderMap station)
Tells this request how the layout of a non-existent station looks after the request has been handled. Calling this method with a value of null indicates that there will be no layout after the request finished. Not calling the method at all indicates that the current layout is not affected.
Note that calling this method does not change the result of getLayout().

Parameters:
station - the new layout, can be null

answer

void answer(DockableProperty location,
            PlaceholderMap station)
Sets the result of this request, and tells how the layout of a non-existent stations looks after the request has been handled. The arguments can be null, as described in answer(DockableProperty) and answer(PlaceholderMap).

Parameters:
location - the location describing the "neighbor" of DockableProperty, a value of null indicates that the parent and child request should be merged directly
station - the new layout, can be null

forward

AsideAnswer forward(DockStation station)
Calls the DockStation.aside(AsideRequest) method of station with the successor of the current location. The aside method is called in any case, even if the current location is null or has no successor.

Parameters:
station - the station on which to continue the request
Returns:
how station reacted to the request

forward

AsideAnswer forward(Combiner combiner)
Calls the Combiner.aside(AsideRequest) method of combiner with the successor of the current location. The aside method is called in any case, even if the current location is null or has no successor.

Parameters:
combiner - the non-existent station on which to continue the request
Returns:
how combiner reacted to the request

forward

AsideAnswer forward(Combiner combiner,
                    PlaceholderMap layout)
Calls the Combiner.aside(AsideRequest) method of combiner with the successor of the current location. The aside method is called in any case, even if the current location is null or has no successor.

Parameters:
combiner - the non-existent station on which to continue the request
layout - the layout of the non-existent station, as was created by DockStation.getPlaceholders(). Can be null in which case this method behaves like forward(Combiner)
Returns:
how combiner reacted to the request