Differences
This shows you the differences between two versions of the page.
tutorial:navigator_tree [2020/04/16 10:56] |
tutorial:navigator_tree [2020/04/16 10:56] (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 'Tree 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> | ||
+ | {{ navigator_add_to_scenario.png?300 | 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.TreeNavigatorScenario</wrap> to <wrap adicode>scenarioName</wrap> field. | ||
+ | * Enter <wrap adicode><nowiki>adi://myproject/treeNavigator/TreeNavigatorContent</nowiki></wrap> to <wrap adicode>adiResourceURI</wrap> field. | ||
+ | <newcolumn center> | ||
+ | {{ navigator_define_tree.png?400 | Add 'Navigator' item to scenario file}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | <columns 100% l 400px> | ||
+ | In the <wrap adi>Scenartio Editor</wrap>: | ||
+ | * {{img_save.png | Generate scenario}} Select <wrap adicode>Save</wrap> at top of editor. | ||
+ | * Check <wrap adicode>Generation unit: TreeNavigatorContent - NAVIGATOR</wrap> row. | ||
+ | * {{img_generate_scenario.png| Generate scenario}} Select <wrap adicode>Generate scenario</wrap> at top right of the editor. | ||
+ | <newcolumn center> | ||
+ | {{ navigator_generate.png?400 | Add 'Navigator' item to scenario file}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | === Step 2: Check navigator is added in 'AdichatzRcpConfig.xml' file === | ||
+ | <sxh xml; first-line: 1; highlight: [16,17,18,20]; 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="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> | ||
+ | </sxh> | ||
+ | <WRAP indic> | ||
+ | **Remark**:\\ | ||
+ | Lines <wrap adicode>16</wrap>, <wrap adicode>17</wrap>, <wrap adicode>18</wrap> and <wrap adicode>20</wrap> are added. It defines a new Navigator built from a <wrap adi>TreeNavigatorScenario</wrap> scenario. | ||
+ | </WRAP> | ||
+ | \\ \\ | ||
+ | === 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.\\ | ||
+ | <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> | ||
+ | {{run_configuration_clear.png | Clear workapse before launching application}} | ||
+ | </columns> | ||
+ | \\ \\ | ||
+ | <columns 100% l 100px> | ||
+ | {{navigators.png |Navigators}} | ||
+ | <newcolumn lt> | ||
+ | |||
+ | In this case, you have 2 navigators: '<wrap adicode>Navigator</wrap>' and '<wrap adicode>Tree explorer</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> | ||