public class SWTUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SLIDER_MAX
Static settings.
|
Constructor and Description |
---|
SWTUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
center(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Monitor monitor)
Centers the shell on the given monitor.
|
static void |
center(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Shell parent)
Centers the given shell.
|
static void |
createDisabledImage(org.eclipse.swt.widgets.ToolItem item)
Registers an image for a tool item.
|
static org.eclipse.swt.layout.GridData |
createFillGridData()
Creates grid data.
|
static org.eclipse.swt.layout.GridData |
createFillHorizontallyGridData()
Creates grid data.
|
static org.eclipse.swt.layout.GridData |
createFillVerticallyGridData()
Creates grid data.
|
static void |
createGenericTooltip(org.eclipse.swt.widgets.Table table)
Creates a generic tooltip for the table
|
static org.eclipse.swt.layout.GridData |
createGridData()
Creates grid data.
|
static org.eclipse.swt.layout.GridLayout |
createGridLayout(int columns)
Creates a grid layout.
|
static org.eclipse.swt.layout.GridLayout |
createGridLayout(int columns,
boolean compact)
Creates a grid layout.
|
static void |
createHelpButton(Controller controller,
org.eclipse.swt.custom.CTabFolder tabFolder,
java.lang.String id)
Creates a help button in the given folder.
|
static org.eclipse.swt.layout.GridData |
createNoFillGridData()
Creates grid data.
|
static java.lang.Object |
createSpanColumnsAndFillGridData(int i)
Creates grid data.
|
static java.lang.Object |
createSpanColumnsGridData(int i)
Creates grid data.
|
static org.eclipse.swt.widgets.Table |
createTable(org.eclipse.swt.widgets.Composite parent,
int style)
Returns a table.
|
static de.linearbits.swt.table.DynamicTable |
createTableDynamic(org.eclipse.swt.widgets.Composite parent,
int style)
Returns a dynamic table.
|
static org.eclipse.jface.viewers.TableViewer |
createTableViewer(org.eclipse.swt.widgets.Composite container,
int style)
Returns a table viewer.
|
static org.eclipse.jface.viewers.CheckboxTableViewer |
createTableViewerCheckbox(org.eclipse.swt.widgets.Composite container,
int style)
Returns a checkbox table viewer.
|
static void |
disable(org.eclipse.swt.widgets.Composite elem)
Disables the composite and its children.
|
static void |
disable(org.eclipse.swt.widgets.Control elem)
Disables the control.
|
static int |
doubleToSlider(double min,
double max,
double value)
Converts the double value to a slider selection.
|
static void |
enable(org.eclipse.swt.widgets.Composite elem)
Enables the composite and its children.
|
static void |
enable(org.eclipse.swt.widgets.Control elem)
Enables the control.
|
static int |
intToSlider(int min,
int max,
int value)
Converts the integer value to a slider selection.
|
static boolean |
isMac()
Are we running on an OSX system
|
static double |
sliderToDouble(double min,
double max,
int value)
Converts the slider value to a double.
|
static int |
sliderToInt(int min,
int max,
int value)
Converts the slider value to an integer.
|
public static final int SLIDER_MAX
public static void center(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Monitor monitor)
shell
- monitor
- public static void center(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Shell parent)
shell
- parent
- public static void createDisabledImage(org.eclipse.swt.widgets.ToolItem item)
item
- image
- public static org.eclipse.swt.layout.GridData createFillGridData()
public static org.eclipse.swt.layout.GridData createFillHorizontallyGridData()
public static org.eclipse.swt.layout.GridData createFillVerticallyGridData()
public static void createGenericTooltip(org.eclipse.swt.widgets.Table table)
table
- public static org.eclipse.swt.layout.GridData createGridData()
public static org.eclipse.swt.layout.GridLayout createGridLayout(int columns)
columns
- public static org.eclipse.swt.layout.GridLayout createGridLayout(int columns, boolean compact)
columns
- compact
- public static void createHelpButton(Controller controller, org.eclipse.swt.custom.CTabFolder tabFolder, java.lang.String id)
controller
- tabFolder
- id
- public static org.eclipse.swt.layout.GridData createNoFillGridData()
public static java.lang.Object createSpanColumnsAndFillGridData(int i)
i
- public static java.lang.Object createSpanColumnsGridData(int i)
i
- public static org.eclipse.swt.widgets.Table createTable(org.eclipse.swt.widgets.Composite parent, int style)
parent
- style
- public static de.linearbits.swt.table.DynamicTable createTableDynamic(org.eclipse.swt.widgets.Composite parent, int style)
parent
- style
- public static org.eclipse.jface.viewers.TableViewer createTableViewer(org.eclipse.swt.widgets.Composite container, int style)
parent
- style
- public static org.eclipse.jface.viewers.CheckboxTableViewer createTableViewerCheckbox(org.eclipse.swt.widgets.Composite container, int style)
parent
- style
- public static void disable(org.eclipse.swt.widgets.Composite elem)
elem
- public static void disable(org.eclipse.swt.widgets.Control elem)
elem
- public static int doubleToSlider(double min, double max, double value)
min
- max
- value
- public static void enable(org.eclipse.swt.widgets.Composite elem)
elem
- public static void enable(org.eclipse.swt.widgets.Control elem)
elem
- public static int intToSlider(int min, int max, int value)
min
- max
- value
- public static double sliderToDouble(double min, double max, int value)
min
- max
- value
- public static int sliderToInt(int min, int max, int value)
min
- max
- value
- public static boolean isMac()