org.jurvis.swing.form
Interface JvField

All Known Implementing Classes:
JvAbstractField, JvEnumeratorField, JvPropertyEditorField

public interface JvField

Interface defining a field within a form. Input fields may be represented by JTextFields, JEditorPanes, JComboBoxes, JCheckBoxes, or any third-party GUI control. The purpose of this interface is to abstract a common interface for all this controls.

JvFields are expected to be displayed on a input form (probably JvForm). They are identified to the user via some text displayed within a JLabel.

Author:
Neil W. Weber

Method Summary
 String getAsText()
          Gets the property value as text.
 JComponent getComponent()
          Gets the component used to implement this field.
 JLabel getLabel()
          Gets the label used for this field.
 String getName()
          Return the name of this field.
 Object getValue()
          Gets the field value.
 JComponent getWrapper()
          Gets the component used to wrap the component implementing this field.
 boolean isEditable()
          Returns the boolean indicating whether this field is editable or not.
 boolean isEnabled()
          Determines whether this field is enabled.
 void setEditable(boolean editable)
          Sets the specified boolean to indicate whether or not this field should be editable.
 void setEnabled(boolean enabled)
          Sets whether or not this field is enabled.
 void setValue(Object value)
          Set (or change) the object that is to be edited.
 

Method Detail

getName

String getName()
Return the name of this field.

Returns:
the field's name

getValue

Object getValue()
Gets the field value.

Returns:
The value of the field. Primitive types such as "int" will be wrapped as the corresponding object type such as "java.lang.Integer".

setValue

void setValue(Object value)
Set (or change) the object that is to be edited. Primitive types such as "int" must be wrapped as the corresponding object type such as "java.lang.Integer".

Parameters:
value - The new target object to be edited. Note that this object is not modified during editing, rather a new object is created to hold the modified value.

getAsText

String getAsText()
Gets the property value as text.

Returns:
the property value as a human editable string

isEnabled

boolean isEnabled()
Determines whether this field is enabled.

Returns:
true if the field is enabled; false otherwise
See Also:
setEnabled(boolean)

setEnabled

void setEnabled(boolean enabled)
Sets whether or not this field is enabled. A field that is enabled may respond to user input, while a field that is not enabled cannot respond to user input. Some fields may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input.

Parameters:
enabled - the new enabled value

isEditable

boolean isEditable()
Returns the boolean indicating whether this field is editable or not.

Returns:
true if the field is editable

setEditable

void setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this field should be editable.

Parameters:
editable - the new editable value

getLabel

JLabel getLabel()
Gets the label used for this field.

Returns:
the field's label

getComponent

JComponent getComponent()
Gets the component used to implement this field.

Returns:
the component implementing this field

getWrapper

JComponent getWrapper()
Gets the component used to wrap the component implementing this field. For example, a JScrollPane. If no wrapping component is needed, this method returns the component.

Returns:
the wrapper component


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.