|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.jemacs.swt.SwtHelper
public class SwtHelper
A Class to act as a layer between SwtJemacs and SWT. SWT requires that (almost) all calls to widget methods and constructors happen in the GUI event loop thread. On the other hand it should be possible in JEmacs/Kawa to create new threads and call functions that may, in turn, call SwtJemacs. Therefore we must have this layer between SwtJemacs and SWT. Each method in this class will make sure it is executed in the GUI loop thread.
Nested Class Summary | |
---|---|
static class |
SwtHelper.Resultable
A variant of Runnable to be used in Display.syncExec when the caller wants to retrive the result. |
Constructor Summary | |
---|---|
SwtHelper()
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwtHelper()
Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |