com.objectwave.viewUtility
Class WidgetFunctions

java.lang.Object
  |
  +--com.objectwave.viewUtility.WidgetFunctions

public class WidgetFunctions
extends java.lang.Object

A collection of handy static methods which can be used with AWT/Swing GUI components.

Version:
1.4

Constructor Summary
WidgetFunctions()
           
 
Method Summary
static void addComponent(java.awt.Font captionFont, java.lang.String caption, java.awt.Container container, java.awt.Component component, boolean lastInRow)
          A very common operation when building GUI panels is to do a
static boolean displayComponent(javax.swing.JComponent component, java.awt.Rectangle bounds)
          Display any component (probably most commonly a JPanel) in it's very own frame.
static java.awt.Frame findParentFrame(java.awt.Component component)
          A handy method to find the first ancestor of "component" which is a Frame.
static java.util.Date getDateFrom(javax.swing.JTextField tf)
          Use a simple JTextField to get/set date values.
static javax.swing.JLabel initLabel(java.lang.String caption)
          Create & return a new JLabel, given caption.
static StateCheckBox initStateCheckBoxYNU(java.lang.String caption)
           
static javax.swing.JTextField initTextField()
          Create & return a new JCDoubletextField, formatted properly.
static void insertUpdate(javax.swing.event.DocumentEvent e, javax.swing.text.JTextComponent ivjTextArea1, int limit)
          A utility method that will limit the amount of characters allowed in a text component.
static void setDateFor(javax.swing.JTextField tf, java.util.Date date, java.lang.String nullText)
          Use a simple JTextField to get/set date values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetFunctions

public WidgetFunctions()
Method Detail

addComponent

public static void addComponent(java.awt.Font captionFont,
                                java.lang.String caption,
                                java.awt.Container container,
                                java.awt.Component component,
                                boolean lastInRow)
A very common operation when building GUI panels is to do a

displayComponent

public static boolean displayComponent(javax.swing.JComponent component,
                                       java.awt.Rectangle bounds)
Display any component (probably most commonly a JPanel) in it's very own frame. The return value indicates whether or not "ok" was clicked.


findParentFrame

public static java.awt.Frame findParentFrame(java.awt.Component component)
A handy method to find the first ancestor of "component" which is a Frame.


getDateFrom

public static java.util.Date getDateFrom(javax.swing.JTextField tf)
Use a simple JTextField to get/set date values. This is useable wherever a JCDateTextField is inconvenient. If there is no text or if the text cannot be parsed to a date, return null.


initLabel

public static javax.swing.JLabel initLabel(java.lang.String caption)
Create & return a new JLabel, given caption.


initStateCheckBoxYNU

public static StateCheckBox initStateCheckBoxYNU(java.lang.String caption)

initTextField

public static javax.swing.JTextField initTextField()
Create & return a new JCDoubletextField, formatted properly.


insertUpdate

public static void insertUpdate(javax.swing.event.DocumentEvent e,
                                javax.swing.text.JTextComponent ivjTextArea1,
                                int limit)
A utility method that will limit the amount of characters allowed in a text component.


setDateFor

public static void setDateFor(javax.swing.JTextField tf,
                              java.util.Date date,
                              java.lang.String nullText)
Use a simple JTextField to get/set date values. This is useable wherever a JCDateTextField is inconvenient.

Parameters:
tf - The textfield to set the text of.
date - The date to set into the tf. Null is legal if nulltext!=null.
nullText - The text to use if date==null. Also used if date == 1/1/1801.