Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Nebula/FloatingText
< Nebula
Revision as of 07:17, 24 December 2018 by Wim.jongman.remainsoftware.com (Talk | contribs) (Created page with "< Back to Nebula Main Page ==Introduction== File:FloatingText.gif A floating text widget that combines a label an a text in a composite and floats the label...")
Introduction
A floating text widget that combines a label an a text in a composite and floats the label above the text.
Contents
Usage
Instantiate a FloatingText
and then operate on the Text.
final FloatingText txt1 = new FloatingText(group, SWT.BORDER); txt1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); txt1.getText().setMessage("Floating text");
And voilà !
You can decorate the FloatingText in various ways, for example by adding a separator and playing with the colors:
final FloatingText txt11 = new FloatingText(group, SWT.BORDER | SWT.SEPARATOR); txt11.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); txt11.getText().setMessage("Text + Separator + Gray label"); txt11.getLabel().setForeground(txt11.getDisplay().getSystemColor(SWT.COLOR_GRAY));
Examples
We have snippets with more examples in the FloatingText Snippet Directory