Jump to: navigation, search

Scout/Concepts/TreeField


Scout
Wiki Home
Website
DownloadGit
Community
ForumsBlogTwitterG+
Bugzilla
Bugzilla


Field that is used to display a tree.

  • implements: I obj.pngITreeField
  • extends: C obj.pngAbstractTreeField

Description

A TreeField is used to display a tree. Unlike the TreeBox that is a value field working with a CodeType or a LookupCall and providing checkboxes to select values, the TreeField is low level: you need to handle your Tree directly.

The TreeField is also used internally: in an Outline based application, the tree of pages on the left is displayed in a TreeField.

Code Example

Scout provides additional classes (C obj.pngAbstractTreeNodeBuilder , C obj.pngAbstractTreeNode ) that might help you to instantiate your tree.

Here a code Snippet that constructs a tree given an array of LookupRows. The resulting field still differs from a TreeBox, because you have control of the tree and because this is not a value field.

public class TreeField extends AbstractTreeField {
 
  @Override
  protected void execInitField() throws ProcessingException {
    //Fetch the LookupRows:
    MyLookupCallcall = new MyLookupCall();
    LookupRow[] lookupRows = call.getDataByAll();
 
    //Build the Tree:
    ITree tree = getTree();
    P_TreeNodeBuilder builder = new P_TreeNodeBuilder();
    ITreeNode[] children = builder.createTreeNodes(lookupRows, ITreeNode.STATUS_NON_CHANGED, true);
    tree.addChildNodes(tree.getRootNode(), children);
  }
 
  @Order(10.0)
  public class Tree extends AbstractTree {
  }
 
  public class P_TreeNodeBuilder extends AbstractTreeNodeBuilder {
    @Override
    protected ITreeNode createEmptyTreeNode() throws ProcessingException {
      return new P_Node();
    }
  }
 
  public class P_Node extends AbstractTreeNode {
  }
}

Screenshot

Note.png
TODO
Add a description


Properties

Defined with getConfiguredXxxxxx() methods.

See also the Field page for the properties that all fields have in common.

Note.png
TODO
properties


Events

Defined with execXxxxxx() methods.

See also the Field page for the events that all fields have in common.

Note.png
TODO
Events


See Also