public class SwtHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SwtHelper.Resultable
A variant of Runnable to be used in Display.syncExec when the caller
wants to retrive the result.
|
Constructor and Description |
---|
SwtHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
dispose(Menu menubar)
Calls menubar.dispose()
|
static Rectangle |
getArea(StyledText styledText) |
static int |
getCaretOffset(StyledText styledText) |
static Display |
getDisplay() |
static int |
getLineHeight(StyledText styledText) |
static Composite |
getParent(Control control) |
static int |
getTopIndex(StyledText styledText) |
static void |
injectSashFormAsParent(Control child,
int style) |
static void |
layout(Composite composite) |
static Menu |
newMenu(MenuItem menuItem)
Creates a new Menu inside a MenuItem.
|
static Menu |
newMenu(Shell shell,
int bar)
Creates a new menu bar for a shelln
|
static MenuItem |
newMenuItem(Menu parent,
int style,
java.lang.String text,
SelectionListener selectionListener)
Creates a new MenuItem.
|
static SashForm |
newSashForm(Composite parent,
int style) |
static Shell |
newShell(Display display,
FillLayout layout) |
static StyledText |
newStyledText(Composite parent,
int style,
StyledTextContent styledTextContent,
SwtWindow swtWindow,
int firstVisibleLine)
Creates a StyledText instance with a given content, and an SwtWindow
which will be installed as
VerifyKeylistener, FocusListener, KeyListener and Mouselistener
|
static void |
redraw(Control control) |
static void |
setCaretOffset(StyledText styledText,
int offset) |
static void |
setContent(StyledText styledText,
StyledTextContent bufferContent) |
static void |
setMenu(MenuItem menuItem,
Menu subMenu) |
static void |
setMenuBar(Shell shell,
Menu menubar)
Sets a menu bar for a shell.
|
static void |
setParent(Control control,
Composite parent) |
static void |
setWeights(SashForm form,
int[] weights) |
static void |
showSelection(StyledText styledText) |
public static void dispose(Menu menubar)
menubar
- The menu to disposepublic static Menu newMenu(Shell shell, int bar)
public static Menu newMenu(MenuItem menuItem)
public static MenuItem newMenuItem(Menu parent, int style, java.lang.String text, SelectionListener selectionListener)
public static void setMenuBar(Shell shell, Menu menubar)
public static void setMenu(MenuItem menuItem, Menu subMenu)
public static Shell newShell(Display display, FillLayout layout)
public static StyledText newStyledText(Composite parent, int style, StyledTextContent styledTextContent, SwtWindow swtWindow, int firstVisibleLine)
public static int getTopIndex(StyledText styledText)
public static int getCaretOffset(StyledText styledText)
public static Composite getParent(Control control)
public static Rectangle getArea(StyledText styledText)
public static int getLineHeight(StyledText styledText)
public static void setCaretOffset(StyledText styledText, int offset)
public static void setContent(StyledText styledText, StyledTextContent bufferContent)
public static void showSelection(StyledText styledText)
public static void redraw(Control control)
public static SashForm newSashForm(Composite parent, int style)
public static void setParent(Control control, Composite parent)
public static void injectSashFormAsParent(Control child, int style)
public static void setWeights(SashForm form, int[] weights)
public static void layout(Composite composite)
public static Display getDisplay()