When configured to use formatting XML, the control requires the root element form
to be used. The following tags can be children of the form
element:
Text in paragraphs and list items will be wrapped according to the width of the control. The following tags can appear as children of either p or li elements:
Image
set using 'setImage' method. Vertical position of image relative to surrounding text is optionally controlled by the attribute align that can have values top, middle and bottomtrue
to make the control fill the entire width of the text. Form text is not responsible for creating or disposing controls, it only places them relative to the surrounding text. Similar to img, vertical position of the control can be set using the align attribute. In addition, width and height attributes can be used to force the dimensions of the control. If not used, the preferred control size will be used. None of the elements can nest. For example, you cannot have b inside a span . This was done to keep everything simple and transparent. Since 3.1, an exception to this rule has been added to support nesting images and text inside the hyperlink tag (a). Image enclosed in the hyperlink tag acts as a hyperlink, can be clicked on and can accept and render selection focus. When both text and image is enclosed, selection and rendering will affect both as a single hyperlink.
Since 3.1, it is possible to select text. Text selection can be programmatically accessed and also copied to clipboard. Non-textual objects (images, controls etc.) in the selection range are ignored.
Care should be taken when using this control. Form text is not an HTML browser and should not be treated as such. If you need complex formatting capabilities, use Browser widget. If you need editing capabilities and font/color styles of text segments is all you need, use StyleText widget. Finally, if all you need is to wrap text, use SWT Label widget and create it with SWT.WRAP style. @see FormToolkit @see TableWrapLayout @since 3.0
|
|
|
|
|
|
|
|
|
|