public class SWTHelper extends Object
Constructor and Description |
---|
SWTHelper() |
Modifier and Type | Method and Description |
---|---|
static TableEditor |
addEditableTableColumn(Table table,
int column,
int minimumWidth,
ModifyListener modifyListener)
Adds an editable column for a table.
|
static void |
addTableColumnResizer(Table table)
Adds a table column re-sizer to make the last column resize with the table and dialog box.
|
static void |
addTableSorter(Table table)
Adds a table sorter.
|
static int |
autoScaleDown(int size)
Auto-scales down for high DPI displays.
|
static int |
autoScaleUp(int size)
Auto-scales up for high DPI displays.
|
static void |
centerDialog(Shell shell)
Centers a dialog on screen.
|
static Image |
createImage(Color color,
int width,
int height)
Create an image of the specified color.
|
static Image |
createImage(Color color,
int width,
int height,
boolean doFrame)
Create an image of the specified color.
|
static Image |
createImage(int rgb,
int width,
int height)
Create an image of a color.
|
static Image |
createImage(int rgb,
int width,
int height,
boolean doFrame)
Create an image of a color.
|
static Image |
createImage(int r,
int g,
int b,
int width,
int height)
Create an image of a color.
|
static Image |
createImage(int r,
int g,
int b,
int width,
int height,
boolean doFrame)
Create an image of a color.
|
static void |
expandAll(TreeViewer viewer)
Performs the Expand all on a tree viewer, very fast.
|
static Control |
getFocusControl(Composite composite)
Gets the control in focus for a composite.
|
static void |
showPopupMenu(Menu menu,
Control control)
Displays a drop-down menu below a control.
|
static void |
showPopupMenu(Menu menu,
ToolItem item)
Displays a drop-down menu below a control.
|
public static void addTableColumnResizer(Table table)
table
- The table to resize the last column.public static void addTableSorter(Table table)
public static TableEditor addEditableTableColumn(Table table, int column, int minimumWidth, ModifyListener modifyListener)
table
- The table.column
- The column index.minimumWidth
- The minimum pixel width of the Text editor (for layout).modifyListener
- Possible listener for entry field Text modifications.public static Image createImage(int rgb, int width, int height)
rgb
- RGB value color.width
- Width of image.height
- Height of image.public static Image createImage(int rgb, int width, int height, boolean doFrame)
rgb
- RGB value color.width
- Width of image.height
- Height of image.doFrame
- If the image should be framed.public static Image createImage(int r, int g, int b, int width, int height)
r
- Red color of image (0-255).g
- Green color of image (0-255).b
- Blue color of image (0-255).width
- Width of image.height
- Height of image.public static Image createImage(int r, int g, int b, int width, int height, boolean doFrame)
r
- Red color of image (0-255).g
- Green color of image (0-255).b
- Blue color of image (0-255).width
- Width of image.height
- Height of image.doFrame
- If the image should be framed.public static Image createImage(Color color, int width, int height)
color
- Color of image.width
- Width of image.height
- Height of image.public static Image createImage(Color color, int width, int height, boolean doFrame)
color
- Color of image.width
- Width of image.height
- Height of image.doFrame
- If the image should be framed.public static void showPopupMenu(Menu menu, ToolItem item)
public static void showPopupMenu(Menu menu, Control control)
public static void expandAll(TreeViewer viewer)
public static Control getFocusControl(Composite composite)
public static void centerDialog(Shell shell)
shell
- The dialog to center.public static int autoScaleUp(int size)
size
- Value to scale up.public static int autoScaleDown(int size)
size
- Value to scale down.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.