Differences
This shows you the differences between two versions of the page.
tutorial:navigator [2020/04/28 17:33] |
tutorial:navigator [2020/04/28 17:33] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Navigators ===== | ||
+ | <WRAP adihi> | ||
+ | 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. | ||
+ | </WRAP> | ||
+ | |||
+ | === Step 1: Add a 'Group list Navigator' scenario === | ||
+ | <columns 100% l 350px middle> | ||
+ | * Open **Scenario.xml** file with <wrap adi>Scenario Editor</wrap>. | ||
+ | * Select <wrap adicode>Generation</wrap> page. | ||
+ | * Right-click on <wrap adi>GenerationScenario</wrap> line and select <wrap adi>add 'Navigator' generation unit</wrap> item. | ||
+ | <newcolumn center> | ||
+ | {{ tutorial:navigator_add_to_scenario.png?400 | Add 'Navigator' item to scenario file}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | <columns 100% l 400px> | ||
+ | In the <wrap adi>outline page</wrap>: | ||
+ | * Enter <wrap adicode>org.adichatz.scenario.impl.GroupListNavigatorScenario</wrap> to <wrap adicode>scenarioName</wrap> field. | ||
+ | * Enter <wrap adicode><nowiki>adi://myproject/groupListNavigator/GroupListNavigatorContent</nowiki></wrap> to <wrap adicode>adiResourceURI</wrap> field. | ||
+ | <newcolumn center> | ||
+ | {{ tutorial:navigator_define_group_list.png?600 | Add 'Navigator' item to scenario file}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | <columns 100% l 400px> | ||
+ | In the <wrap adi>Scenartio Editor</wrap>: | ||
+ | * {{tutorial:img_save.png?24 | Generate scenario}} Select <wrap adicode>Save</wrap> at top of editor. | ||
+ | * Check <wrap adicode>Generation unit: GroupListNavigatorContent - NAVIGATOR</wrap> row. | ||
+ | * {{tutorial:img_generate_scenario.png?24| Generate scenario}} Select <wrap adicode>Generate scenario</wrap> at top right of the editor. | ||
+ | <newcolumn center> | ||
+ | {{ tutorial:navigator_generate_group_list.png?600 | Add 'Navigator' item to scenario file}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | === Step 2: Check navigator is added in 'AdichatzRcpConfig.xml' file === | ||
+ | <sxh xml; first-line: 1; highlight: [12,13,14,15]; title: '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="groupListNavigator" 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.groupList.navigator" messageBundleURI="adi://myproject/./adichatzGroupListNavigator"> | ||
+ | <menuPath adiResourceURI="adi://myproject/groupListNavigator/GroupListNavigatorContent"/> | ||
+ | <menuPath adiResourceURI="adi://org.adichatz.jpa/./JpaMenu"/> | ||
+ | </navigator> | ||
+ | <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> | ||
+ | </navigators> | ||
+ | </rcpConfiguration> | ||
+ | </adichatzRcpConfigTree> | ||
+ | </sxh> | ||
+ | <WRAP indic> | ||
+ | **Remark**:\\ | ||
+ | Lines <wrap adicode>12</wrap>, <wrap adicode>13</wrap>, <wrap adicode>14</wrap> and <wrap adicode>15</wrap> are added. It defines a new Navigator built from a <wrap adi>GroupListNavigatorScenario</wrap> scenario. | ||
+ | </WRAP> | ||
+ | \\ \\ | ||
+ | === Step 3: Execute application === | ||
+ | |||
+ | No change is 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.\\ | ||
+ | <columns 100% l 400px> | ||
+ | To get around this problem: | ||
+ | * Select <wrap adicode>Run</wrap> / <wrap adicode>Run Configuration...</wrap> in IDE menu. | ||
+ | * Check <wrap adicode>Clear</wrap>. | ||
+ | * Run Application. | ||
+ | <newcolumn middle> | ||
+ | {{tutorial:run_configuration_clear.png?400 | Clear workspace before launching application}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | <columns 100% l 100px> | ||
+ | {{tutorial:group_navigators.png?350 |Navigators}} | ||
+ | <newcolumn lt> | ||
+ | |||
+ | In this case, you have 2 navigators: '<wrap adicode>Group List Navigator</wrap>' and '<wrap adicode>Navigator</wrap>'. | ||
+ | \\ \\ | ||
+ | <WRAP indic> | ||
+ | Menus can also be added programmatically to navigators as shown in methods <wrap adicode>org.adichatz.tool.ToolActivator.start(BundleContext)</wrap> or <wrap adicode>org.adichatz.testing.TestingActivator.start(BundleContext)</wrap>. | ||
+ | </WRAP> | ||
+ | </columns> | ||