|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.elexis.util.SWTHelper
public class SWTHelper
statische Hilfsfunktionen für SWT-Objekte
Nested Class Summary | |
---|---|
static interface |
SWTHelper.IControlProvider
|
static class |
SWTHelper.SimpleDialog
|
Constructor Summary | |
---|---|
SWTHelper()
|
Method Summary | |
---|---|
static void |
addSeparator(Composite parent)
Convenience method to add a separator bar to the composite. |
static void |
alert(java.lang.String title,
java.lang.String message)
Eine Alertbox anzeigen (synchron) |
static boolean |
askYesNo(java.lang.String title,
java.lang.String message)
Eine mit Ja oder Nein zu beantwortende Frage im UI-Thread zeigen |
static java.lang.Boolean |
askYesNoCancel(java.lang.String title,
java.lang.String message)
Eine mit Ja, Nein oder Abbrechen zu beantwortende Frage im UI-Thread zeigen |
static boolean |
blameEmptyString(java.lang.String test,
java.lang.String name)
Check whether the String is empty and give an error message if so |
static void |
center(Shell child)
Ein Objekt auf dem Bildschirm zentrieren. |
static void |
center(Shell parent,
Composite child)
Ein Objekt innerhalb des parents zentrieren |
static void |
center(Shell parent,
Shell child)
Ein Objekt innerhalb des parents zentrieren |
static java.awt.Font |
createAWTFontFromSWTFont(Font swtFont)
|
static Label |
createHyperlink(Composite parent,
java.lang.String text,
IHyperlinkListener lis)
Return a Label that acts as a hyperlink |
static LabeledInputField |
createLabeledField(Composite parent,
java.lang.String label,
LabeledInputField.Typ typ)
|
static TableWrapLayout |
createTableWrapLayout(int numColumns,
boolean makeColumnsEqualWidth)
Constructor wrapper for TableWrapLayout, so that parameters are identical to GridLayout(numColumns, makeColumnsEqualWidth) |
static Text |
createText(Composite parent,
int lines,
int flags)
Create a multiline text widget with a specified height in lines (calculated with the Text's default font) |
static Text |
createText(FormToolkit tk,
Composite parent,
int lines,
int flags)
|
static GridData |
fillGrid(Composite parent,
int cols)
|
static Color |
getContrast(Color col)
Return a color that contrasts optimally to the given color |
static GridData |
getFillGridData()
Shortcut for getFillGridData(1,true,1,true); |
static GridData |
getFillGridData(int hSpan,
boolean hFill,
int vSpan,
boolean vFill)
Ein GridData-Objekt erzeugen, das den horizontalen und/oder vertikalen Freiraum ausfüllt. |
static TableWrapData |
getFillTableWrapData(int hSpan,
boolean hFill,
int vSpan,
boolean vFill)
Ein TableWrapDAta-Objekt erzeugen, das den horizontalen und/oder vertikalen Freiraum ausfüllt. |
static Point |
getStringBounds(Composite c,
java.lang.String s)
|
static void |
reloadViewPart(java.lang.String viewID)
This method "reloads" a view, by closing and opening it. |
static GridData |
setGridDataHeight(Control control,
int lines,
boolean fillHorizontal)
Set a GridData to the given Control that sets the specified height in lines calculated with the control's current font. |
static void |
setSelectOnFocus(Text text)
Adds a FocusListener to text so that the text is selected as soon as the control
gets the focus. |
static void |
showError(java.lang.String title,
java.lang.String message)
Eine Standard-Fehlermeldung asynchron im UI-Thread zeigen |
static void |
showError(java.lang.String logHeader,
java.lang.String title,
java.lang.String message)
Eine Standard-Fehlermeldung asynchron zeigen und loggen |
static void |
showInfo(java.lang.String title,
java.lang.String message)
Eine Standard-Infomeldung asynchron zeigen |
static int |
size(Rectangle r)
|
static void |
writeCentered(GC gc,
java.lang.String text,
Rectangle bounds)
Einen Text zentriert in ein Rechteck schreiben |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SWTHelper()
Method Detail |
---|
public static void center(Shell parent, Composite child)
public static void center(Shell parent, Shell child)
public static void center(Shell child)
public static void writeCentered(GC gc, java.lang.String text, Rectangle bounds)
public static void alert(java.lang.String title, java.lang.String message)
public static void showError(java.lang.String title, java.lang.String message)
title
- Titelmessage
- Nachrichtpublic static void showError(java.lang.String logHeader, java.lang.String title, java.lang.String message)
title
- Titelmessage
- Nachrichtpublic static void showInfo(java.lang.String title, java.lang.String message)
title
- Titelmessage
- Nachrichtpublic static boolean askYesNo(java.lang.String title, java.lang.String message)
title
- Titelmessage
- Nachricht
public static java.lang.Boolean askYesNoCancel(java.lang.String title, java.lang.String message)
title
- Titelmessage
- Nachricht
public static GridData getFillGridData()
public static GridData getFillGridData(int hSpan, boolean hFill, int vSpan, boolean vFill)
horizontal
- true, wenn horizontal gefüllt werden sollvertical
- true, wenn vertikal gefüllt werden soll.
public static GridData fillGrid(Composite parent, int cols)
public static GridData setGridDataHeight(Control control, int lines, boolean fillHorizontal)
control
- the controllines
- reuqested height of the control in linesfillHorizontal
- true if the control should require all horizontal space
public static TableWrapLayout createTableWrapLayout(int numColumns, boolean makeColumnsEqualWidth)
public static TableWrapData getFillTableWrapData(int hSpan, boolean hFill, int vSpan, boolean vFill)
horizontal
- true, wenn horizontal gefüllt werden sollvertical
- true, wenn vertikal gefüllt werden soll.
public static Color getContrast(Color col)
col
- an SWT Color
public static Label createHyperlink(Composite parent, java.lang.String text, IHyperlinkListener lis)
parent
- parent controltext
- text to displaylis
- hyperlink listener that is called on Mouse click
public static Text createText(Composite parent, int lines, int flags)
parent
- parent compositelines
- requested height of the text fieldflags
- creation flags (SWT.MULTI and SWT.WRAP are added automatocally)
public static Text createText(FormToolkit tk, Composite parent, int lines, int flags)
public static LabeledInputField createLabeledField(Composite parent, java.lang.String label, LabeledInputField.Typ typ)
public static boolean blameEmptyString(java.lang.String test, java.lang.String name)
test
- the String to testname
- the name for the String
public static void setSelectOnFocus(Text text)
text
so that the text is selected as soon as the control
gets the focus. The selection is cleared when the focus is lost.
text
- the Text control to add a focus listener topublic static java.awt.Font createAWTFontFromSWTFont(Font swtFont)
public static int size(Rectangle r)
public static Point getStringBounds(Composite c, java.lang.String s)
public static void addSeparator(Composite parent)
The parent composite must have a GridLayout
. The separator bar will span all
columns of the parent grid layout.
Code from: http://www.softwarerevolution.com/blueprints/ The Software Revolution Inc. by
Thomas Holland under GPLv3
parent
- Composite
public static void reloadViewPart(java.lang.String viewID)
viewID
-
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |