Class GroupFactory
Group
. This offers several benefits over creating Group normal way:
- The same factory can be used many times to create several Group instances
- The setters on GroupFactory all return "this", allowing them to be chained
Label label = GroupFactory.newGroup(SWT.SHADOW_NONE)// .text("My Group") // .layoutData(gridData) // .create(parent);
The above example creates a Group with a text and style: SWT.SHADOW_NONE. Finally the group is created in "parent".
GroupFactory groupFactory = GroupFactory.newGroup(SWT.SHADOW_NONE); GroupFactory.text("Group 1").create(parent); GroupFactory.text("Group 2").create(parent); GroupFactory.text("Group 3").create(parent);
The above example creates three labels using the same instance of LabelFactory.
- Since:
- 3.24
-
Method Summary
Modifier and TypeMethodDescriptionstatic GroupFactory
newGroup
(int style) Creates a new GroupFactory with the given style.Sets the receiver's text, which is the string that will be displayed as the receiver's title, to the argument, which may not be null.Methods inherited from class org.eclipse.jface.widgets.AbstractCompositeFactory
layout
Methods inherited from class org.eclipse.jface.widgets.AbstractControlFactory
background, enabled, font, foreground, layoutData, orientation, supplyLayoutData, tooltip
Methods inherited from class org.eclipse.jface.widgets.AbstractWidgetFactory
addProperty, cast, create, data, data
-
Method Details
-
newGroup
Creates a new GroupFactory with the given style. Refer toGroup(Composite, int)
for possible styles.- Returns:
- a new GroupFactory instance
-
text
Sets the receiver's text, which is the string that will be displayed as the receiver's title, to the argument, which may not be null. The string may include the mnemonic character.Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. When the user presses a key sequence that matches the mnemonic, focus is assigned to the first child of the group. On most platforms, the mnemonic appears underlined but may be emphasised in a platform specific manner. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.
Note: If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.
- Parameters:
text
- the text- Returns:
- this
- See Also:
-