com.sptci.echo2demo
Class InputForm

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.app.ContentPane
          extended by com.sptci.echo2demo.InputForm
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, nextapp.echo2.app.event.ActionListener, nextapp.echo2.app.Pane, nextapp.echo2.app.PaneContainer, nextapp.echo2.app.RenderIdSupport

public class InputForm
extends nextapp.echo2.app.ContentPane
implements nextapp.echo2.app.event.ActionListener

A ContentPane that builds the form used to input user and job information.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: InputForm.java,v 1.10 2006/02/15 16:14:57 rakesh Exp $
Author:
Rakesh Vidyadharan 2006-01-21
See Also:
Serialized Form

Field Summary
private  java.util.HashMap<java.lang.String,nextapp.echo2.app.CheckBox> checkBoxes
           
private  nextapp.echo2.app.Button delete
           
private  nextapp.echo2.app.Button first
           
private  nextapp.echo2.app.Label index
           
private  JDOModelPropertyChangeListener jdoChangeListener
          The property change listener used to synchronise modifications applied to UI components to the model java bean.
private  nextapp.echo2.app.Button last
           
private  nextapp.echo2.app.ListBox listBox
           
private  InputFormModel model
          The java bean used to store the values of the data for the UI components.
private  nextapp.echo2.app.Button next
           
private  nextapp.echo2.app.Button previous
           
private  nextapp.echo2.app.Button save
           
private  nextapp.echo2.app.SelectField selectField
           
private  nextapp.echo2.app.TextArea textArea
           
private  nextapp.echo2.app.TextField textField
           
private  ViewPropertyChangeListener uiChangeListener
          The property change listener used to synchronise modifications applied to the model java bean to the UI components.
 
Fields inherited from class nextapp.echo2.app.ContentPane
PROPERTY_BACKGROUND_IMAGE, PROPERTY_HORIZONTAL_SCROLL, PROPERTY_VERTICAL_SCROLL
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
InputForm()
          Create a new instance of the form.
InputForm(InputFormModel model)
          Create a new instance of the form using the specified java bean.
 
Method Summary
 void actionPerformed(nextapp.echo2.app.event.ActionEvent event)
          ActionListener implementation.
private  nextapp.echo2.app.Button createButton(java.lang.String name)
          Create the button identified by the specified name.
private  nextapp.echo2.app.Component createCheckBoxes()
          Create the column necessary to display the check boxes and also create the required check boxes.
private  nextapp.echo2.app.Label createLabel(java.lang.String name, nextapp.echo2.app.Component component)
          Create a label using the specified name property and add it to the specified component.
private  nextapp.echo2.app.Component createListBox()
          Create the list box component.
private  nextapp.echo2.app.Component createSelectField()
          Create the select field component.
private  nextapp.echo2.app.Component createTextArea(java.lang.String name)
          Create the label and text area necessary to display the UI components.
private  nextapp.echo2.app.Component createTextField(java.lang.String name)
          Create the label and text field necessary to display the UI components.
private  void doDelete()
          The action for the delete button.
private  void doNavigate(int index)
          The action for the navigation buttons.
private  void doSave()
          The action for the save button.
 JDOModelPropertyChangeListener getDataChangeListener()
          Returns jdoChangeListener.
 InputFormModel getFormData()
          Returns model.
private  void initForm()
          Initialise the UI components for the form.
private  void setIndexValue(int index)
          Set the text of the index label.
(package private)  void setModel(InputFormModel model)
          Set model.
private  void setText(nextapp.echo2.app.text.TextComponent text)
          Set the text for the specified TextComponent from the value in the model data bean through jdoChangeListener.
 
Methods inherited from class nextapp.echo2.app.ContentPane
getBackgroundImage, getHorizontalScroll, getVerticalScroll, isValidChild, isValidParent, processInput, setBackgroundImage, setHorizontalScroll, setVerticalScroll
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

private InputFormModel model
The java bean used to store the values of the data for the UI components.


jdoChangeListener

private JDOModelPropertyChangeListener jdoChangeListener
The property change listener used to synchronise modifications applied to UI components to the model java bean.


uiChangeListener

private ViewPropertyChangeListener uiChangeListener
The property change listener used to synchronise modifications applied to the model java bean to the UI components.


textField

private nextapp.echo2.app.TextField textField

textArea

private nextapp.echo2.app.TextArea textArea

checkBoxes

private java.util.HashMap<java.lang.String,nextapp.echo2.app.CheckBox> checkBoxes

listBox

private nextapp.echo2.app.ListBox listBox

selectField

private nextapp.echo2.app.SelectField selectField

first

private nextapp.echo2.app.Button first

previous

private nextapp.echo2.app.Button previous

last

private nextapp.echo2.app.Button last

next

private nextapp.echo2.app.Button next

save

private nextapp.echo2.app.Button save

delete

private nextapp.echo2.app.Button delete

index

private nextapp.echo2.app.Label index
Constructor Detail

InputForm

public InputForm()
Create a new instance of the form.

See Also:
initForm()

InputForm

public InputForm(InputFormModel model)
Create a new instance of the form using the specified java bean.

Parameters:
model - The java bean to use to store the values of the UI components.
See Also:
initForm()
Method Detail

initForm

private void initForm()
Initialise the UI components for the form.

See Also:
createTextField(java.lang.String), createTextArea(java.lang.String), createCheckBoxes(), createSelectField(), createListBox(), createButton(java.lang.String)

createTextField

private nextapp.echo2.app.Component createTextField(java.lang.String name)
Create the label and text field necessary to display the UI components.

Parameters:
name - The name used to identify the text field to create. The name must match the name of the appropriate field without the Field suffix (eg. userName, salary, ...). The same name must be configured in the configuration file for the properties and resources.
Returns:
Component The new component that contains the newly created UI components.
See Also:
createLabel(java.lang.String, nextapp.echo2.app.Component), setText(nextapp.echo2.app.text.TextComponent)

createLabel

private nextapp.echo2.app.Label createLabel(java.lang.String name,
                                            nextapp.echo2.app.Component component)
Create a label using the specified name property and add it to the specified component.

Parameters:
name - The name used to identify the label to create. The same name must be configured in the configuration file for the properties and resources.

setText

private void setText(nextapp.echo2.app.text.TextComponent text)
Set the text for the specified TextComponent from the value in the model data bean through jdoChangeListener.

Note: It is mandatory that the ActionCommand for the TextComponent be set prior to invoking this method.

Parameters:
text - The text component whose text is to be set.

createTextArea

private nextapp.echo2.app.Component createTextArea(java.lang.String name)
Create the label and text area necessary to display the UI components.

Parameters:
name - The name used to identify the text area to create. The name must match the name of the appropriate area without the Area suffix (eg. userName, salary, ...). The same name must be configured in the configuration file for the properties and resources.
Returns:
Component The new component that contains the newly created UI components.
See Also:
createLabel(java.lang.String, nextapp.echo2.app.Component), setText(nextapp.echo2.app.text.TextComponent)

createCheckBoxes

private nextapp.echo2.app.Component createCheckBoxes()
Create the column necessary to display the check boxes and also create the required check boxes.


createSelectField

private nextapp.echo2.app.Component createSelectField()
Create the select field component.


createListBox

private nextapp.echo2.app.Component createListBox()
Create the list box component.


createButton

private nextapp.echo2.app.Button createButton(java.lang.String name)
Create the button identified by the specified name.

Parameters:
name - The name used to identify the button to create. The name must match the name of the appropriate button. The same name must be configured in the configuration file for the properties and resources.
Returns:
Component The new component that contains the newly created UI components.

setIndexValue

private void setIndexValue(int index)
Set the text of the index label. Enable or disable the navigation buttons depending upon the values.

Parameters:
index - The index value to set.

getFormData

public final InputFormModel getFormData()
Returns model.

Returns:
InputFormModel The value/reference of/to model.

setModel

final void setModel(InputFormModel model)
Set model.

Parameters:
model - The value to set.

getDataChangeListener

public final JDOModelPropertyChangeListener getDataChangeListener()
Returns jdoChangeListener.

Returns:
JDOModelPropertyChangeListener The value/reference of/to jdoChangeListener.

actionPerformed

public void actionPerformed(nextapp.echo2.app.event.ActionEvent event)
ActionListener implementation. Actions are triggered when a button is pressed.

Specified by:
actionPerformed in interface nextapp.echo2.app.event.ActionListener
Parameters:
event - The event that contains the information pertaining to the action.

doSave

private void doSave()
The action for the save button.


doDelete

private void doDelete()
The action for the delete button.


doNavigate

private void doNavigate(int index)
The action for the navigation buttons.

Parameters:
index - The index in a List of InputFormModel objects at which the object is to be retrieved.


Copyright © 2006 Sans Pareil Technologies, Inc. All Rights Reserved.