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.
Difference between revisions of "Nebula TitledSeparator"
Line 13: | Line 13: | ||
The titled separator is composed of a text and optionally an image, initialized by the methods <code>setText()</code> and <code>setImage()</code>. | The titled separator is composed of a text and optionally an image, initialized by the methods <code>setText()</code> and <code>setImage()</code>. | ||
− | You can change the alignment of the text (left, center, right) by using the method <code>setAlignment(int value)</code> with the following values : SWT. | + | You can change the alignment of the text (left, center, right) by using the method <code>setAlignment(int value)</code> with the following values : '''SWT.RIGHT''', '''SWT.CENTER''' and '''SWT.LEFT'''. |
Finally, you can change the foreground color, the background color and the font by using the setters <code>setForeground()</code>, <code>setBackground()</code> and <code>setFont()</code>. | Finally, you can change the foreground color, the background color and the font by using the setters <code>setForeground()</code>, <code>setBackground()</code> and <code>setFont()</code>. | ||
Line 21: | Line 21: | ||
An example called TitledSeparatorSnippet.java is located in the plugin '''org.eclipse.nebula.widgets.opal.titledseparator.snippets'''. | An example called TitledSeparatorSnippet.java is located in the plugin '''org.eclipse.nebula.widgets.opal.titledseparator.snippets'''. | ||
− | This example is also available here : [https:// | + | This example is also available here : [https://github.com/eclipse/nebula/blob/master/widgets/opal/titledseparator/org.eclipse.nebula.widgets.opal.titledseparator.snippets/src/org/eclipse/nebula/widgets/opal/titledseparator/snippets/TitledSeparatorSnippet.java TitledSeparatorSnippet.java] |
Latest revision as of 07:57, 19 March 2020
Introduction
An enhanced separator, with a title and/or an image.
Contents
Usage
The titled separator is composed of a text and optionally an image, initialized by the methods setText()
and setImage()
.
You can change the alignment of the text (left, center, right) by using the method setAlignment(int value)
with the following values : SWT.RIGHT, SWT.CENTER and SWT.LEFT.
Finally, you can change the foreground color, the background color and the font by using the setters setForeground()
, setBackground()
and setFont()
.
Example
An example called TitledSeparatorSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.titledseparator.snippets.
This example is also available here : TitledSeparatorSnippet.java