Private flag that is set to true after an update-request.
This is used by the layout algorithm to ensure that all subtrees updated properly, since some Phosphor containers will skip updating in certain cases.
The absolute size of this region. May be pre-defined, or calculated. May
be undefined until the first call to
DashboardLayoutRegion#sizeContentToFit()
The dataset for the widget's DOM node.
A signal emitted when the widget is disposed.
An immutable ID assigned to this layout region that is unique within it's dashboard
Test whether the widget's node is attached to the DOM.
Test whether the widget has been disposed.
Test whether the widget is explicitly hidden.
Test whether the widget is visible.
A widget is visible when it is attached to the DOM, is not explicitly hidden, and has no explicitly hidden ancestors.
Get the DOM node owned by the widget.
Set the parent of the widget.
Children are typically added to a widget by using a layout, which means user code will not normally set the parent widget directly.
The widget will be automatically removed from its old parent.
This is a no-op if there is no effective parent change.
The title object for the widget.
The title object is used by some container widgets when displaying the widget alongside some title, such as a tab panel or side bar.
Since not all widgets will use the title, it is created on demand.
The owner
property of the title is set to this widget.
The titlebar for this region.
An Observable that emits whenever this region becomes stale
Whether this region is currently focused by the MavenWorks framework
Whether this region has changes that it's parent hasn't acknowledged
This is used by the framework to track dirtiness and update reactively.
The Layout Manager that owns this region
A layout region that controls this region. For root regions and regions that are not attached, this returns null.
A layout region that controls this region. For root regions and regions that are not attached, this returns null.
A key-value dictionary of metadata that defines how this layout region should display itself
A key-value dictionary of metadata that defines how this layout region should display itself
An immutable ID assigned to this layout region that is unique within it's dashboard
A read-only array of this StackPanel's children.
Private method to mark a subtree in an update loop.
This is only intended for use by the DashboardLayout.
Private method to update skipped subtrees in an update loop.
This is only intended for use by the DashboardLayout.
Post an 'activate-request'
message to the widget.
This is a simple convenience method for posting the message.
Insert a new child at the "end" of this container.
The default implementation of this function calls insertChild() with the length of the children as 'i'.
The new child to insert into this container
Add a class name to the widget's DOM node.
The class name to add to the node.
If the class name is already added to the node, this is a no-op.
The class name must not contain whitespace.
Attach a new element to this region's chrome.
Region chroming is a way of attaching transient or parent-specific elements to the DOM, without interfering with the base class or the implementation of the region children.
To remove the chrome, simply #dispose()
it.
Region chroming is automatically cleared whenever the parentRegion changes.
Create an iterator over the widget's children.
A new iterator over the children of the widget.
The widget must have a populated layout in order to have children.
If a layout is not installed, the returned iterator will be empty.
Reset all attached properties for a region
Send a 'close-request'
message to the widget.
This is a simple convenience method for sending the message.
Test whether a widget is a descendant of this widget.
The descendant widget of interest.
true
if the widget is a descendant, false
otherwise.
Copy attached properties from one child to another
Create a drag shadow for one of this region's children.
The region that is being dragged
The X coordinate that the drag will start from
The Y coordinate that the drag will start from
A valid HTML node that will follow the mouse during the drag.
Traverse the parents of this and another region to find common ancestor.
Returns null if no common ancestor was found. This can happen if the other node is unattached (ie, a new node that hasn't yet been added).
Return all children of this subtree eligible for pruning
Post a 'fit-request'
message to the widget.
This is a simple convenience method for posting the message.
Focus this region.
Return the value of a layout region property.
This should fall back to default values if the property is undefined, and respect per-property logic (such as flexSize/fixedSize precedence)
The name of the layout property to retrieve
Test whether the widget's DOM node has the given class name.
The class name of interest.
true
if the node has the class, false
otherwise.
Insert a new child into this container at a particular index.
If the widget is already in this region's children, then the widget is moved instead. This matches the behavior of Phosphor panels.
This function also sets the parentRegion of the widget to this region.
The index to insert the child into
The child to insert
Installs a message tap on the content to listen for child-removed.
This tap is necessary for regions that use a custom layout algorithm, since the parent won't necessarily be notified when a Panel child is removed.
Synchronously arrange the children of this region.
The MavenWorks framework uses a slightly different layout algorithm than Phosphor layouts- MavenWorks is top-down and starts with root-level invariants (such as window size) and moves downwards. This allows many layout panels to use analytical, linear-time algorithms even when flexible boxes are considered.
The downside of this is that it requires some reinventing-of-the-wheel
as Phosphor doesn't map 1:1 with this approach. If a subclass has a
trivial setup (such as the Tab Panel), then this may just need to query
the size of the node and set CSS maxWidth/maxHeight before calling
this.content.fit()
.
This function must call DashboardLayoutRegion#sizeContentToFit()
on all
visible children of this region.
Invoke the message processing routine of the widget's layout.
The message to dispatch to the layout.
This is a no-op if the widget does not have a layout.
This will not typically be called directly by user code.
A handler that is called after this region has lost focus.
The default implementation is a no-op.
A message handler invoked on an 'after-detach'
message.
The default implementation of this handler is a no-op.
A handler that is called after this region has recieved focus.
The default implementation is a no-op.
A message handler invoked on an 'after-hide'
message.
The default implementation of this handler is a no-op.
A message handler invoked on an 'after-show'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'before-attach'
message.
The default implementation of this handler is a no-op.
A handler that is called before this region is about to lose focus.
The default implementation is a no-op.
A handler that is called before this region is about to recieve focus.
The default implementation is a no-op.
A message handler invoked on a 'before-hide'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'before-show'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'child-added'
message.
The default implementation of this handler is a no-op.
Handle that gets called when this region recieves a new child.
The child being added
Handle that gets called when a child is removed from this region.
A message handler invoked on a 'child-removed'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'fit-request'
message.
The default implementation of this handler is a no-op.
A message handler invoked on a 'resize'
message.
The default implementation of this handler is a no-op.
A message handler invoked on an 'update-request'
message.
The default implementation of this handler is a no-op.
Clean up this subtree by removing auto-generated empty regions.
This is a framework function and not meant to be called by user code. The MavenWorks framework will automatically manage the health of the layout, pruning when useful.
Whether a region is "prunable" or not is specified by the <a href="../interfaces/regionwithchildren.iprops.html#prunable">prunable</a>
layout property. For regions created with SurroundWith, this property is
true.
Remove a class name from the widget's DOM node.
The class name to remove from the node.
If the class name is not yet added to the node, this is a no-op.
The class name must not contain whitespace.
Set this region and all it's children as fresh.
Show or hide the widget according to a boolean value.
true
to hide the widget, or false
to show it.
This is a convenience method for hide()
and show()
.
Set a layout property and update this region as appropriate.
Mark this region as having changes that need to be synced with something
Examples of this include layout properties, which need to be saved to a model, and added/removed children, which need the dashboard to issue update requests.
Iterate through all the children of this region, depth-first.
Test whether the given widget flag is set.
This will not typically be called directly by user code.
Toggle a class name on the widget's DOM node.
The class name to toggle on the node.
Whether to force add the class (true
) or force
remove the class (false
). If not provided, the presence of
the class will be toggled from its current state.
true
if the class is now present, false
otherwise.
The class name must not contain whitespace.
Post an 'update-request'
message to the widget.
This is a simple convenience method for posting the message.
Generated using TypeDoc
A base class for layout regions that have children.
Notes
This class uses a Phosphor panel for managing the lifecycle of the children- subclassers should choose a subclass of Panel appropriate for their use-case. Panel is itself appropriate for subclasses with custom layout algorithms.