class %ZEN.ComponentEx.outlineView
extends %ZEN.Component.component
This is a outline viewer / editor component.
This is a specialized type of tree control that allows the
user to view and edit data in outline format.
This class is used by utilities and is not intended for public use.
parameter NAMESPACE = "http://www.intersystems.com/zen";
This is the XML namespace for this component.
property childIndent
as %ZEN.Datatype.integer [ InitialExpression = 30 ];
Amount to indent (in pixels) for nested items in the outline.
property lineSpacing
as %ZEN.Datatype.integer [ InitialExpression = 10 ];
Vertical spacing (in pixels) between items in the outline.
property maxLevels
as %ZEN.Datatype.integer [ InitialExpression = 5 ];
Max depths of levels in the outline.
property ondeletenode
as %ZEN.Datatype.eventHandler;
ondeletenode event handler:
If defined, this event is fired when
a node is about to be deleted.
If the handler returns false, then the operation will be prevented.
This handler is passed:
'node' -- an object containing details about the node.
property ondrawnode
as %ZEN.Datatype.eventHandler;
ondrawnode event handler:
If defined, this event is fired when
a node in the tree is about to be drawn.
If this event handler returns a value, then it is used
as DHTML to render the node contents.
This handler is passed:
'node' -- an object containing details about the node.
'selected' -- true if this node is selected.
property oneditcomplete
as %ZEN.Datatype.eventHandler;
oneditcomplete event handler:
If defined, this event is fired when
the modal editor for a node within the outline is dismissed.
This handler is passed:
'node' -- an object containing details about the node.
property ongetdata
as %ZEN.Datatype.eventHandler;
ongetdata event handler:
This defines the client-side code that returns
an graph of javascript objects used to provide the contents
of the outline view.
property ongetnodechildren
as %ZEN.Datatype.eventHandler;
ongetnodechildren event handler:
If defined, this event is fired whenever
the component needs to find the array of children for
the given node. Typically this array is in a property
called children. Using this handler, you can change this behavior.
This handler is passed:
'node' -- an object containing details about the node.
property ongetnodeeditor
as %ZEN.Datatype.eventHandler;
ongetnodeeditor event handler:
If defined, this event is fired when
a node in the tree is about to be edited inline.
If this event handler returns a value, then it is used
as DHTML to render the node editor contents.
This handler is passed:
'node' -- an object containing details about the node.
property ongetnodestyle
as %ZEN.Datatype.eventHandler;
ongetnodestyle event handler:
If defined, this event is fired when
a node in the tree is about to be drawn.
If this event handler returns a value, then it is used
as the CSS style to apply to the node.
This handler is passed:
'node' -- an object containing details about the node.
'selected' -- true if this node is selected.
property onmovenode
as %ZEN.Datatype.eventHandler;
onmovenode event handler:
If defined, this event is fired when
a node is about to be moved (up, down, in, or out).
If the handler returns false, then the operation will be prevented.
This handler is passed:
'node' -- an object containing details about the node.
'which' -- indication of which direction the node will be
moved.
property onselectnode
as %ZEN.Datatype.eventHandler;
onselectnode event handler:
If defined, this event is fired when
a node is selected.
This handler is passed:
'node' -- an object containing details about the selected node
or null if no node is selected.
property selectedItem
as %ZEN.Datatype.integer(XMLPROJECTION="NONE",ZENSETTING=0) [ InitialExpression = -1 ];
Primary selected node within this view (if any).
If there are multiple selected items, this is the most recent selection.
property selectedItems
as list of %ZEN.Datatype.integer(XMLPROJECTION="NONE",ZENSETTING=0);
Set of currently selected nodes within this view.
property showVirtualNodes
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
If true, show an extra "virtual" node at the end of every indented
group. This used by the Rules editor to show default return values
for groups of rules.
method adjustChildren(node, level, hidden)
[ Language = javascript ]
Adjust the position of the given node and its children.
Return the total height used by the children.
method canIndentNode(nodeIndex)
[ Language = javascript ]
Test if a node can be indented.
If nodeIndex is provided, then test that node instead.
method canMoveNodeDown(nodeIndex)
[ Language = javascript ]
Test if a node can be moved down.
If nodeIndex is provided, then test that node instead.
method canMoveNodeUp(nodeIndex)
[ Language = javascript ]
Test if a node can be moved up.
If nodeIndex is provided, then test that node instead.
method canOutdentNode(nodeIndex)
[ Language = javascript ]
Test if a node can be outdented.
If nodeIndex is provided, then test that node instead.
method connectNodes(node)
[ Language = javascript ]
Connect any pointers in the node object to HTML elements
method contractNode(nodeIndex, flag)
[ Language = javascript ]
If flag is true, then contract the specified node by hiding its children
otherwise expand the node.
If nodeIndex is provided, then contract that node instead.
method dragStartHandler(dragData)
[ Language = javascript ]
Default drag handler for outline components.
method dropStartHandler(dragData)
[ Language = javascript ]
Default drop handler for outline components.
method editNode(nodeIndex)
[ Language = javascript ]
Invoke an inplace editor for the current node (if one is defined).
If nodeIndex is provided, then edit that node instead.
method expandNode(nodeIndex)
[ Language = javascript ]
Expand the specified node.
If nodeIndex is provided, then contract that node instead.
method getDropDownDiv()
[ Language = javascript ]
Find the div element used to display the dropdown list.
method getNode(nodeIndex)
[ Language = javascript ]
method getNodeChildren(node, create)
[ Language = javascript ]
Return the array of child nodes for a given node.
By default this is in a property called children
but it is possible to change this using a callback.
method getNodeContent(node, selected)
[ Language = javascript ]
Get the HTML content of the given node.
node is the node object.
selected is true for selected nodes.
method getNodeHTML(node, level)
[ Language = javascript ]
Get the HTML needed to render the given node.
method getNodeStyle(node, selected)
[ Language = javascript ]
Get the CSS style to apply to the given node.
node is the node object.
selected is true for selected nodes.
method getSelectedItem()
[ Language = javascript ]
Return the index of the current selected item within this view.
If no item is selected, return null. If more than one item
is selected, return the primary selection (last item selected).
method getSelectedItems()
[ Language = javascript ]
Return the set of currently selected items within this frame
as an array of node index numbers.
method getTreeGraph()
[ Language = javascript ]
Return the top client array variable used
to hold the client objects that describe the outline contents.
method getTreeHTML()
[ Language = javascript ]
Get the HTML needed to render the outline tree.
method indentNode(nodeIndex)
[ Language = javascript ]
Indent the current node one level.
If nodeIndex is provided, then move that node instead.
method isSelected(item)
[ Language = javascript ]
Test if given item (node index) is selected.
method moveNode(node, x, y)
[ Language = javascript ]
Move the specified node and related elements.
method moveNodeDown(nodeIndex)
[ Language = javascript ]
Move the current node down one slot in the tree.
If nodeIndex is provided, then move that node instead.
method moveNodeUp(nodeIndex)
[ Language = javascript ]
Move the current node up one slot in the tree.
If nodeIndex is provided, then move that node instead.
method nodeClickHandler(evt, nodeIndex)
[ Language = javascript ]
Node click handler.
method nodeMouseDownHandler(evt, nodeIndex)
[ Language = javascript ]
Node mouse down handler.
method nodeMouseHandler(evt, flag, nodeIndex)
[ Language = javascript ]
Highlight/unhighlight node (called by mouseover, mouseout events).
method onEndModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to stop being modal.
method onStartModalHandler(zindex)
[ Language = javascript ]
Notification that this component is about to become modal.
method outdentNode(nodeIndex)
[ Language = javascript ]
Move the current node up one level.
If nodeIndex is provided, then move that node instead.
method removeNode(nodeIndex)
[ Language = javascript ]
Remove (delete) the current node one level.
If nodeIndex is provided, then delete that node instead.
method renderContents()
[ Language = javascript ]
This method, if present, is called when this component
is placed on a client page.
This is used by components that render themselves using
client-side, dynamic content (i.e., instead of using the %DrawHTML method).
method selectItem(item, add)
[ Language = javascript ]
Select the specified item.
item must be the index of a node within this view.
If add is true, add (or remove if already selected)
the item to the set of selected items, otherwise select
only the item.
If item is null, unselect all items.
abstract method selectNodeHandler(node, add)
[ Language = javascript ]
Notification that an item has been selected.
This can be implemented by a subclass.
If this method is defined and returns false, the onselectnode
callback will not be fired.
method updateLayout()
[ Language = javascript ]
Update positions of elements within the outline.