|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.Container
org.apache.pivot.wtk.Form
@DefaultProperty(value="sections") public class Form
A container that arranges field components in a form layout. Each field has an optional text label associated with it and may be flagged as requiring attention using one of several flag types and an optional flag message (for use during form validation, for example).
Nested Class Summary | |
---|---|
static class |
Form.Flag
Represents an message alert associated with a form field. |
static class |
Form.Section
Class representing a form section. |
class |
Form.SectionSequence
Section sequence implementation. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container |
---|
Container.EDT_Checker |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
Form()
Creates a new form. |
Method Summary | |
---|---|
static void |
clearFlag(Component component)
|
void |
clearFlags()
Clears all field flags. |
static Form.Section |
getEnclosingSection(Component component)
Finds the Form.Section that the given component belongs to. |
static Form.Flag |
getFlag(Component component)
|
int |
getFlaggedFieldCount(MessageType messageType)
Returns the number of fields that are flagged with a given message type. |
ListenerList<FormAttributeListener> |
getFormAttributeListeners()
Returns the form attribute listener list. |
ListenerList<FormListener> |
getFormListeners()
Returns the form listener list. |
static String |
getLabel(Component component)
|
static Form.Section |
getSection(Component component)
Finds the Form.Section that the given component belongs to. |
Form.SectionSequence |
getSections()
Returns the form's field sequence. |
static boolean |
isRequired(Component component)
|
Sequence<Component> |
remove(int index,
int count)
Removes one or more items from the sequence. |
void |
scrollFirstFlagToVisible(MessageType messageType)
Ensures that the first field with the given flag type is visible. |
static void |
setFlag(Component component,
Form.Flag flag)
|
static void |
setFlag(Component component,
String flag)
|
static void |
setLabel(Component component,
String label)
|
static void |
setRequired(Component component,
boolean required)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Form()
Method Detail |
---|
public Form.SectionSequence getSections()
public void clearFlags()
public int getFlaggedFieldCount(MessageType messageType)
messageType
- The message type to count, or null to return the count of all
flagged fields regardless of message type.public void scrollFirstFlagToVisible(MessageType messageType)
messageType
- The message type, or null to scroll the first flag of any
type to visible.public Sequence<Component> remove(int index, int count)
Sequence
remove
in interface Sequence<Component>
remove
in class Container
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
public ListenerList<FormListener> getFormListeners()
public ListenerList<FormAttributeListener> getFormAttributeListeners()
public static Form.Section getSection(Component component)
Form.Section
that the given component belongs to.
Only finds the section if the component is a direct child of the section.
getEnclosingSection(Component)
public static Form.Section getEnclosingSection(Component component)
Form.Section
that the given component belongs to.
Will search up the parent hierarchy in case the component is nested inside
other containers inside the form.
null
if the component does not belong to a form.getSection(Component)
public static String getLabel(Component component)
public static void setLabel(Component component, String label)
public static boolean isRequired(Component component)
public static void setRequired(Component component, boolean required)
public static Form.Flag getFlag(Component component)
public static void setFlag(Component component, Form.Flag flag)
public static final void setFlag(Component component, String flag)
public static final void clearFlag(Component component)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |