Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.jgoodies.validation.tutorial.formatted
Class Utils  view Utils download Utils.java

java.lang.Object
  extended bycom.jgoodies.validation.tutorial.formatted.Utils

public final class Utils
extends java.lang.Object

Provides helper code for the Formatted tutorial example series.

Version:
$Revision: 1.5 $

Nested Class Summary
private static class Utils.ButtonActionHandler
           
 
Constructor Summary
Utils()
           
 
Method Summary
(package private) static void appendButtonBar(DefaultFormBuilder builder, java.util.List textComponents, java.lang.String validText, java.lang.String invalidText)
          Appends a row with three buttons to the given builder.
(package private) static javax.swing.JFormattedTextField appendRow(DefaultFormBuilder builder, java.lang.String text, javax.swing.JFormattedTextField field, java.text.Format displayFormat)
          Appends a row to the given builder that consists of a label for the focus lost behavior mode name, the given JFormattedTextField, a check icon label that is visible iff the field's editValid property is true, and a text label that displays the field's value property,
(package private) static void appendTitleRow(DefaultFormBuilder builder, java.lang.String title)
          Appends a row to the given builder that consists of the title labels used in the formatted example series.
private static javax.swing.JButton createButton(java.lang.String label, java.util.List textComponents, java.lang.String text)
          Creates and returns a button that sets a valid text to the fields.
private static javax.swing.JLabel createEditValidCheckLabel(javax.swing.JFormattedTextField field)
          Creates and returns a label with a check icon, that is visible, if and only if the given field's editValid property is true.
private static javax.swing.JLabel createValueTextLabel(javax.swing.JFormattedTextField field, java.text.Format format)
          Creates and returns a text label whose text value is bound to the value of the given JFormattedTextField.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

appendTitleRow

static void appendTitleRow(DefaultFormBuilder builder,
                           java.lang.String title)
Appends a row to the given builder that consists of the title labels used in the formatted example series.


appendRow

static javax.swing.JFormattedTextField appendRow(DefaultFormBuilder builder,
                                                 java.lang.String text,
                                                 javax.swing.JFormattedTextField field,
                                                 java.text.Format displayFormat)
Appends a row to the given builder that consists of a label for the focus lost behavior mode name, the given JFormattedTextField, a check icon label that is visible iff the field's editValid property is true, and a text label that displays the field's value property,


createEditValidCheckLabel

private static javax.swing.JLabel createEditValidCheckLabel(javax.swing.JFormattedTextField field)
Creates and returns a label with a check icon, that is visible, if and only if the given field's editValid property is true.


createValueTextLabel

private static javax.swing.JLabel createValueTextLabel(javax.swing.JFormattedTextField field,
                                                       java.text.Format format)
Creates and returns a text label whose text value is bound to the value of the given JFormattedTextField. The value is converted to a String using the specified format.


appendButtonBar

static void appendButtonBar(DefaultFormBuilder builder,
                            java.util.List textComponents,
                            java.lang.String validText,
                            java.lang.String invalidText)
Appends a row with three buttons to the given builder. The buttons set valid, invalid and empty texts to the fields. Before the button bar, a gap is added that grows vertically.


createButton

private static javax.swing.JButton createButton(java.lang.String label,
                                                java.util.List textComponents,
                                                java.lang.String text)
Creates and returns a button that sets a valid text to the fields.