Navigators
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
|
In the outline page:
|
In the Scenartio Editor:
|
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:
|
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). |