|
|||||||||
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(org.eclipse.swt.widgets.Menu menubar)
Calls menubar.dispose() |
static org.eclipse.swt.graphics.Rectangle |
getArea(org.eclipse.swt.custom.StyledText styledText)
|
static int |
getCaretOffset(org.eclipse.swt.custom.StyledText styledText)
|
static org.eclipse.swt.widgets.Display |
getDisplay()
|
static int |
getLineHeight(org.eclipse.swt.custom.StyledText styledText)
|
static org.eclipse.swt.widgets.Composite |
getParent(org.eclipse.swt.widgets.Control control)
|
static int |
getTopIndex(org.eclipse.swt.custom.StyledText styledText)
|
static void |
injectSashFormAsParent(org.eclipse.swt.widgets.Control child,
int style)
|
static void |
layout(org.eclipse.swt.widgets.Composite composite)
|
static org.eclipse.swt.widgets.Menu |
newMenu(org.eclipse.swt.widgets.MenuItem menuItem)
Creates a new Menu inside a MenuItem. |
static org.eclipse.swt.widgets.Menu |
newMenu(org.eclipse.swt.widgets.Shell shell,
int bar)
Creates a new menu bar for a shelln |
static org.eclipse.swt.widgets.MenuItem |
newMenuItem(org.eclipse.swt.widgets.Menu parent,
int style,
java.lang.String text,
org.eclipse.swt.events.SelectionListener selectionListener)
Creates a new MenuItem. |
static org.eclipse.swt.custom.SashForm |
newSashForm(org.eclipse.swt.widgets.Composite parent,
int style)
|
static org.eclipse.swt.widgets.Shell |
newShell(org.eclipse.swt.widgets.Display display,
org.eclipse.swt.layout.FillLayout layout)
|
static org.eclipse.swt.custom.StyledText |
newStyledText(org.eclipse.swt.widgets.Composite parent,
int style,
org.eclipse.swt.custom.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(org.eclipse.swt.widgets.Control control)
|
static void |
setCaretOffset(org.eclipse.swt.custom.StyledText styledText,
int offset)
|
static void |
setContent(org.eclipse.swt.custom.StyledText styledText,
org.eclipse.swt.custom.StyledTextContent bufferContent)
|
static void |
setMenu(org.eclipse.swt.widgets.MenuItem menuItem,
org.eclipse.swt.widgets.Menu subMenu)
|
static void |
setMenuBar(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Menu menubar)
Sets a menu bar for a shell. |
static void |
setParent(org.eclipse.swt.widgets.Control control,
org.eclipse.swt.widgets.Composite parent)
|
static void |
setWeights(org.eclipse.swt.custom.SashForm form,
int[] weights)
|
static void |
showSelection(org.eclipse.swt.custom.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(org.eclipse.swt.widgets.Menu menubar)
menubar
- The menu to disposepublic static org.eclipse.swt.widgets.Menu newMenu(org.eclipse.swt.widgets.Shell shell, int bar)
public static org.eclipse.swt.widgets.Menu newMenu(org.eclipse.swt.widgets.MenuItem menuItem)
public static org.eclipse.swt.widgets.MenuItem newMenuItem(org.eclipse.swt.widgets.Menu parent, int style, java.lang.String text, org.eclipse.swt.events.SelectionListener selectionListener)
public static void setMenuBar(org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.widgets.Menu menubar)
public static void setMenu(org.eclipse.swt.widgets.MenuItem menuItem, org.eclipse.swt.widgets.Menu subMenu)
public static org.eclipse.swt.widgets.Shell newShell(org.eclipse.swt.widgets.Display display, org.eclipse.swt.layout.FillLayout layout)
public static org.eclipse.swt.custom.StyledText newStyledText(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.custom.StyledTextContent styledTextContent, SwtWindow swtWindow, int firstVisibleLine)
public static int getTopIndex(org.eclipse.swt.custom.StyledText styledText)
public static int getCaretOffset(org.eclipse.swt.custom.StyledText styledText)
public static org.eclipse.swt.widgets.Composite getParent(org.eclipse.swt.widgets.Control control)
public static org.eclipse.swt.graphics.Rectangle getArea(org.eclipse.swt.custom.StyledText styledText)
public static int getLineHeight(org.eclipse.swt.custom.StyledText styledText)
public static void setCaretOffset(org.eclipse.swt.custom.StyledText styledText, int offset)
public static void setContent(org.eclipse.swt.custom.StyledText styledText, org.eclipse.swt.custom.StyledTextContent bufferContent)
public static void showSelection(org.eclipse.swt.custom.StyledText styledText)
public static void redraw(org.eclipse.swt.widgets.Control control)
public static org.eclipse.swt.custom.SashForm newSashForm(org.eclipse.swt.widgets.Composite parent, int style)
public static void setParent(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Composite parent)
public static void injectSashFormAsParent(org.eclipse.swt.widgets.Control child, int style)
public static void setWeights(org.eclipse.swt.custom.SashForm form, int[] weights)
public static void layout(org.eclipse.swt.widgets.Composite composite)
public static org.eclipse.swt.widgets.Display getDisplay()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |