Navigator items can easily be added. Behavior of editor and other parts can directly be changed from the navigator.
In this example, an item is added which provides a way to launch an List/Detail editor with a query of all customers of USA with new features.
Use modified query as shown in complete query page.
Add following XML lines where your want the new item to appear:
<item label="List/Detail customers of USA" image="#IMG(adi://org.adichatz.engine/./IMG_QUERY.png)" id="customerUSAQUERY"> <params> <param value="adi://myproject/./country" id="MESSAGE_BUNDLE"/> <param id="ICON_URI" value="platform:/plugin/org.adichatz.engine/resources/icons/IMG_QUERY.png"/> <param id="TITLE" value="List/Detail customers of USA"/> <param id="TOOL_TIP_TEXT" value="#MSG(adichatzGroupNavigator,customerQueryEditorToolTipText)"/> <param id="RESOURCE_BUNDLE" value="adi://myproject/./customer"/> <param xsi:type="listDetailContentProviderType" adiResourceURI="adi://myproject/model.customer/CustomerQUERY" id="CONTENT_PROVIDER" preferenceURI="preferenceName://usa"/> <param id="ADI_RESOURCE_URI" value="adi://org.adichatz.jpa/query/ListDetailQueryForm"/> <param id="TABLE_RESOURCE_URI" value="adi://myproject/model.customer/CustomerTI"/> <param id="DETAIL_RESOURCE_URI" value="adi://myproject/model.customer/CustomerDI"/> <param id="DUPLICATE_EDITOR" value="true"/> <param id="ADD_EDITOR_TOOLBAR" value="true"/> </params> <customizations> <tabular refreshAtStart="true" background="#COLOR(SWT.COLOR_TITLE_BACKGROUND_GRADIENT)" id="tableInclude:table"/> <sashForm id="ListDetailSashForm" orientation="SWT.HORIZONTAL" weights="3,1"/> <section id="detailInclude:detailContainer"> <listeners> <listener listenerTypes="BEFORE_SYNCHRONIZE" id="beforeSynchronize"> <code>reinitLayout(controller, true);</code> </listener> </listeners> </section> <composite id="detailInclude:fieldsComposite"> <layout layoutConstraints="wrap 4" columnConstraints="[align right]10[grow,fill]25[align right]10[grow,fill]"/> </composite> <action id="masterDetailTBM:changeOrientationAction"> <listeners> <listener listenerTypes="PRE_RUN" id="preRun"> <code>reinitLayout(controller, false);</code> </listener> </listeners> </action> <additionalCode>import org.adichatz.engine.controller.collection.SashFormController import org.adichatz.engine.controller.AWidgetController import org.eclipse.swt.SWT import org.adichatz.engine.controller.collection.SectionController import net.miginfocom.swt.MigLayout private void reinitLayout(AWidgetController controller, boolean inverse) { SashFormController sashFormController = (SashFormController) controller.getRootCore().getFromRegister("ListDetailSashForm"); SectionController sectionController = (SectionController) controller.getRootCore().getFromRegister("detailInclude:detailContainer"); if (null != sectionController.getControl()) { boolean horizontal = SWT.HORIZONTAL == sashFormController.getControl().getOrientation(); horizontal = inverse ? !horizontal : horizontal; if (horizontal) sectionController.getComposite().setLayout(new MigLayout("wrap 4", "[fill, align right]10[fill,grow]25[align right]10[fill,grow]")); else sectionController.getComposite().setLayout(new MigLayout("wrap 2", "[fill, align right]10[fill,grow]")); }}</additionalCode> </customizations> </item>
Remark:
The query 'adi://myproject/model.customer/CustomerQUERY' must contains all needed jointures (as address, address.city…) as shown in page complete query.
Explanations:
Lines 3-13: Lists needed parameters for launching the List/Detail part:
Lines 16-50: Defines new behavior on ui components: