Class Index | File Index

Classes


Class orion.TreeModelIterator.TreeModelIterator

A tree model based iterator component.
Defined in: </shared/eclipse/e4/orion/I201404012230/bundles/org.eclipse.orion.client.ui/web/orion/treeModelIterator.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
orion.TreeModelIterator.TreeModelIterator(firstLevelChildren, options)
Creates a new tree iterator.
Method Summary
Method Attributes Method Name and Description
 
collapse(collapsedModel)
When the parent model containing the cursor is collapsed, the cursor has to be surfaced to the parent
 
Get current selected model by the iteration
 
Convenient method to see if last iterate action moved the cursor
 
iterate(forward, forceExpand)
scan a selection range
 
iterateOnTop(forward, roundTrip)
Iterate from the current cursor only on the top level children
 
Get previously selected model by the iteration
 
Reset cursor and previous cursor
 
scan(from, to)
Iterate from the current cursor
 
setCursor(the)
Set the cursor to the given model
 
setTree(the)
Set the the first level children
 
topLevel(modelItem)
Class Detail
orion.TreeModelIterator.TreeModelIterator(firstLevelChildren, options)
Creates a new tree iterator.
Parameters:
{list} firstLevelChildren
The first level children of the tree root, each item has children and parent property recursively.
{Object} options
The options object which provides iterate patterns and all call back functions when iteration happens.
Method Detail
collapse(collapsedModel)
When the parent model containing the cursor is collapsed, the cursor has to be surfaced to the parent
Parameters:
collapsedModel

cursor()
Get current selected model by the iteration

cursorMoved()
Convenient method to see if last iterate action moved the cursor

iterate(forward, forceExpand)
scan a selection range
Parameters:
{boolean} forward
the iteration direction. If true then iterate to next, otherwise previous.
{boolean} forceExpand
optional. the flag for the current cursor to dive into its children. If the cursor has no children yet or its children are not expanded, this method will call forceExpandFunc. If there is no forceExpandFunc defined it will not expand.

iterateOnTop(forward, roundTrip)
Iterate from the current cursor only on the top level children
Parameters:
{boolean} forward
the iteration direction. If true then iterate to next, otherwise previous.
{boolean} roundTrip
the round trip flag. If true then iterate to the beginning at bottom or end at beginning.

prevCursor()
Get previously selected model by the iteration

reset()
Reset cursor and previous cursor

{Array} scan(from, to)
Iterate from the current cursor
Parameters:
{object} from
the model object that the selection range starts from. Will be included in the return array.
{object} to
the model object that the selection range ends at. Will be included in the return array.
Returns:
{Array} The selection of models in the array.

setCursor(the)
Set the cursor to the given model
Parameters:
{Object} the
given model

setTree(the)
Set the the first level children
Parameters:
{list} the
first level children

topLevel(modelItem)
Parameters:
modelItem

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Apr 01 2014 22:58:24 GMT-0400 (EDT)