ch.uzh.ifi.attempto.preditor
Class WordEditorForm

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by nextapp.echo.app.ContentPane
          extended by ch.uzh.ifi.attempto.preditor.WordEditorForm
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, nextapp.echo.app.event.ActionListener, nextapp.echo.app.Pane, nextapp.echo.app.PaneContainer, nextapp.echo.app.RenderIdSupport
Direct Known Subclasses:
FormPane

public class WordEditorForm
extends nextapp.echo.app.ContentPane
implements nextapp.echo.app.event.ActionListener

This class represents a form that appears within a tab of the word editor window. Such a form contains the form elements for a certain class of words.

Author:
Tobias Kuhn
See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo.app.ContentPane
OVERFLOW_AUTO, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, PROPERTY_BACKGROUND_IMAGE, PROPERTY_HORIZONTAL_SCROLL, PROPERTY_INSETS, PROPERTY_OVERFLOW, PROPERTY_VERTICAL_SCROLL
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_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
WordEditorForm(java.lang.String title, nextapp.echo.app.WindowPane parentWindow, nextapp.echo.app.event.ActionListener actionListener)
          Creates a new word editor form.
WordEditorForm(nextapp.echo.app.WindowPane parentWindow, nextapp.echo.app.event.ActionListener actionListener)
          Creates a new word editor form.
 
Method Summary
 void actionPerformed(nextapp.echo.app.event.ActionEvent e)
           
 void addButton(java.lang.String buttonText)
          Adds a button to the button bar.
 void addRow(java.lang.String labelText, nextapp.echo.app.Component formElement, java.lang.String explanation, boolean required)
          Adds a new row to the form.
protected  void doFocus()
          This method sets the focus on the first enabled text field of this form.
 nextapp.echo.app.event.ActionListener getActionListener()
          Returns the action-listener.
 java.util.List<nextapp.echo.app.Component> getFormElements()
          Returns all form elements.
 nextapp.echo.app.WindowPane getParentWindow()
          Return the parent window of this form.
 java.util.List<nextapp.echo.app.Component> getRequiredFormElements()
          Returns all form elements that are marked as required.
 java.util.List<java.lang.String> getRequiredTextFieldContents()
          Returns the content of all form elements that are text fields.
 java.lang.String getTitle()
          Returns the title of the word editor form.
 void setButtons(java.lang.String... buttonTexts)
          Removes all existing buttons and adds the given buttons to the button bar.
 void setExplanationComponent(nextapp.echo.app.Component comp)
          Sets the explanation component.
 void setTitle(java.lang.String title)
          Sets the title of this form.
 
Methods inherited from class nextapp.echo.app.ContentPane
getBackgroundImage, getHorizontalScroll, getInsets, getOverflow, getVerticalScroll, isValidChild, isValidParent, processInput, setBackgroundImage, setHorizontalScroll, setInsets, setOverflow, setVerticalScroll
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WordEditorForm

public WordEditorForm(nextapp.echo.app.WindowPane parentWindow,
                      nextapp.echo.app.event.ActionListener actionListener)
Creates a new word editor form.

Parameters:
parentWindow - The parent window.
actionListener - The action-listener.

WordEditorForm

public WordEditorForm(java.lang.String title,
                      nextapp.echo.app.WindowPane parentWindow,
                      nextapp.echo.app.event.ActionListener actionListener)
Creates a new word editor form.

Parameters:
title - The title of the word editor form.
parentWindow - The parent window.
actionListener - The action-listener.
Method Detail

setTitle

public void setTitle(java.lang.String title)
Sets the title of this form.

Parameters:
title - The title.

getTitle

public java.lang.String getTitle()
Returns the title of the word editor form.

Returns:
The title.

getParentWindow

public nextapp.echo.app.WindowPane getParentWindow()
Return the parent window of this form.

Returns:
The parent window.

getActionListener

public nextapp.echo.app.event.ActionListener getActionListener()
Returns the action-listener.

Returns:
The action-listener.

addButton

public void addButton(java.lang.String buttonText)
Adds a button to the button bar.

Parameters:
buttonText - The text of the button.

setButtons

public void setButtons(java.lang.String... buttonTexts)
Removes all existing buttons and adds the given buttons to the button bar.

Parameters:
buttonTexts - The texts for the buttons.

addRow

public void addRow(java.lang.String labelText,
                   nextapp.echo.app.Component formElement,
                   java.lang.String explanation,
                   boolean required)
Adds a new row to the form.

Parameters:
labelText - The text for the label shown on the left hand side of the component.
formElement - The component, i.e. a text field.
explanation - An explanation text shown under the component.
required - Defines whether the component should be marked as required.

setExplanationComponent

public void setExplanationComponent(nextapp.echo.app.Component comp)
Sets the explanation component. The explanation component is shown above the form elements and should explain how these form elements have to be used.

Parameters:
comp - The graphical component.

getFormElements

public java.util.List<nextapp.echo.app.Component> getFormElements()
Returns all form elements.

Returns:
A list of all form elements.

getRequiredFormElements

public java.util.List<nextapp.echo.app.Component> getRequiredFormElements()
Returns all form elements that are marked as required.

Returns:
A list of all required form elements.

getRequiredTextFieldContents

public java.util.List<java.lang.String> getRequiredTextFieldContents()
Returns the content of all form elements that are text fields.

Returns:
A list of the content of all form elements that are text fields.

doFocus

protected void doFocus()
This method sets the focus on the first enabled text field of this form.


actionPerformed

public void actionPerformed(nextapp.echo.app.event.ActionEvent e)
Specified by:
actionPerformed in interface nextapp.echo.app.event.ActionListener


Copyright 2008-2012, AceWiki developers