public class EditorWidgetFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_DRAW_BORDER |
static String |
TEXT_BORDER |
protected org.eclipse.ui.forms.widgets.FormToolkit |
toolkit |
static String |
TREE_BORDER |
| Constructor and Description |
|---|
EditorWidgetFactory(org.eclipse.swt.widgets.Display display) |
EditorWidgetFactory(org.eclipse.ui.forms.FormColors colors) |
EditorWidgetFactory(org.eclipse.ui.forms.widgets.FormToolkit toolkit) |
| Modifier and Type | Method and Description |
|---|---|
void |
adapt(org.eclipse.swt.widgets.Composite composite)
Adapts a composite to be used in a form associated with this toolkit.
|
void |
adapt(org.eclipse.swt.widgets.Control control,
boolean trackFocus,
boolean trackKeyboard)
Adapts a control to be used in a form that is associated with this
toolkit.
|
org.eclipse.swt.widgets.Button |
createButton(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
Creates a button as a part of the form.
|
org.eclipse.swt.custom.CCombo |
createCCombo(org.eclipse.swt.widgets.Composite parent)
Creates a combo box as a part of the form.
|
org.eclipse.swt.custom.CCombo |
createCCombo(org.eclipse.swt.widgets.Composite parent,
int comboStyle)
Creates a combo box as a part of the form.
|
org.eclipse.swt.custom.CLabel |
createCLabel(org.eclipse.swt.widgets.Composite parent,
String text)
Creates a label as a part of the form.
|
org.eclipse.swt.custom.CLabel |
createCLabel(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
Creates a label as a part of the form.
|
org.eclipse.swt.widgets.Composite |
createComposite(org.eclipse.swt.widgets.Composite parent)
Creates the composite as a part of the form.
|
org.eclipse.swt.widgets.Composite |
createComposite(org.eclipse.swt.widgets.Composite parent,
int style)
Creates the composite as part of the form using the provided style.
|
org.eclipse.swt.widgets.Composite |
createCompositeSeparator(org.eclipse.swt.widgets.Composite parent)
Creats the composite that can server as a separator between various parts
of a form.
|
org.eclipse.ui.forms.widgets.ExpandableComposite |
createExpandableComposite(org.eclipse.swt.widgets.Composite parent,
int expansionStyle)
Creates an expandable composite as a part of the form.
|
org.eclipse.swt.widgets.Composite |
createFlatFormComposite(org.eclipse.swt.widgets.Composite parent)
Creates a flat form composite as a part of the form.
|
org.eclipse.ui.forms.widgets.Form |
createForm(org.eclipse.swt.widgets.Composite parent)
Creates a form widget in the provided parent.
|
org.eclipse.ui.forms.widgets.FormText |
createFormText(org.eclipse.swt.widgets.Composite parent,
boolean trackFocus)
Creates a rich text as a part of the form.
|
org.eclipse.swt.widgets.Group |
createGroup(org.eclipse.swt.widgets.Composite parent,
String text)
Creates a group as a part of the form.
|
org.eclipse.ui.forms.widgets.Hyperlink |
createHyperlink(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
Creates a hyperlink as a part of the form.
|
org.eclipse.ui.forms.widgets.ImageHyperlink |
createImageHyperlink(org.eclipse.swt.widgets.Composite parent,
int style)
Creates an image hyperlink as a part of the form.
|
org.eclipse.swt.widgets.Label |
createLabel(org.eclipse.swt.widgets.Composite parent,
String text)
Creates a label as a part of the form.
|
org.eclipse.swt.widgets.Label |
createLabel(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
Creates a label as a part of the form.
|
org.eclipse.swt.widgets.List |
createList(org.eclipse.swt.widgets.Composite parent,
int style)
Creates the list as a part of the form.
|
PageBook |
createPageBook(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a page book widget as a part of the form.
|
org.eclipse.swt.widgets.Composite |
createPlainComposite(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a plain composite as a part of the form.
|
org.eclipse.swt.custom.ScrolledComposite |
createScrolledComposite(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a scrolled composite as a part of the form.
|
org.eclipse.ui.forms.widgets.ScrolledForm |
createScrolledForm(org.eclipse.swt.widgets.Composite parent)
Creates a scrolled form widget in the provided parent.
|
org.eclipse.ui.forms.widgets.ScrolledPageBook |
createScrolledPageBook(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a scrolled page book widget as a part of the form.
|
org.eclipse.ui.forms.widgets.Section |
createSection(org.eclipse.swt.widgets.Composite parent,
int sectionStyle)
Creates a section as a part of the form.
|
org.eclipse.swt.widgets.Label |
createSeparator(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a separator label as a part of the form.
|
org.eclipse.swt.custom.CTabFolder |
createTabFolder(org.eclipse.swt.widgets.Composite parent,
int style)
Creates the tab folder as a part of the form.
|
org.eclipse.swt.custom.CTabItem |
createTabItem(org.eclipse.swt.custom.CTabFolder tabFolder,
int style)
Creates the tab item as a part of the tab folder.
|
org.eclipse.swt.widgets.Table |
createTable(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a table as a part of the form.
|
org.eclipse.swt.widgets.Text |
createText(org.eclipse.swt.widgets.Composite parent,
String value)
Creates a text as a part of the form.
|
org.eclipse.swt.widgets.Text |
createText(org.eclipse.swt.widgets.Composite parent,
String value,
int style)
Creates a text as a part of the form.
|
org.eclipse.swt.widgets.Tree |
createTree(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a tree widget as a part of the form.
|
void |
decorateFormHeading(org.eclipse.ui.forms.widgets.Form form)
Takes advantage of the gradients and other capabilities to decorate the
form heading using colors computed based on the current skin and
operating system.
|
void |
dispose() |
int |
getBorderMargin()
Returns the margin required around the children whose border is being
painted by the toolkit using
paintBordersFor(Composite). |
int |
getBorderStyle()
Returns the border style used for various widgets created by this
toolkit.
|
org.eclipse.ui.forms.FormColors |
getColors()
Returns the colors used by this toolkit.
|
org.eclipse.ui.forms.HyperlinkGroup |
getHyperlinkGroup()
Returns the hyperlink group that manages hyperlinks for this toolkit.
|
int |
getOrientation()
Returns the orientation that all the widgets created by this toolkit will
inherit, if set.
|
void |
paintBordersFor(org.eclipse.swt.widgets.Composite parent)
Paints flat borders for widgets created by this toolkit within the
provided parent.
|
void |
refreshHyperlinkColors()
Refreshes the hyperlink colors by loading from JFace settings.
|
void |
setBackground(org.eclipse.swt.graphics.Color bg)
Sets the background color for the entire toolkit.
|
void |
setBorderStyle(int style)
Sets the border style to be used when creating widgets.
|
void |
setOrientation(int orientation)
Sets the orientation that all the widgets created by this toolkit will
inherit.
|
public static final String KEY_DRAW_BORDER
public static final String TREE_BORDER
public static final String TEXT_BORDER
protected org.eclipse.ui.forms.widgets.FormToolkit toolkit
public EditorWidgetFactory(org.eclipse.swt.widgets.Display display)
public EditorWidgetFactory(org.eclipse.ui.forms.widgets.FormToolkit toolkit)
public EditorWidgetFactory(org.eclipse.ui.forms.FormColors colors)
public org.eclipse.swt.custom.CTabFolder createTabFolder(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the composite parent.style - the tab folder style.public org.eclipse.swt.custom.CTabItem createTabItem(org.eclipse.swt.custom.CTabFolder tabFolder,
int style)
tabFolder - the parent.style - the tab folder style.public org.eclipse.swt.widgets.List createList(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the composite parent.style - the list style.public org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the composite parentstyle - the composite stylepublic org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent)
parent - the composite parentpublic org.eclipse.swt.widgets.Composite createPlainComposite(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the composite parent.style - the composite style.public org.eclipse.swt.custom.ScrolledComposite createScrolledComposite(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the composite parent.style - the composite style.public org.eclipse.swt.custom.CCombo createCCombo(org.eclipse.swt.widgets.Composite parent,
int comboStyle)
parent - the combo box parent.comboStyle - the combo box style.public org.eclipse.swt.custom.CCombo createCCombo(org.eclipse.swt.widgets.Composite parent)
parent - the combo box parent.public org.eclipse.swt.widgets.Group createGroup(org.eclipse.swt.widgets.Composite parent,
String text)
parent - the group parent.text - the group title.public org.eclipse.swt.widgets.Composite createFlatFormComposite(org.eclipse.swt.widgets.Composite parent)
parent - the composite parent.public org.eclipse.swt.custom.CLabel createCLabel(org.eclipse.swt.widgets.Composite parent,
String text)
parent - the label parent.text - the label text.public org.eclipse.swt.custom.CLabel createCLabel(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
parent - the label parent.text - the label text.style - the label style.public PageBook createPageBook(org.eclipse.swt.widgets.Composite parent, int style)
parent - the page book parentstyle - the text stylepublic void dispose()
public org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
parent - the button parenttext - an optional text for the button (can be null)style - the button style (for example, SWT.PUSH)public org.eclipse.swt.widgets.Composite createCompositeSeparator(org.eclipse.swt.widgets.Composite parent)
parent - the separator parentpublic org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
String text)
parent - the label parenttext - the label textpublic org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
parent - the label parenttext - the label textstyle - the label stylepublic org.eclipse.ui.forms.widgets.Hyperlink createHyperlink(org.eclipse.swt.widgets.Composite parent,
String text,
int style)
parent - the hyperlink parenttext - the text of the hyperlinkstyle - the hyperlink stylepublic org.eclipse.ui.forms.widgets.ImageHyperlink createImageHyperlink(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the hyperlink parentstyle - the hyperlink stylepublic org.eclipse.ui.forms.widgets.FormText createFormText(org.eclipse.swt.widgets.Composite parent,
boolean trackFocus)
parent - the rich text parenttrackFocus - if true, the toolkit will monitor focus transfers
to ensure that the hyperlink in focus is visible in the form.public void adapt(org.eclipse.swt.widgets.Control control,
boolean trackFocus,
boolean trackKeyboard)
control - a control to adapttrackFocus - if true, form will be scrolled horizontally
and/or vertically if needed to ensure that the control is
visible when it gains focus. Set it to false if
the control is not capable of gaining focus.trackKeyboard - if true, the control that is capable of gaining
focus will be tracked for certain keys that are important to
the underlying form (for example, PageUp, PageDown, ScrollUp,
ScrollDown etc.). Set it to false if the control
is not capable of gaining focus or these particular key event
are already used by the control.public void adapt(org.eclipse.swt.widgets.Composite composite)
composite - the composite to adaptpublic org.eclipse.ui.forms.widgets.Section createSection(org.eclipse.swt.widgets.Composite parent,
int sectionStyle)
parent - the section parentsectionStyle - the section stylepublic org.eclipse.ui.forms.widgets.ExpandableComposite createExpandableComposite(org.eclipse.swt.widgets.Composite parent,
int expansionStyle)
parent - the expandable composite parentexpansionStyle - the expandable composite stylepublic org.eclipse.swt.widgets.Label createSeparator(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the separator parentstyle - the separator stylepublic org.eclipse.swt.widgets.Table createTable(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the table parentstyle - the table stylepublic org.eclipse.swt.widgets.Text createText(org.eclipse.swt.widgets.Composite parent,
String value)
parent - the text parentvalue - the text initial valuepublic org.eclipse.swt.widgets.Text createText(org.eclipse.swt.widgets.Composite parent,
String value,
int style)
parent - the text parentvalue - the text initial valuestyle - the text stylepublic org.eclipse.swt.widgets.Tree createTree(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the tree parentstyle - the tree stylepublic org.eclipse.ui.forms.widgets.ScrolledForm createScrolledForm(org.eclipse.swt.widgets.Composite parent)
parent - the scrolled form parentcreateForm(org.eclipse.swt.widgets.Composite)public org.eclipse.ui.forms.widgets.Form createForm(org.eclipse.swt.widgets.Composite parent)
parent - the form parentcreateScrolledForm(org.eclipse.swt.widgets.Composite)public void decorateFormHeading(org.eclipse.ui.forms.widgets.Form form)
form - the form to decoratepublic org.eclipse.ui.forms.widgets.ScrolledPageBook createScrolledPageBook(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the page book parentstyle - the text stylepublic org.eclipse.ui.forms.HyperlinkGroup getHyperlinkGroup()
public void setBackground(org.eclipse.swt.graphics.Color bg)
bg - the new background colorpublic void refreshHyperlinkColors()
public void paintBordersFor(org.eclipse.swt.widgets.Composite parent)
Borders are painted for some controls that are selected by the toolkit by default. If a control needs a border but is not on its list, it is possible to force border in the following way:
widget.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
or
widget.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
parent - the parent that owns the children for which the border needs
to be painted.public org.eclipse.ui.forms.FormColors getColors()
public int getBorderStyle()
public int getBorderMargin()
paintBordersFor(Composite). Since
the border is painted around the controls on the parent, a number of
pixels needs to be reserved for this border. For windowing systems where
the native border is used, this margin is 0.public void setBorderStyle(int style)
style - SWT.BORDER or SWT.NULLgetBorderStyle()public int getOrientation()
SWT.NULL,
SWT.LEFT_TO_RIGHT and SWT.RIGHT_TO_LEFT.SWT.NULL if
not set. The default orientation is inherited from the Window
default orientation.Window.getDefaultOrientation()public void setOrientation(int orientation)
SWT.NULL, SWT.LEFT_TO_RIGHT and
SWT.RIGHT_TO_LEFT.orientation - style for this toolkit.Copyright © 2022 Fraunhofer IWU. All rights reserved.