flare.viur.widgets.tree

Module Contents

Classes

TreeItemWidget

TreeLeafWidget

TreeNodeWidget

TreeWidget

Base Widget that renders a tree.

BrowserLeafWidget

BrowserNodeWidget

BreadcrumbNodeWidget

TreeBrowserWidget

Base Widget that renders a tree.

class flare.viur.widgets.tree.TreeItemWidget(module, data, structure, widget, *args, **kwargs)

Bases: flare.html5.Li

setStyle()

Is used to define the appearance of the element.

additionalDropAreas()

Drag and Drop areas.

markDraggedElement()

Mark the current dragged Element.

unmarkDraggedElement()
onDragStart(event)
onDragEnd(event)
onDragOver(event)

Test wherever the current drag would mean.

“make it a child of us”, “insert before us” or “insert after us” and apply the correct classes.

onDragLeave(event)

Remove all drop indicating classes.

disableDragMarkers()
moveRequest(params)

Performs the move operation with the provided params.

onDrop(event)

We received a drop.

Test wherever its means “make it a child of us”, “insert before us” or “insert after us” and initiate the corresponding NetworkService requests.

EntryIcon()
toggleArrow()
buildDescription()

Creates the visual representation of our entry.

onClick(event)
onDblClick(event)
toggleExpand()

Toggle a Node and request if needed child elements.

class flare.viur.widgets.tree.TreeLeafWidget(module, data, structure, widget, *args, **kwargs)

Bases: TreeItemWidget

skelType = 'leaf'
setStyle()

Leaf have a different color.

toggleArrow()

Leafes cant be toggled.

EntryIcon()

Leafs have a different Icon.

moveRequest(params)

Performs the move operation with the provided params.

onDragOver(event)

Test wherever the current drag would mean.

“make it a child of us”, “insert before us” or “insert after us” and apply the correct classes.

class flare.viur.widgets.tree.TreeNodeWidget(module, data, structure, widget, *args, **kwargs)

Bases: TreeItemWidget

skelType = 'node'
class flare.viur.widgets.tree.TreeWidget(module, rootNode=None, node=None, context=None, *args, **kwargs)

Bases: flare.html5.Div

Base Widget that renders a tree.

nodeWidget
leafWidget
requestStructure()
receivedStructure(resp)
setSelector(callback, multi=True, allow=None)

Configures the widget as selector for a relationalBone and shows it.

selectorReturn()

Returns the current selection to the callback configured with setSelector.

onKeyDown(event)
onKeyUp(event)
getActions()

Returns a list of actions that are being set for the ActionBar. Override this to provide additional actions.

clearSelection()

Empties the current selection.

extendSelection(element)

Extends the current selection to element.

This is normally done by clicking or tabbing on an element.

activateSelection(element)

Activates the current selection or element.

An activation mostly is an action like selecting or editing an item. This is normally done by double-clicking an element.

requestChildren(element)
_showErrorMsg(req=None, code=None)

Removes all currently visible elements and displayes an error message

onDataChanged(module, *args, **kwargs)
onAttach()
onDetach()
itemForKey(key, elem=None)

Returns the HierarchyWidget displaying the entry with the given key. :param key: The key (id) of the item. :type key: str :returns: HierarchyItem

onSetDefaultRootNode(req)

We requested the list of rootNodes for that module and that request just finished. Parse the respone and set our rootNode to the first rootNode received.

setRootNode(rootNode, node=None)

Set the currently displayed hierarchy to ‘rootNode’. :param rootNode: Key of the rootNode which children we shall display :type rootNode: str

reloadData()

Reload the data were displaying.

loadNode(node, skelType=None, cursor=None, overrideParams=None)

Fetch the (direct) children of the given node. Once the list is received, append them to their parent node. :param node: Key of the node to fetch :type node: str

_onRequestSucceded(req)

The NetworkRequest for a (sub)node finished. Create a new HierarchyItem for each entry received and add them to our view

onDrop(event)

We got a drop event. Make that item a direct child of our rootNode

onDragOver(event)

Allow dropping children on the rootNode

getChildKey(widget)

Order by sortindex

static canHandle(moduleName, moduleInfo)
class flare.viur.widgets.tree.BrowserLeafWidget(module, data, structure, widget, *args, **kwargs)

Bases: TreeLeafWidget

setStyle()

Leaf have a different color.

class flare.viur.widgets.tree.BrowserNodeWidget(module, data, structure, widget, *args, **kwargs)

Bases: TreeNodeWidget

setStyle()

Is used to define the appearance of the element.

class flare.viur.widgets.tree.BreadcrumbNodeWidget(module, data, structure, widget, *args, **kwargs)

Bases: TreeNodeWidget

setStyle()

Is used to define the appearance of the element.

class flare.viur.widgets.tree.TreeBrowserWidget(module, rootNode=None, node=None, context=None, *args, **kwargs)

Bases: TreeWidget

Base Widget that renders a tree.

leafWidget
nodeWidget
reloadData()

Reload the data were displaying.

rebuildPath()

Rebuild the displayed path-list.

onPathRequestSucceded(req)

Rebuild the displayed path-list according to request data

activateSelection(element)

Activates the current selection or element.

An activation mostly is an action like selecting or editing an item. This is normally done by double-clicking an element.

static canHandle(module, moduleInfo)