com.melloware.jukes.gui.view.component
Class ComponentFactory

java.lang.Object
  extended by com.jgoodies.binding.adapter.BasicComponentFactory
      extended by com.melloware.jukes.gui.view.component.ComponentFactory

public final class ComponentFactory
extends com.jgoodies.binding.adapter.BasicComponentFactory

Consists only of static methods that vend formatted text fields used to edit dates that are bound to an underlying ValueModel. Extends the Binding library's BasicComponentFactory to inherit all factory metods from that class.

Copyright (c) 1999-2007 Melloware, Inc.

Version:
4.0
Author:
Emil A. Lefkof III
See Also:
BasicComponentFactory, Bindings

Method Summary
static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel)
          Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.
static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel, boolean enableShortcuts)
          Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.
static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel, boolean enableShortcuts, boolean commitsOnValidEdit)
          Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.
static javax.swing.AbstractButton createDirectoryChooserButton(javax.swing.text.JTextComponent aTextComponent)
          Create a new button that is a directory chooser button and associates it with a text component to put the selected directory in.
static javax.swing.AbstractButton createFileChooserButton(javax.swing.text.JTextComponent aTextComponent, java.lang.String aTitle, javax.swing.filechooser.FileFilter aFilter)
          Create a new button that is a file chooser button and associates it with a text component to put the selected file in.
static javax.swing.AbstractButton createTitleCaseButton(javax.swing.text.JTextComponent aTextComponent)
          Create a new button that is a title case button and associates it with a text component to actually perform the title casing on.
static javax.swing.AbstractButton createToolBarButton(java.lang.String aActionId)
          Create a new tool bar button from an Action.
static javax.swing.AbstractButton createToolBarToggleButton(java.lang.String aActionId)
          Create a new tool bar toggle button from an Action.
 
Methods inherited from class com.jgoodies.binding.adapter.BasicComponentFactory
createCheckBox, createColorChooser, createColorChooser, createComboBox, createComboBox, createFormattedTextField, createFormattedTextField, createFormattedTextField, createFormattedTextField, createIntegerField, createIntegerField, createIntegerField, createIntegerField, createIntegerField, createLabel, createLabel, createList, createList, createLongField, createLongField, createLongField, createLongField, createLongField, createPasswordField, createPasswordField, createRadioButton, createTextArea, createTextArea, createTextField, createTextField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDateField

public static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.

The JFormattedTextField is configured with an AbstractFormatter that uses two different DateFormats to edit and display the Date. A SHORT DateFormat with strict checking is used to edit (parse) a date; the DateFormatter's default DateFormat is used to display (format) a date. In both cases null Dates are mapped to the empty String.

In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".

Yesterday, today, and tomorrow are displayed as these Strings, not as formatted Dates.

Parameters:
valueModel - the model that holds the value to be edited
Returns:
a formatted text field for Date instances that is bound
Throws:
java.lang.NullPointerException - if the model is null

createDateField

public static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel,
                                                              boolean enableShortcuts)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.

The JFormattedTextField is configured with an AbstractFormatter that uses two different DateFormats to edit and display the Date. A SHORT DateFormat with strict checking is used to edit (parse) a date; the DateFormatter's default DateFormat is used to display (format) a date. In both cases null Dates are mapped to the empty String.

In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".

If enableShortcuts is set to true, yesterday, today, and tomorrow are displayed as these Strings, not as formatted Dates.

Parameters:
valueModel - the model that holds the value to be edited
enableShortcuts - true to display yesterday, today, and tomorrow with natural language strings
Returns:
a formatted text field for Date instances that is bound
Throws:
java.lang.NullPointerException - if the model is null

createDateField

public static javax.swing.JFormattedTextField createDateField(com.jgoodies.binding.value.ValueModel valueModel,
                                                              boolean enableShortcuts,
                                                              boolean commitsOnValidEdit)
Creates and returns a formatted text field that is bound to the Date value of the given ValueModel.

The JFormattedTextField is configured with an AbstractFormatter that uses two different DateFormats to edit and display the Date. A SHORT DateFormat with strict checking is used to edit (parse) a date; the DateFormatter's default DateFormat is used to display (format) a date. In both cases null Dates are mapped to the empty String.

In addition to formatted Dates, the parser accepts positive and negative integers and interprets them as Dates relative to today. For example -1 is yesterday, 1 is tomorrow, and 7 is "in a week".

If enableShortcuts is set to true, yesterday, today, and tomorrow are displayed as these Strings, not as formatted Dates.

Parameters:
valueModel - the model that holds the value to be edited
enableShortcuts - true to display yesterday, today, and tomorrow with natural language strings
commitsOnValidEdit - true to commit on valid edit, false to commit on focus lost
Returns:
a formatted text field for Date instances that is bound
Throws:
java.lang.NullPointerException - if the model is null

createDirectoryChooserButton

public static javax.swing.AbstractButton createDirectoryChooserButton(javax.swing.text.JTextComponent aTextComponent)
Create a new button that is a directory chooser button and associates it with a text component to put the selected directory in.

Parameters:
aTextComponent - the text component to title case
Returns:
an Abstract button that is the title case button

createFileChooserButton

public static javax.swing.AbstractButton createFileChooserButton(javax.swing.text.JTextComponent aTextComponent,
                                                                 java.lang.String aTitle,
                                                                 javax.swing.filechooser.FileFilter aFilter)
Create a new button that is a file chooser button and associates it with a text component to put the selected file in.

Parameters:
aTextComponent - the text component to title case
aTitle - the title of the chooser dialog
aFilter - the file filter for the chooser
Returns:
an Abstract button that is the title case button

createTitleCaseButton

public static javax.swing.AbstractButton createTitleCaseButton(javax.swing.text.JTextComponent aTextComponent)
Create a new button that is a title case button and associates it with a text component to actually perform the title casing on.

Parameters:
aTextComponent - the text component to title case
Returns:
an Abstract button that is the title case button

createToolBarButton

public static javax.swing.AbstractButton createToolBarButton(java.lang.String aActionId)
Create a new tool bar button from an Action.

Parameters:
aActionId - the actionId to create the button for
Returns:
an Abstract button that is the title case button

createToolBarToggleButton

public static javax.swing.AbstractButton createToolBarToggleButton(java.lang.String aActionId)
Create a new tool bar toggle button from an Action.

Parameters:
aActionId - the actionId to create the button for
Returns:
an Abstract button that is the title case button


Copyright © 1999-2008 Melloware Inc. All Rights Reserved.