Interface DockableGrouping
- All Known Implementing Classes:
PlaceholderGrouping
public interface DockableGrouping
A
While the name of the interface implies that dockables should be grouped together, nothing prevents a client from writing an implementation that does the opposite, e.g. tries to distribute
The two most common events that may be interesting for a
DockableGrouping is an algorithm that rewrites the location of a Dockable,
allowing clients to group several dockables together.While the name of the interface implies that dockables should be grouped together, nothing prevents a client from writing an implementation that does the opposite, e.g. tries to distribute
Dockables.The two most common events that may be interesting for a
DockableGrouping, when a
the path of a dockable changes, and
when a dockable gains focus, are automatically forwarded to this interface.
Strategies that require more events, have to add the observers they need themselves to the right objects.- Author:
- Benjamin Sigg
-
Method Summary
Modifier and TypeMethodDescriptionvoidfocusGained(Dockable dockable) Called afterdockablehas gained the focus.getInitialMode(Dockable dockable) Tries to find out how to displaydockableinitially.getStoredLocation(Dockable dockable, CLocationMode mode, Location history) Called right after an old location ofdockableformodewas read.getValidatedLocation(Dockable dockable, CLocationMode mode, Location validatedHistory) Called right beforedockableis moved to a new location.voidhierarchyChanged(Dockable dockable) Always called afterdockablehas changed its location.
-
Method Details
-
getInitialMode
Tries to find out how to displaydockableinitially.- Parameters:
dockable- an invisible dockable that is about to be made visible, and that does not have a location defined.- Returns:
- the initial mode of
dockable, ornull
-
getStoredLocation
Called right after an old location ofdockableformodewas read. The method may change the location ofdockableby returning a newLocationobject.
If this method is called, thengetValidatedLocation(Dockable, CLocationMode, Location)will be called beforedockableactually is moved to a new location.- Parameters:
dockable- the dockable whose location is about to be changedmode- the target mode fordockablehistory- the old location ofdockable, may benull- Returns:
- either
history, or a newly created location. Alsonullis valid result. This method is allowed to return an invalid location, invalid locations however will be replaced with valid location.
-
getValidatedLocation
Called right beforedockableis moved to a new location.- Parameters:
dockable- theDockablewhose location is about to be changedmode- the target mode fordockablevalidatedHistory- a validated location. This may be the result ofgetStoredLocation(Dockable, CLocationMode, Location)if that result already was a valid location, or it may be a new location, may benull- Returns:
- either
validatedHistory, or a newly created location. Alsonullis a valid result. This method should return only valid locations, invalid locations will lead the framework to place the dockable at some default location
-
hierarchyChanged
Always called afterdockablehas changed its location. This method will be called for anyDockablethat changed its location, even ifgetStoredLocation(Dockable, CLocationMode, Location)orgetValidatedLocation(Dockable, CLocationMode, Location)was never called.
Note: this method acts as if aDockHierarchyListenerwould have been added todockable- Parameters:
dockable- aDockablethat has a new place
-
focusGained
Called afterdockablehas gained the focus.- Parameters:
dockable- the element that just gained the focus
-