public class ControlFactory extends Object
| Constructor and Description |
|---|
ControlFactory() |
| Modifier and Type | Method and Description |
|---|---|
ButtonBar |
buttonBarInstance(org.eclipse.swt.widgets.Composite composite)
Returns a buttom bar component for use in a view.
|
org.eclipse.swt.widgets.Button |
buttonInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Returns button control
Instances of this class represent a selectable user interface object that
issues notification when pressed and released.
|
org.eclipse.swt.widgets.Combo |
comboInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Returns combo control
Instances of this class are controls that allow the user
to choose an item from a list of items, or optionally
enter a new value by typing it into an editable text
field.
|
org.eclipse.swt.widgets.Composite |
compositeInstance(org.eclipse.swt.widgets.Composite parent)
Returns a control which is capable of containing other controls
|
int |
convertHeightInCharsToPixels(org.eclipse.swt.widgets.Composite parent,
int count)
Use font metrics to convert height is characters to pixels
|
int |
convertHorizontalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics,
int dlus)
Returns the number of pixels corresponding to the given number of horizontal dialog units.
|
int |
convertVerticalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics,
int dlus)
Returns the number of pixels corresponding to the given number of vertical dialog units.
|
<T extends CustomControls> |
customDialogInstance(org.eclipse.swt.widgets.Shell activeShell,
T customControls,
String title)
Returns custom dialog with content provided by given custom controls object
|
<T extends CustomControls> |
customDialogInstance(T customControls,
String title)
Returns custom dialog located in default shell with content provided by given custom controls object
|
org.eclipse.swt.custom.CLabel |
customLabelInstance(org.eclipse.swt.widgets.Composite composite,
CustomLabelSpec specification)
Returns a label control which supports aligned text and/or an image and different border styles.
|
org.eclipse.swt.widgets.FileDialog |
fileDialogInstance()
Returns a dialog to select a file.
|
DefaultGridData |
getDefaultGridData()
Returns wrapped default grid data factory.
|
DefaultLayout |
getDefaultLayout()
Returns wrapped default layout factory.
|
org.eclipse.swt.graphics.Font |
getDialogFont()
Returns the JFace's dialog font.
|
DialogPixels |
getDialogPixels(org.eclipse.swt.widgets.Composite parent)
Returns dialog parameters converted to pixels.
|
org.eclipse.swt.graphics.FontMetrics |
getFontMetrics(org.eclipse.swt.widgets.Composite parent)
Returns a FontMetrics which contains information about the font currently
being used by the receiver to draw and measure text.
|
org.eclipse.swt.widgets.Group |
groupInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Returns a Group control
Instances of this class provide an etched border with an optional title.
|
org.eclipse.swt.widgets.Label |
labelInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Returns label control
Instances of this class represent a non-selectable
user interface object that displays a string or image.
|
StatusItemLayoutData |
labelLayoutDataInstance(org.eclipse.swt.custom.CLabel label,
CustomLabelSpec specification)
Returns status item layout data - hint width and height
|
org.eclipse.swt.widgets.List |
listInstance(org.eclipse.swt.widgets.Composite parent,
int style)
Returns a List control.
|
org.eclipse.swt.widgets.Menu |
menuInstance(org.eclipse.swt.widgets.Control parent)
Returns a detached menu.
|
org.eclipse.swt.widgets.MenuItem |
menuItemInstance(org.eclipse.swt.widgets.Menu parent,
int style)
Returns a menu item.
|
org.eclipse.jface.dialogs.ProgressMonitorDialog |
progressMonitorDialogInstance()
Returns A modal dialog that displays progress during a long running operation.
|
org.eclipse.swt.widgets.Label |
separatorInstance(org.eclipse.swt.widgets.Composite composite)
Returns a label control for use as a separator
|
org.eclipse.swt.widgets.Text |
textInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Returns text control
Instances of this class are selectable user interface
objects that allow the user to enter and modify text.
|
org.eclipse.swt.widgets.ToolTip |
toolTipInstance(org.eclipse.swt.widgets.Composite parent)
Returns tool tip object bound to specified parent's shell
|
org.eclipse.jface.viewers.TreeViewer |
treeViewerInstance(org.eclipse.swt.widgets.Composite parent,
int style)
Return a tree viewer.
|
public <T extends CustomControls> CustomDialog<T> customDialogInstance(org.eclipse.swt.widgets.Shell activeShell, T customControls, String title)
activeShell - Currently active shell or null if default shell to be usedcustomControls - Custom controls of specified generic typetitle - Dialog titlepublic <T extends CustomControls> CustomDialog<T> customDialogInstance(T customControls, String title)
customControls - Custom controls of specified generic typetitle - Dialog titlepublic org.eclipse.jface.dialogs.ProgressMonitorDialog progressMonitorDialogInstance()
public org.eclipse.swt.widgets.Composite compositeInstance(org.eclipse.swt.widgets.Composite parent)
parent - Parent compositepublic org.eclipse.swt.widgets.Combo comboInstance(org.eclipse.swt.widgets.Composite composite,
int style)
Combos are used in the same place
where a single selection List widget could
be used but space is limited. A Combo takes
less space than a List widget and shows
similar information.
Note: Only one of the styles DROP_DOWN and SIMPLE may be specified.
composite - Parent compositestyle - Stylepublic org.eclipse.swt.widgets.Text textInstance(org.eclipse.swt.widgets.Composite composite,
int style)
composite - Parent compositestyle - Stylepublic org.eclipse.swt.widgets.Label labelInstance(org.eclipse.swt.widgets.Composite composite,
int style)
composite - Parent compositestyle - Stylepublic org.eclipse.swt.widgets.Label separatorInstance(org.eclipse.swt.widgets.Composite composite)
composite - Parent compositepublic org.eclipse.swt.widgets.Button buttonInstance(org.eclipse.swt.widgets.Composite composite,
int style)
composite - Parent compositestyle - Stylepublic ButtonBar buttonBarInstance(org.eclipse.swt.widgets.Composite composite)
composite - Parent compositepublic org.eclipse.swt.widgets.FileDialog fileDialogInstance()
public org.eclipse.swt.widgets.List listInstance(org.eclipse.swt.widgets.Composite parent,
int style)
parent - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructpublic org.eclipse.swt.widgets.Group groupInstance(org.eclipse.swt.widgets.Composite composite,
int style)
composite - Parent compositestyle - Stylepublic org.eclipse.swt.custom.CLabel customLabelInstance(org.eclipse.swt.widgets.Composite composite,
CustomLabelSpec specification)
If there is not enough space a CLabel uses the following strategy to fit the information into the available space:
ignores the indent in left align mode
ignores the image and the gap
shortens the text by replacing the center portion of the label with an ellipsis
shortens the text by removing the center portion of the label
composite - Parent compositespecification - Custom Label specificationpublic StatusItemLayoutData labelLayoutDataInstance(org.eclipse.swt.custom.CLabel label, CustomLabelSpec specification)
label - Status item Custom Labelspecification - Custom Label specificationpublic org.eclipse.swt.widgets.ToolTip toolTipInstance(org.eclipse.swt.widgets.Composite parent)
parent - Parent compositepublic org.eclipse.swt.widgets.Menu menuInstance(org.eclipse.swt.widgets.Control parent)
After constructing a menu, it can be set into its parent
using parent.setMenu(menu). In this case, the parent may
be any control in the same widget tree as the parent.
parent - A control which will be the parent of the new instance (cannot be null)public org.eclipse.swt.widgets.MenuItem menuItemInstance(org.eclipse.swt.widgets.Menu parent,
int style)
Menu) and a style value
describing its behavior and appearance. The item is added
to the end of the items maintained by its parent.
parent - a menu control which will be the parent of the new instance (cannot be null)style - the style of control to constructpublic org.eclipse.jface.viewers.TreeViewer treeViewerInstance(org.eclipse.swt.widgets.Composite parent,
int style)
parent - Parent controlstyle - SWT style bits used to create the tree.public org.eclipse.swt.graphics.Font getDialogFont()
public DialogPixels getDialogPixels(org.eclipse.swt.widgets.Composite parent)
parent - Parent compositepublic org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.widgets.Composite parent)
parent - Parent compositepublic DefaultLayout getDefaultLayout()
public DefaultGridData getDefaultGridData()
public int convertHorizontalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics,
int dlus)
fontMetrics - Used in performing the conversiondlus - The number of horizontal dialog unitspublic int convertVerticalDLUsToPixels(org.eclipse.swt.graphics.FontMetrics fontMetrics,
int dlus)
fontMetrics - Used in performing the conversiondlus - The number of horizontal dialog unitspublic int convertHeightInCharsToPixels(org.eclipse.swt.widgets.Composite parent,
int count)
parent - Compositecount - Character countCopyright © 2016. All rights reserved.