Navigators parts are layout in the rigth panel of the application.

You may have several navigators and, in one navigator, nodes may come from different plugins.

Step 1: Add a 'Tree Navigator' scenario

  • Open Scenario.xml file with Scenario Editor.
  • Select Generation page.
  • Right-click on GenerationScenario line and select add 'Navigator' generation unit item.

 Add 'Navigator' item to scenario file



In the outline page:

  • Enter org.adichatz.scenario.impl.TreeNavigatorScenario to scenarioName field.
  • Enter adi://myproject/treeNavigator/TreeNavigatorContent to adiResourceURI field.

 Add 'Navigator' item to scenario file



In the Scenartio Editor:

  •  Generate scenario Select Save at top of editor.
  • Check Generation unit: TreeNavigatorContent - NAVIGATOR row.
  •  Generate scenario Select Generate scenario at top right of the editor.

 Add 'Navigator' item to scenario file



Step 2: Check navigator is added in 'AdichatzRcpConfig.xml' file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<adichatzRcpConfigTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adichatz.org/xsd/v0.9.1/engine/adichatzRcpConfigTree.xsd">
    <rcpConfiguration>
        <param id="defaultQueryMaxResults" value="200"/>
        <param id="introPartURI" value="bundleclass://org.adichatz.engine/org.adichatz.engine.intro.DefaultIntroPanel"/>
        <param id="introOutlineURI" value="bundleclass://org.adichatz.engine.e4/org.adichatz.engine.e4.resource.RecentOutlinePage"/>
        <param id="defaultRefTextPopupURI" value="bundleclass://org.adichatz.jpa/org.adichatz.jpa.gencode.common.DefaultRefText"/>
        <param id="runtime.resources.dir" value="D:/ADICHATZ/Eclipse/eclipse.photon.target/dropins/org.adichatz.template_0.9.1.201812041207/template/resources"/>
        <param id="adichatzAvoidedMessages" value="HHH000412, HHH000206"/>
        <param id="adichatzGMapAPIKey" value="YOUR_GMAP_API_KEY"/>
        <navigators>
            <navigator id="groupNavigator" iconURI="platform:/plugin/org.adichatz.engine.e4/resources/icons/IMG_NAVIGATOR.png" contributionURI="bundleclass://org.adichatz.engine.e4/org.adichatz.engine.e4.part.GroupNavigator" label="adichatz.group.navigator" messageBundleURI="adi://myproject/./adichatzGroupNavigator">
                <menuPath adiResourceURI="adi://myproject/groupNavigator/GroupNavigatorContent"/>
                <menuPath adiResourceURI="adi://org.adichatz.jpa/./JpaMenu"/>
            </navigator>
            <navigator id="treeNavigator" iconURI="platform:/plugin/org.adichatz.engine.e4/resources/icons/IMG_NAVIGATOR.png" contributionURI="bundleclass://org.adichatz.engine.e4/org.adichatz.engine.e4.part.TreeNavigator" label="adichatz.tree.navigator" messageBundleURI="adi://myproject/./adichatzTreeNavigator">
                <menuPath adiResourceURI="adi://myproject/treeNavigator/TreeNavigatorContent"/>
                <menuPath adiResourceURI="adi://org.adichatz.jpa/./JpaMenu"/>
            </navigator>
        </navigators>
    </rcpConfiguration>
</adichatzRcpConfigTree>

Remark:
Lines 16, 17, 18 and 20 are added. It defines a new Navigator built from a TreeNavigatorScenario scenario.



Step 3: Execute application

No change id visible if you launch directly application. In fact, parts layout is read from '${WORKSPACE]/runtime-myproject.product/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi' file.

To get around this problem:

  • Select Run / Run Configuration… in IDE menu.
  • Check Clear.
  • Run Application.

 Clear workapse before launching application



Navigators

In this case, you have 2 navigators: 'Navigator' and 'Tree explorer'.

Menus can also be added programmatically to navigators as shown in methods org.adichatz.tool.ToolActivator.start(BundleContext) or org.adichatz.testing.TestingActivator.start(BundleContext).