Difference between revisions of "Documentation/DevGuide/Extensions/Adding Nodes"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/Extensions/Adding Several Nodes
 
|NextPage=Documentation/DevGuide/Extensions/Adding Several Nodes
 
}}
 
}}
 +
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Extensions/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:Adding Nodes}}
 
{{DISPLAYTITLE:Adding Nodes}}
 
Apart from Leafs one can also define one's own Nodes. First we would like to define one simple Node along with a few Leafs:
 
Apart from Leafs one can also define one's own Nodes. First we would like to define one simple Node along with a few Leafs:
Line 39: Line 40:
 
  </source>
 
  </source>
  
{{Documentation/Tip|Nodes without any leaves are not displayed.}}
+
{{Tip|Nodes without any leaves are not displayed.}}
  
 
Because a Node is represented in the tree view with a string, it needs to provide a localized name the same as Leafs do. To do this we add under the property Label several localized values.
 
Because a Node is represented in the tree view with a string, it needs to provide a localized name the same as Leafs do. To do this we add under the property Label several localized values.
Line 47: Line 48:
 
The property AllModules needs to be set to true when one wants that the Node appears in the options dialog from all applications. Now, let me explain shortly the meaning of Module, because it will be important for the definition of Nodes. The options dialog opened from the '''Tools - Options...''' menu entry refers always to a particular Module, which depends on the current application. All Nodes can be assigned to one or multiple Modules. That is, a Node may be defined to appear only in the options dialog of the Writer and Calc application. How this is done will be explained later. However, often one wishes to have the Node displayed in every options dialog. To save the effort of assigning a Node to all existing Module|s separately, one can do this just once by setting the property of AllModules to true. This is also useful in the case where new Modules are added later, because these new Modules would not know about those Nodes.
 
The property AllModules needs to be set to true when one wants that the Node appears in the options dialog from all applications. Now, let me explain shortly the meaning of Module, because it will be important for the definition of Nodes. The options dialog opened from the '''Tools - Options...''' menu entry refers always to a particular Module, which depends on the current application. All Nodes can be assigned to one or multiple Modules. That is, a Node may be defined to appear only in the options dialog of the Writer and Calc application. How this is done will be explained later. However, often one wishes to have the Node displayed in every options dialog. To save the effort of assigning a Node to all existing Module|s separately, one can do this just once by setting the property of AllModules to true. This is also useful in the case where new Modules are added later, because these new Modules would not know about those Nodes.
  
{{Documentation/Tip|Only Nodes which are assigned to a Module are displayed. The assignment is done by adding a member to set Module/Nodes (this will be explained later) or by setting Node/AllModules to true. The latter assigns the Node to all Modules.}}
+
{{Tip|Only Nodes which are assigned to a Module are displayed. The assignment is done by adding a member to set Module/Nodes (this will be explained later) or by setting Node/AllModules to true. The latter assigns the Node to all Modules.}}
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Documentation/Developers Guide/Extensions]]
+
 
 +
[[Category:Documentation/Developer's Guide/Extensions]]

Latest revision as of 20:22, 14 July 2018



Apart from Leafs one can also define one's own Nodes. First we would like to define one simple Node along with a few Leafs:

  <node oor:name="Nodes">
    <node oor:name="org.openoffice.framework.desktop.test.deployment.options.nodes2.node 3" 
oor:op="fuse">
      <prop oor:name="Label">
        <value xml:lang="en-US">nodes2 node 3 en-US</value>
        <value xml:lang="de">nodes2 node 3 de</value>
      </prop>
      <prop oor:name="OptionsPage">
        <value>%origin%/dialogs/node3/page/node3.xdl</value>
      </prop>
      <prop oor:name="AllModules">
        <value>true</value>
      </prop>
      <node oor:name="Leaves">
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.nodes2.node 3.leaf 3"
oor:op="fuse">
          <!-- leaving out some properties for the sake of brevity --> 
        </node>
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.nodes2.node 3.leaf 1"
oor:op="fuse">
          <!-- leaving out some properties for the sake of brevity --> 
        </node>
        <node oor:name="org.openoffice.framework.desktop.test.deployment.options.nodes2.node 3.leaf 2"
oor:op="fuse">
          <!-- leaving out some properties for the sake of brevity --> 
        </node>
      </node>
    </node>
  </node>
Tip.png Nodes without any leaves are not displayed.


Because a Node is represented in the tree view with a string, it needs to provide a localized name the same as Leafs do. To do this we add under the property Label several localized values.

The property OptionsPage has the same meaning as the same property in Leaf. There is, however, the restriction that the options page must not take user input. Instead is should contain some explanatory words about the node.

The property AllModules needs to be set to true when one wants that the Node appears in the options dialog from all applications. Now, let me explain shortly the meaning of Module, because it will be important for the definition of Nodes. The options dialog opened from the Tools - Options... menu entry refers always to a particular Module, which depends on the current application. All Nodes can be assigned to one or multiple Modules. That is, a Node may be defined to appear only in the options dialog of the Writer and Calc application. How this is done will be explained later. However, often one wishes to have the Node displayed in every options dialog. To save the effort of assigning a Node to all existing Module|s separately, one can do this just once by setting the property of AllModules to true. This is also useful in the case where new Modules are added later, because these new Modules would not know about those Nodes.

Tip.png Only Nodes which are assigned to a Module are displayed. The assignment is done by adding a member to set Module/Nodes (this will be explained later) or by setting Node/AllModules to true. The latter assigns the Node to all Modules.


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages