com.inet.html.views.form
Class Form

java.lang.Object
  extended by com.inet.html.views.form.Form
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.util.EventListener

public class Form
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.KeyListener

Represents one form with it's element, parameters and controls.


Constructor Summary
Form(javax.swing.text.Element formElement)
          Constructs a new form containert
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Will be called on submit or reset to perform this action
 void addControl(BoxView control)
          Adds a control to the current form.
 boolean isEmpty()
          Checks whether any controls are registered to this form container
 void keyPressed(java.awt.event.KeyEvent e)
          
 void keyReleased(java.awt.event.KeyEvent e)
          
 void keyTyped(java.awt.event.KeyEvent e)
          Checks key inputs for a return-submit on a non-text control
 void removeControl(BoxView control)
          Removes a control from the current form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Form

public Form(javax.swing.text.Element formElement)
Constructs a new form containert

Parameters:
formElement - the model element, which defines the form. May be null to use this object as a default container
Method Detail

addControl

public void addControl(BoxView control)
Adds a control to the current form. The control will be monitored by this form concerning submit, reset or inputs.

Parameters:
control - the control to add to this form

removeControl

public void removeControl(BoxView control)
Removes a control from the current form. This has to be called whenever a view control view is disposed to clean up the form-references.

Parameters:
control - the control view to remove

isEmpty

public boolean isEmpty()
Checks whether any controls are registered to this form container

Returns:
true, if this form has at least one control

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Will be called on submit or reset to perform this action

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the action event which initiated this action

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Checks key inputs for a return-submit on a non-text control

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - the key event to check