File $projectDirectory/resources/xml/model/film/FilmDescDIGENERATED.xml describes the layout of FilmDesc entity linked to a Film entity (OneToOne relationship)..

Following XML elements:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<includeTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance" coreClassName="org.adichatz.engine.core.ASectionCore" entityURI="adi:/entityURI="adi://myproject/model.filmDesc/FilmDescMM" xsi:noNamespaceSchemaLocation="http://www.adichatz.org/xsd/v0.8.7/generator/includeTree.xsd">
    <section text="#MSG(filmDesc, detailContainerText)" style="Section.TWISTIE | Section.TITLE_BAR | Section.EXPANDED" id="detailContainer">
        <listeners>
            <listener id="filmIELsnr" listenerTypes="BEFORE_ENTITY_INJECTION">
                <code>getComposite().setEnabled(null != getEntity());</code>
            </listener>
            <listener id="filmAELCLsnr" listenerTypes="AFTER_END_LIFE_CYCLE">
                <code>getComposite().setEnabled(null != getEntity());
getControl().setData(&quot;ONE_TO_ONE&quot;, #ENTITY_MM(adi://myproject/model.film/FilmMM).getFieldMap().get(&quot;filmDesc&quot;));</code>
            </listener>
        </listeners>
        <layout layoutConstraints="wrap 4" columnConstraints="[fill, align right]10[fill,grow]25[align right]10[fill,grow]"/>
        <include adiResourceURI="getToolBarURI((String) #PARAM(TOOL_BAR_TYPE))" id="detailToolbarMenu">
            <params>
                <param value="#CONTROLLER(detailContainer)" id="CONTROLLER"/>
                <param optional="true" value="#PARAM(TOOL_BAR_TYPE)" id="TOOL_BAR_TYPE"/>
            </params>
        </include>
        <formattedText editPattern="######" format="Short" property="filmId" enabled="false" id="filmId"/>
        <extraText addRefreshItem="true" property="description" id="description"/>
        <imageViewer toolBarStyle="AdiSWT.EXPANDABLE | AdiSWT.EDITABLE | AdiSWT.DELETE_BUTTON" imageType="Data" property="image" id="image"/>
        <dateText property="lastUpdate" style="SWT.BORDER | SWT.TIME | AdiSWT.DELETE_BUTTON" id="lastUpdate"/>
    </section>
</includeTree>

renders the following layout:
 FilmDescription detail (brute)


Change XML elements

  • Copy FilmDescDIGENERATED.axml file to FilmDescDI.axml which will become the reference for generated code.
  • Replace above XML lines with the following ones:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<includeTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" coreClassName="org.adichatz.engine.core.ASectionCore" entityURI="adi://myproject/model.filmDesc/FilmDescMM" xsi:noNamespaceSchemaLocation="http://www.adichatz.org/xsd/v0.8.7/generator/includeTree.xsd">
    <section text="#MSG(filmDesc, detailContainerText)" style="Section.TWISTIE | Section.TITLE_BAR | Section.EXPANDED" id="detailContainer">
        <listeners>
            <listener id="filmIELsnr" listenerTypes="BEFORE_ENTITY_INJECTION">
                <code>getComposite().setEnabled(null != getEntity());</code>
            </listener>
            <listener id="filmAELCLsnr" listenerTypes="AFTER_END_LIFE_CYCLE">
                <code>getComposite().setEnabled(null != getEntity());
getControl().setData(&quot;ONE_TO_ONE&quot;, #ENTITY_MM(adi://myproject/model.film/FilmMM).getFieldMap().get(&quot;filmDesc&quot;));</code>
            </listener>
        </listeners>
        <layout layoutConstraints="wrap 4" columnConstraints="[fill, align right]10[fill,grow]25[align right]10[fill,grow]"/>
        <include adiResourceURI="getToolBarURI((String) #PARAM(TOOL_BAR_TYPE))" id="detailToolbarMenu">
            <params>
                <param value="#CONTROLLER(detailContainer)" id="CONTROLLER"/>
                <param optional="true" value="#PARAM(TOOL_BAR_TYPE)" id="TOOL_BAR_TYPE"/>
            </params>
        </include>
        <formattedText editPattern="######" format="Short" property="filmId" enabled="false" id="filmId"/>
        <dateText property="lastUpdate" style="SWT.BORDER | SWT.TIME" enabled="false" id="lastUpdate"/>
        <composite layoutData="newline, grow, push, span 4" id="bottomComposite">
            <layout layoutConstraints="ins 0, wrap 2" columnConstraints="[fill,grow]15[fill,grow]" rowConstraints="[grow,fill, al top]"/>
            <extraText addRefreshItem="true" property="description" noLabel="true" layoutData="sg bottom, w 0:64:n" id="description"/>
            <imageViewer toolBarStyle="AdiSWT.DELETE_BUTTON | AdiSWT.EXPANDABLE | AdiSWT.EDITABLE" fitCanvas="true" imageType="Data" property="image" noLabel="true" layoutData="sg bottom, w 0:64:n" id="image"/>
        </composite>
    </section>
</includeTree>
renders the new layout:
 FilmDesc detail (improved)

Remark:
File FilmDescDIGENERATED.axml is copied as file FilmDescDI.axml, so that, if a generation process occurs, changes will not be affected.

  • Line 32: description property field is managed in a ExtraText controller.
  • Line 33: image property field is managed in a ImageViewer controller.