|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.util.GuiStandardUtils
public class GuiStandardUtils
Utility functions that help enforce a standard look and feel in accordance with the Java Look and Feel Design Guidelines.
Method Summary | |
---|---|
static JComponent |
attachBorder(JComponent c)
|
static JComponent |
attachBorder(JComponent c,
Border border)
|
static JComponent |
attachDialogBorder(JComponent c)
|
static JTextArea |
configureStandardTextArea(JTextArea textArea)
|
static JComponent |
createCommandButtonColumn(JButton[] buttons)
Make a vertical row of buttons of equal size, whch are equally spaced, and aligned on the right. |
static JComponent |
createCommandButtonRow(JButton[] buttons)
Make a horizontal row of buttons of equal size, whch are equally spaced, and aligned on the right. |
static void |
createDebugBorder(JComponent c,
Color color)
Useful debug function to place a colored, line border around a component for layout management debugging. |
static String |
createDialogTitle(String appName,
String dialogName)
Return text which conforms to the Look and Feel Design Guidelines for the title of a dialog : the application name, a colon, then the name of the specific dialog. |
static Border |
createEvenlySpacedBorder(com.jgoodies.forms.layout.ConstantSize space)
|
static Border |
createEvenlySpacedBorder(int spacePx)
|
static Border |
createLeftAndRightBorder(com.jgoodies.forms.layout.ConstantSize space)
|
static Border |
createLeftAndRightBorder(int spacePx)
|
static JTextArea |
createStandardTextArea(int rows,
int columns)
|
static JTextArea |
createStandardTextArea(String text)
An alternative to multi-line labels, for the presentation of several lines of text, and for which the line breaks are determined solely by the control. |
static JTextArea |
createStandardTextAreaHardNewLines(String text)
An alternative to multi-line labels, for the presentation of several lines of text, and for which line breaks are determined solely by aText , and not by the control. |
static Border |
createTopAndBottomBorder(com.jgoodies.forms.layout.ConstantSize space)
|
static Border |
createTopAndBottomBorder(int spacePx)
|
static void |
equalizeSizes(JComponent[] components)
Sets the items in aComponents to the same size. |
static Border |
getStandardDialogBorder()
|
static JTextArea |
textAreaAsLabel(JTextArea textArea)
This will allow selection and copy to work but still retain the label look |
static JTextComponent |
textComponentAsLabel(JTextComponent textcomponent)
This will allow selection and copy to work but still retain the label look |
static void |
truncateLabelIfLong(JLabel label)
If aLabel has text which is longer than MAX_LABEL_LENGTH, then truncate the label text and place an ellipsis at the end; the original text is placed in a tooltip. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JComponent attachBorder(JComponent c, Border border)
public static JComponent attachBorder(JComponent c)
public static JComponent attachDialogBorder(JComponent c)
public static Border getStandardDialogBorder()
public static Border createEvenlySpacedBorder(int spacePx)
public static Border createEvenlySpacedBorder(com.jgoodies.forms.layout.ConstantSize space)
public static Border createLeftAndRightBorder(int spacePx)
public static Border createLeftAndRightBorder(com.jgoodies.forms.layout.ConstantSize space)
public static Border createTopAndBottomBorder(int spacePx)
public static Border createTopAndBottomBorder(com.jgoodies.forms.layout.ConstantSize space)
public static String createDialogTitle(String appName, String dialogName)
dialogName
- the short name of the dialog.public static JComponent createCommandButtonRow(JButton[] buttons)
The returned component has border spacing only on the top (of the size
recommended by the Look and Feel Design Guidelines). All other spacing
must be applied elsewhere ; usually, this will only mean that the
dialog's top-level panel should use #buildStandardBorder
.
buttons
- contains JButton
objects.
public static JComponent createCommandButtonColumn(JButton[] buttons)
The returned component has border spacing only on the left (of the size
recommended by the Look and Feel Design Guidelines). All other spacing
must be applied elsewhere ; usually, this will only mean that the
dialog's top-level panel should use #buildStandardBorder
.
buttons
- contains JButton
objects.
public static void equalizeSizes(JComponent[] components)
aComponents
to the same size.
Sets each component's preferred and maximum sizes. The actual size is
determined by the layout manager, which adjusts for locale-specific
strings and customized fonts. (See this Sun doc
for more information.)
components
- contains JComponent
objects.public static JTextArea createStandardTextArea(int rows, int columns)
public static JTextArea createStandardTextArea(String text)
text
- text that does not contain newline characters or html.
JTextArea
which is not editable, has improved
spacing over the supplied default (placing
UIConstants.ONE_SPACE
on the left and right), and which
wraps lines on word boundarie.public static JTextArea configureStandardTextArea(JTextArea textArea)
public static JTextArea createStandardTextAreaHardNewLines(String text)
aText
, and not by the control.
text
- the text to be placed in the text area.
JTextArea
which is not editable and has improved
spacing over the supplied default (placing
UIConstants.ONE_SPACE
on the left and right).public static void truncateLabelIfLong(JLabel label)
label
- The label to truncate if length() > MAX_LABEL_LENGTH.public static JTextArea textAreaAsLabel(JTextArea textArea)
public static JTextComponent textComponentAsLabel(JTextComponent textcomponent)
public static void createDebugBorder(JComponent c, Color color)
c
- the componentcolor
- the border color
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |