|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FIM.Util.WWW.Form.FormElement | +--FIM.Util.WWW.Form.SelectableElement
Parent class for elements, which may be selected (on/off only).
All those elements must belong to a ElementGroup
(which might contain only a
single selectable element). Forms are stored flat, so the groups are not the parent of those elements!
ElementGroup
, Serialized FormField Summary | |
(package private) boolean |
selected
Whether this element is selected or not. |
Fields inherited from class FIM.Util.WWW.Form.FormElement |
attributes, children |
Constructor Summary | |
SelectableElement(HTMLDocument doc,
Element parent,
ElementGroup group,
int startOffs,
int endOffs,
String name,
String value,
boolean initiallySelected)
Creates a new INPUT/HIDDEN element, which just stores a piece of text. |
Method Summary | |
void |
deselect()
Sets the state of the element to not selected. |
String |
getEncoded()
Selectable elements are never encoded (this is done by the group, they belong to), so throws always a IllegalStateException . |
ElementGroup |
getGroup()
Retrieve the group this element belongs to. |
String |
getValue()
Retrieve the value of this element. |
boolean |
isSelected()
Retrieve whether this element is currently selected or not. |
int |
match(String[] matchStr)
Matches this element against a number of strings and returns a measure for matching them. 0=no match, 100=perfect match. Extension to FormElement : Value match=70 exact, 60 substring |
void |
reset()
Resets this element to its initial state. |
void |
select()
Sets the state of the element to selected. |
void |
setSelected(boolean isSelected)
Sets the state of this element. |
String |
toString()
Returns a string representation of the selectable element. |
Methods inherited from class FIM.Util.WWW.Form.FormElement |
getAttributes, getDocument, getElement, getElementCount, getElementIndex, getEndOffset, getLabel, getName, getParentElement, getStartOffset, isLeaf, setLabel |
Methods inherited from class java.lang.Object |
|
Field Detail |
boolean selected
Constructor Detail |
public SelectableElement(HTMLDocument doc, Element parent, ElementGroup group, int startOffs, int endOffs, String name, String value, boolean initiallySelected)
doc
- the document this element belongs toparent
- the parent of this elementgroup
- the group this element belongs tostartOffs
- start offset of the element in the documentendOffs
- end offset of the element in the documentname
- the name of the elementvalue
- the value of the element (which is submitted if it is selected) (Must be provided
according to the specification, although not always done; see HTMLForm.parseForm(HTMLDocument.Iterator)()
for more)initiallySelected
- if true
, this element is selected at the beginningMethod Detail |
public ElementGroup getGroup()
the
- group of this elementpublic void reset()
reset
in class FormElement
public void setSelected(boolean isSelected)
isSelected
- if true
, the element is selected, otherwise notpublic void select()
public void deselect()
public boolean isSelected()
true
if this element is selected, false
otherwisepublic String getValue()
public String getEncoded()
IllegalStateException
.getEncoded
in class FormElement
FIM.Util.WWW.Form.FormElement
URLEncoder
public int match(String[] matchStr)
FormElement
: Value match=70 exact, 60 substringmatch
in class FormElement
matchStr
- an array of strings which are matched against this elementpublic String toString()
toString
in class FormElement
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |