Programme SAP SAPTLIST_TREE_MODEL_DEMO - Example: List Tree Model (with Documentation)

Description
This program demonstrates the use of the List Tree Model (classCL_LIST_TREE_MODEL).
The contents of a List Tree Model are displayed using a List TreeControl.
The example shows some important attributes of the List Tree Control,which are explained here with reference to the program:

  • "Objects" item: This item is displayed using a proportional font. Using
  • a proportional font for an item only makes sense if the width of theitem is automatically fitted to the text string (so that the textalways fits within the space provided). To ensure this, the ALIGNMENTfield for the item must contain the valueCL_LIST_TREE_MODEL=>ALIGNMENT_AUTO.
    • The items in the third and fourth nodes form a table. To do tihs, the
    • first three items in both nodes must have the same length(ITEM-ALIGNMENT = CL_LIST_TREE_MODEL=>ALIGN_LEFT, ITEM-LENGTH = ...)You must then use a fixed font for these items (ITEM-FONT =CL_LIST_TREE_MODEL=>ITEM_FONT_FIXED).

      Selection
      The items of a node can be selected individually. By clicking on thefolder or leaf symbol of a node, you select the entire node.
      You can also set up the tree so that clicking on any part of a nodealways selects the entire node (by setting the ITEM_SELECTION parameterof the constructor to ' ').

      Events
      Events, as they occur, are displayed in the group box at the right-handside of the screen. You can trigger the following events in theprogram:

      NODE_DOUBLE_CLICK
      Double-click on a node. In the example, you must double-click thefolder or leaf symbol to do this. If you set ITEM_SELECTION to SPACE,the event is triggered when you double-click any part of the node.

      ITEM_DOUBLE_CLICK
      Double-click on an item in the tree. This event can only occur ifITEM_SELECTION = 'X'.