Package org.deidentifier.arx.gui.view
Klasse SWTUtil
java.lang.Object
org.deidentifier.arx.gui.view.SWTUtil
This class provides some utility methods for working with SWT.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic doubleScale factor for handling higher DPIstatic final intConstant -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic voidcenter(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Monitor monitor) Centers the shell on the given monitor.static voidcenter(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Shell parent) Centers the given shell.static voidchangeFont(org.eclipse.swt.widgets.Control control, int style) Changes a control's fontstatic voidcreateColumnWithBarCharts(org.eclipse.swt.widgets.Table table, org.eclipse.swt.widgets.TableColumn column) Adds a bar chart to a columnstatic voidcreateDisabledImage(org.eclipse.swt.widgets.ToolItem item) Registers an image for a tool item.static org.eclipse.swt.layout.GridDataCreates grid data.static org.eclipse.swt.layout.GridDatacreateFillGridData(int span) Creates grid data.static org.eclipse.swt.layout.GridDataCreates grid data.static org.eclipse.swt.layout.GridDatacreateFillHorizontallyGridData(boolean fill) Creates grid data.static org.eclipse.swt.layout.GridDatacreateFillHorizontallyGridData(boolean fill, int span) Creates grid data.static org.eclipse.swt.layout.GridDataCreates grid data.static org.eclipse.swt.layout.GridDatacreateFillVerticallyGridData(int span) Creates grid data with a horizontal span.static voidcreateGenericTooltip(org.eclipse.swt.widgets.Table table) Creates a generic tooltip for the tablestatic org.eclipse.swt.layout.GridDataCreates grid data.static org.eclipse.swt.layout.GridLayoutcreateGridLayout(int columns) Creates a grid layout.static org.eclipse.swt.layout.GridLayoutcreateGridLayout(int columns, boolean compact) Creates a grid layout.static org.eclipse.swt.layout.GridLayoutcreateGridLayoutWithEqualWidth(int columns) Creates a grid layout with equal-width columnsstatic voidcreateHelpButton(Controller controller, org.eclipse.swt.custom.CTabFolder folder, String id) Creates a help button in the given folder.static voidcreateHelpButton(Controller controller, org.eclipse.swt.custom.CTabFolder folder, String id, Map<org.eclipse.swt.widgets.Composite, String> helpids) Creates a help button in the given folder.static org.eclipse.swt.layout.GridDataCreates grid data.static org.eclipse.nebula.widgets.pagination.table.PageableTablecreatePageableTableViewer(org.eclipse.swt.widgets.Composite container, int style, boolean fill, boolean equalSize) Returns a table viewer with pagination.static org.eclipse.swt.widgets.TablecreateTable(org.eclipse.swt.widgets.Composite parent, int style) Returns a table.static de.linearbits.swt.table.DynamicTablecreateTableDynamic(org.eclipse.swt.widgets.Composite parent, int style) Returns a dynamic table.static org.eclipse.jface.viewers.TableViewercreateTableViewer(org.eclipse.swt.widgets.Composite container, int style) Returns a table viewer.static org.eclipse.jface.viewers.CheckboxTableViewercreateTableViewerCheckbox(org.eclipse.swt.widgets.Composite container, int style) Returns a checkbox table viewer.static voiddisable(org.eclipse.swt.widgets.Composite elem) Disables the composite and its children.static voiddisable(org.eclipse.swt.widgets.Control elem) Disables the control.static intdoubleToSlider(double min, double max, double value) Converts the double value to a slider selection.static voidenable(org.eclipse.swt.widgets.Composite elem) Enables the composite and its children.static voidenable(org.eclipse.swt.widgets.Control elem) Enables the control.static voidEnforces a light theme on Linux/GTKstatic voidfixOSXMenu(Controller controller) Fixes the application menu on OSX.static voidfixOSXSashBug(org.eclipse.swt.custom.SashForm sash) Tries to fix a bug when resizing sash forms in OSXstatic StringgetPrettyString(boolean value) Converts a boolean into a pretty stringstatic StringgetPrettyString(double value) Returns a pretty string representing the given doublestatic StringgetPrettyString(int value) Returns a pretty string representing the given valuestatic StringgetPrettyString(long value) Returns a pretty string representing the given valuestatic StringgetPrettyString(Object value) Fallback for objects of unknown typestatic booleanisMac()Are we running on an OSX systemstatic voidredraw(org.eclipse.swt.widgets.Control control) Force redraw on control hierarchystatic intscaleToDPI(int size) Scales sizes to DPI settingsstatic doublesliderToDouble(double min, double max, int value) Converts the slider value to a double.
-
Felddetails
-
DPI_SCALE_FACTOR
public static double DPI_SCALE_FACTORScale factor for handling higher DPI -
SLIDER_MAX
public static final int SLIDER_MAXConstant- Siehe auch:
-
-
Konstruktordetails
-
SWTUtil
public SWTUtil()
-
-
Methodendetails
-
center
public static void center(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Monitor monitor) Centers the shell on the given monitor.- Parameter:
shell-monitor-
-
center
public static void center(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Shell parent) Centers the given shell.- Parameter:
shell-parent-
-
changeFont
public static void changeFont(org.eclipse.swt.widgets.Control control, int style) Changes a control's font- Parameter:
control-style-
-
createColumnWithBarCharts
public static void createColumnWithBarCharts(org.eclipse.swt.widgets.Table table, org.eclipse.swt.widgets.TableColumn column) Adds a bar chart to a column- Parameter:
table-column-
-
createDisabledImage
public static void createDisabledImage(org.eclipse.swt.widgets.ToolItem item) Registers an image for a tool item. Generates a version of the image that renders well on windows toolbars, when disabled.- Parameter:
item-image-
-
createFillGridData
public static org.eclipse.swt.layout.GridData createFillGridData()Creates grid data.- Gibt zurück:
-
createFillGridData
public static org.eclipse.swt.layout.GridData createFillGridData(int span) Creates grid data.- Gibt zurück:
-
createFillHorizontallyGridData
public static org.eclipse.swt.layout.GridData createFillHorizontallyGridData()Creates grid data.- Gibt zurück:
-
createFillHorizontallyGridData
public static org.eclipse.swt.layout.GridData createFillHorizontallyGridData(boolean fill) Creates grid data.- Gibt zurück:
-
createFillHorizontallyGridData
public static org.eclipse.swt.layout.GridData createFillHorizontallyGridData(boolean fill, int span) Creates grid data.- Gibt zurück:
-
createFillVerticallyGridData
public static org.eclipse.swt.layout.GridData createFillVerticallyGridData()Creates grid data.- Gibt zurück:
-
createFillVerticallyGridData
public static org.eclipse.swt.layout.GridData createFillVerticallyGridData(int span) Creates grid data with a horizontal span.- Gibt zurück:
-
createGenericTooltip
public static void createGenericTooltip(org.eclipse.swt.widgets.Table table) Creates a generic tooltip for the table- Parameter:
table-
-
createGridData
public static org.eclipse.swt.layout.GridData createGridData()Creates grid data.- Gibt zurück:
-
createGridLayout
public static org.eclipse.swt.layout.GridLayout createGridLayout(int columns) Creates a grid layout.- Parameter:
columns-- Gibt zurück:
-
createGridLayout
public static org.eclipse.swt.layout.GridLayout createGridLayout(int columns, boolean compact) Creates a grid layout.- Parameter:
columns-compact-- Gibt zurück:
-
createGridLayoutWithEqualWidth
public static org.eclipse.swt.layout.GridLayout createGridLayoutWithEqualWidth(int columns) Creates a grid layout with equal-width columns- Parameter:
columns-- Gibt zurück:
-
createHelpButton
public static void createHelpButton(Controller controller, org.eclipse.swt.custom.CTabFolder folder, String id) Creates a help button in the given folder.- Parameter:
controller-folder-id-
-
createHelpButton
public static void createHelpButton(Controller controller, org.eclipse.swt.custom.CTabFolder folder, String id, Map<org.eclipse.swt.widgets.Composite, String> helpids) Creates a help button in the given folder.- Parameter:
controller-folder-id-helpids-
-
createNoFillGridData
public static org.eclipse.swt.layout.GridData createNoFillGridData()Creates grid data.- Gibt zurück:
-
createPageableTableViewer
public static org.eclipse.nebula.widgets.pagination.table.PageableTable createPageableTableViewer(org.eclipse.swt.widgets.Composite container, int style, boolean fill, boolean equalSize) Returns a table viewer with pagination. Implements hacks for fixing OSX bugs.- Parameter:
style-fill-equalSize-parent-- Gibt zurück:
-
createTable
public static org.eclipse.swt.widgets.Table createTable(org.eclipse.swt.widgets.Composite parent, int style) Returns a table. Implements hacks for fixing OSX bugs.- Parameter:
parent-style-- Gibt zurück:
-
createTableDynamic
public static de.linearbits.swt.table.DynamicTable createTableDynamic(org.eclipse.swt.widgets.Composite parent, int style) Returns a dynamic table. Implements hacks for fixing OSX bugs.- Parameter:
parent-style-- Gibt zurück:
-
createTableViewer
public static org.eclipse.jface.viewers.TableViewer createTableViewer(org.eclipse.swt.widgets.Composite container, int style) Returns a table viewer. Implements hacks for fixing OSX bugs.- Parameter:
style-parent-- Gibt zurück:
-
createTableViewerCheckbox
public static org.eclipse.jface.viewers.CheckboxTableViewer createTableViewerCheckbox(org.eclipse.swt.widgets.Composite container, int style) Returns a checkbox table viewer. Implements hacks for fixing OSX bugs.- Parameter:
style-parent-- Gibt zurück:
-
disable
public static void disable(org.eclipse.swt.widgets.Composite elem) Disables the composite and its children.- Parameter:
elem-
-
disable
public static void disable(org.eclipse.swt.widgets.Control elem) Disables the control.- Parameter:
elem-
-
doubleToSlider
public static int doubleToSlider(double min, double max, double value) Converts the double value to a slider selection.- Parameter:
min-max-value-- Gibt zurück:
-
enable
public static void enable(org.eclipse.swt.widgets.Composite elem) Enables the composite and its children.- Parameter:
elem-
-
enable
public static void enable(org.eclipse.swt.widgets.Control elem) Enables the control.- Parameter:
elem-
-
fixGTKDarkTheme
public static void fixGTKDarkTheme()Enforces a light theme on Linux/GTK -
fixOSXMenu
Fixes the application menu on OSX.- Parameter:
controller-
-
fixOSXSashBug
public static void fixOSXSashBug(org.eclipse.swt.custom.SashForm sash) Tries to fix a bug when resizing sash forms in OSX- Parameter:
sash-
-
getPrettyString
Converts a boolean into a pretty string- Parameter:
value-- Gibt zurück:
-
getPrettyString
Returns a pretty string representing the given double- Parameter:
value-- Gibt zurück:
-
getPrettyString
Returns a pretty string representing the given value- Parameter:
value-- Gibt zurück:
-
getPrettyString
Returns a pretty string representing the given value- Parameter:
value-- Gibt zurück:
-
getPrettyString
Fallback for objects of unknown type- Parameter:
value-- Gibt zurück:
-
isMac
public static boolean isMac()Are we running on an OSX system- Gibt zurück:
-
redraw
public static void redraw(org.eclipse.swt.widgets.Control control) Force redraw on control hierarchy- Parameter:
control-
-
scaleToDPI
public static int scaleToDPI(int size) Scales sizes to DPI settings- Parameter:
size-- Gibt zurück:
-
sliderToDouble
public static double sliderToDouble(double min, double max, int value) Converts the slider value to a double.- Parameter:
min-max-value-- Gibt zurück:
-