|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.aptana.ide.core.ui.SWTUtils
public class SWTUtils
Utilities to make SWT dialogs easier to manage
| Constructor Summary | |
|---|---|
protected |
SWTUtils()
Protected constructor for utility class |
| Method Summary | |
|---|---|
static double[] |
calculateColumnPercents(org.eclipse.swt.widgets.Table table,
double padding)
Calculates the percentage width of each column in the table relative to the total table size |
static int[] |
calculateColumnWidths(org.eclipse.swt.widgets.Table table)
Calculates the width of each column in the table |
static void |
center(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Shell parent)
Centers the shell on screen. |
static void |
centerAndPack(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Shell parent)
Centers the shell on screen, and re-packs it to the preferred size. |
static void |
colorBackground(org.eclipse.swt.widgets.Text widget,
java.lang.String testValue)
Colors the background of a text widget based on the test value |
static org.eclipse.swt.graphics.Font |
getDefaultLargeFont()
Retuyrns |
static org.eclipse.swt.graphics.Font |
getDefaultSmallFont()
Retuyrns |
static org.eclipse.swt.graphics.Image |
getImage(org.eclipse.ui.plugin.AbstractUIPlugin plugin,
java.lang.String path)
Finds and caches the iamge from the image descriptor for this particular plugin |
static void |
linkButtonAndField(org.eclipse.swt.widgets.Button button,
org.eclipse.swt.widgets.Text text,
boolean clearFieldOnDisable)
Sets a text box to enable/disable based on a button click. |
static void |
pack(org.eclipse.swt.widgets.Shell shell)
Re-packs it to the preferred size. |
static org.eclipse.swt.graphics.FontData[] |
resizeFont(org.eclipse.swt.graphics.Font font,
int size)
Returns a version of the specified font, resized by the requested size |
static void |
setFieldWithDefaultValue(org.eclipse.swt.widgets.Text text,
java.lang.String defaultValue)
Indicated that this field is a "default", and so it contains a default value and is shaded unless a new value is entered |
static void |
setTableColumnWidths(org.eclipse.swt.widgets.Table table,
double[] columnPercentages,
int[] columnMinimums)
Sets the columns of a table to percentage widths, rather than pixels |
static void |
setTextAsPassword(org.eclipse.swt.widgets.Text text)
Echos out "*" characters when typing in a text field. |
static void |
setTextWidgetValue(org.eclipse.swt.widgets.Text widget,
java.lang.String text)
Sets the text of the text widget, but only if the value is non-null; |
static boolean |
testWidgetValue(org.eclipse.swt.widgets.Combo widget,
int validSelectionIndex)
Tests if the widget value is empty. |
static boolean |
testWidgetValue(org.eclipse.swt.widgets.Text widget)
Tests if the widget value is empty. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SWTUtils()
| Method Detail |
|---|
public static void colorBackground(org.eclipse.swt.widgets.Text widget,
java.lang.String testValue)
widget - testValue -
public static void setTextWidgetValue(org.eclipse.swt.widgets.Text widget,
java.lang.String text)
widget - the widget to set text fortext - the text to setpublic static boolean testWidgetValue(org.eclipse.swt.widgets.Text widget)
widget - the widget to set text for
public static boolean testWidgetValue(org.eclipse.swt.widgets.Combo widget,
int validSelectionIndex)
widget - the widget to set text forvalidSelectionIndex - the first item that is a "valid" selection
public static void centerAndPack(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Shell parent)
shell - The shell to centerparent - The shell to center within
public static void center(org.eclipse.swt.widgets.Shell shell,
org.eclipse.swt.widgets.Shell parent)
shell - The shell to centerparent - The shell to center withinpublic static void pack(org.eclipse.swt.widgets.Shell shell)
shell - The shell to centerpublic static void setTextAsPassword(org.eclipse.swt.widgets.Text text)
text -
public static void setFieldWithDefaultValue(org.eclipse.swt.widgets.Text text,
java.lang.String defaultValue)
text - The text widget to designate as "default"defaultValue - The default string value to use
public static void linkButtonAndField(org.eclipse.swt.widgets.Button button,
org.eclipse.swt.widgets.Text text,
boolean clearFieldOnDisable)
button - the button to test for the selection statetext - the text field to clearclearFieldOnDisable - do we blank out the text field if its disabled?
public static void setTableColumnWidths(org.eclipse.swt.widgets.Table table,
double[] columnPercentages,
int[] columnMinimums)
table - The table to modifycolumnPercentages - The array of percentage widths (ex. 0.2 = 20%). Does not need to equal 100%.columnMinimums - The array of minimum pixel widths for each column. 0 indicates whatever width works.
public static double[] calculateColumnPercents(org.eclipse.swt.widgets.Table table,
double padding)
table - the table to computepadding - a padding value to add to each table cell to space out the display a bit
public static int[] calculateColumnWidths(org.eclipse.swt.widgets.Table table)
table - the table to compute
public static org.eclipse.swt.graphics.Font getDefaultSmallFont()
public static org.eclipse.swt.graphics.Font getDefaultLargeFont()
public static org.eclipse.swt.graphics.FontData[] resizeFont(org.eclipse.swt.graphics.Font font,
int size)
font - The font to resizesize - The font size
public static org.eclipse.swt.graphics.Image getImage(org.eclipse.ui.plugin.AbstractUIPlugin plugin,
java.lang.String path)
plugin - The plugin to searchpath - The path to the image
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||