Grouping of Leaves

From Apache OpenOffice Wiki
Jump to: navigation, search



When we add several Leafs to the same Node then we may wish to determine in which order they appear. This is done by using the properties GroupId and GroupIndex in Leaf. The GroupId is used to define a group. All Leafs with the same GroupId form this group. The GroupIndex determines the position of the Leaf with regard to this group. If there are multiple groups of Leafs assigned to the same Node, then it is undefined in which order the groups are displayed. However, the members of a group are always displayed contiguously .

The value for the GroupId must be unique. One can use the same patter here as for the names of Leafs, Nodes, etc.

One special GroupId is the one which has the same value as the Node name. This group is always displayed first under the node in the tree view. We will get to that later.

Usually, when an extension provides Leafs which are all assigned to the same Node, then one makes them belong to the same group.

Documentation caution.png Do not add to groups which you have not defined yourself. This may lead to clashing indices and is generally bad style.

Grouping Leafs is optional. But when one does it, then all Leafs should be part of a group.

  <node oor:name="Nodes">
    <node oor:name="Writer" oor:op="fuse">
      <node oor:name="Leaves">
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.3"
oor:op="fuse">
          <prop oor:name="Id">
            <value>org.openoffice/framework/desktop/test/deployment/options/leaves2</value>
          </prop>
          <!-- leaving out some properties for the sake of brevity -->
          <prop oor:name="GroupId">
            <value>org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.group</value>
          </prop>
          <prop oor:name="GroupIndex">
            <value>2</value>
          </prop>
        </node>
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.1"
oor:op="fuse">
          <prop oor:name="Id">
            <value>org.openoffice/framework/desktop/test/deployment/options/leaves2</value>
          </prop>
          <!-- leaving out some properties for the sake of brevity -->
          <prop oor:name="GroupId">
            <value>org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.group</value>
          </prop>
          <prop oor:name="GroupIndex">
            <value>0</value>
          </prop>
        </node>
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.2"
oor:op="fuse">
          <prop oor:name="Id">
            <value>org.openoffice/framework/desktop/test/deployment/options/leaves2</value>
          </prop>
          <!-- leaving out some properties for the sake of brevity --> 
          <prop oor:name="GroupId">
            <value>org.openoffice.framework.desktop.test.deployment.options.leaves2.Writer.group</value>
          </prop>
          <prop oor:name="GroupIndex">
            <value>1</value>
          </prop>
        </node>
      </node>
    </node> 
  </node>
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages