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 Scenario Editor 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 editor.

 Add 'Navigator' item to scenario file



Step 2: Add navigator 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.8.1/engine/adichatzRcpConfigTree.xsd">
    <rcpConfiguration>
        <param id="defaultQueryMaxResults" value="200"/>
        <param id="defaultRefTextPopupURI" value="adi://org.adichatz.jpa/common/DefaultRefText"/>
        <param id="introPartURI" value="bundleclass://org.adichatz.engine/org.adichatz.engine.intro.DefaultIntroPanel"/>
        <param id="introOutlineURI" value="bundleclass://org.adichatz.jpa/org.adichatz.jpa.recent.RecentOutlinePage"/>
        <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.navigator" bundleURI="adi://org.adichatz.engine.e4/./adichatzEngineE4">
                <menuPath adiResourceURI="adi://myproject/groupNavigator/GroupNavigatorContent"/>
                <menuPath adiResourceURI="adi://org.adichatz.jpa/./JpaMenu"/>
            </navigator>
			<navigator id="treeNavigator" label="Tree explorer" iconURI="platform:/plugin/org.adichatz.engine.e4/resources/icons/IMG_NAVIGATOR.png" contributionURI="bundleclass://org.adichatz.engine.e4/org.adichatz.engine.e4.part.TreeNavigator">
                <menuPath adiResourceURI="adi://myproject/treeNavigator/TreeNavigatorContent"/>
                <menuPath adiResourceURI="adi://org.adichatz.jpa/./JpaMenu"/>
            </navigator>
        </navigators>
    </rcpConfiguration>
</adichatzRcpConfigTree>

Remark:
Lines 13, 13, 13 and 13 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 go 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).

tutorial/navigator.txt · Last modified: 2015/10/05 17:52 (external edit)