Controller for ExtraText

The ExtraController is build around a specific control created for Adichatz. This is a FieldController that means that it can be linked to the databinding service.

Control

The control org.adichatz.engine.widgets.extratext.ExtraText was developped by Adichatz based on Alonso Dominguez's work.
A ExtraText widget is a small editor widget managing bold, underline, hyperlink around a StyledText widget.

  • Add Bold, Italic, underline, strikethrough feature to character.
  • Cut, Copy, Paste.
  • Add Hyperlink (browser or mail access).
  • Buttons can be added after ExtraText is instantiated.
  • Creation of a ExtraText controller composition of the ExtraText widget.

ExtraText control

Usage:

Code

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<includeTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" entityURI="adi://myproject/model.filmText/FilmTextMM" XMLSchema-instance" coreClassName="org.adichatz.engine.core.ASectionCore" entityURI="adi:/generationType="DETAIL" xsi:noNamespaceSchemaLocation="http://www.adichatz.org/xsd/v0.8.4/generator/includeTree.xsd">
    <section text="#MSG(filmText, detailContainerText)" style="Section.TWISTIE | Section.TITLE_BAR | Section.EXPANDED" id="detailContainer">
        <listeners>
            <listener id="filmIELsnr" listenerTypes="INJECT_ENTITY">
                <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).getLazyFieldMap().get(&quot;filmText&quot;));</code>
            </listener>
        </listeners>
        <layout layoutConstraints="wrap 4" columnConstraints="[fill, align right]10[fill,grow]25[align right]10[fill,grow]"/>
		<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" noLabel="true" layoutData="sg bottom" property="description" id="description"/>
			<imageViewer noLabel="true" layoutData="sg bottom" toolBarStyle="AdiSWT.DELETE_BUTTON | AdiSWT.EXPANDABLE | AdiSWT.EDITABLE" fitCanvas="true" imageType="Data" property="image" id="image"/>
		</composite>
    </section>
</includeTree>

Overview

ExtraText - Store description field as String

Explanations
addRefreshItem=“true”:Add a refresh button to retrieve previous value when changes had occured.
layoutData=“sg bottom:description ExtraText control and image imageViewer control have same size.
noLabel:No label are affected to control description. By default, when a field control is linked to a model field (here property=“description”), a label control is automatically created.