DockPolicy class
What may dock where. Two levels, one object.
The first level is the surface matrix: may this content be shown as a single panel, as a tab, or either? It is answered from PanelTab.forms and a policy rarely needs to override it. The second level is entirely the host's: it is handed both sides of a proposed move, metadata included, and answers with a bool — "tool panels only group with tool panels" is one line. A move the policy refuses is simply never offered as a candidate; a drag never has to fail.
One more question is answered here that is not about docking, because it
is the same kind of host knowledge: which leaves may be the window's
focused leaf — where open puts content, what the keyboard verbs act
on, whose strip shows the full accent. An IDE's tool panels never are:
clicking in the file tree must not make the tree where the next document
opens. takesFocus is that, and the base class says every leaf does.
The base class allows everything, so a host that wants no rules passes DockPolicy.permissive or nothing at all.
Constructors
- DockPolicy()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canJoin(
PanelTab moving, LeafNode target) → bool -
Level two. Whether
movingmay share a strip with the tabs oftarget. Every tab of a moved group is asked in turn. -
canSplit(
PanelTab moving, LayoutNode neighbour, DockSide side) → bool -
Level two. Whether
movingmay be placed onsideofneighbouras a leaf of its own. Rarely restricted; here for completeness of the matrix. -
canTakeForm(
PanelTab tab, SurfaceForm form) → bool -
Level one. Whether
tabmay be shown inform. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
takesFocus(
LeafNode leaf) → bool -
Whether
leafmay be the window's focused leaf. A leaf that does not is still drawn, still docks and still activates its tabs; it just never becomes whereopenputs content, and the accent stays on the leaf that is. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- permissive → const DockPolicy