|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.FormElement
public abstract class FormElement
The FormElement
class is the baseclass for all
elements which may be added to a Form
.
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener to this FormElement. |
FormElement |
duplicate()
Create an exact copy of this FormElement, but with no annotations |
void |
flatten()
Flatten the form field so that the contents of it's annotation are permanently stamped on the page. |
PDFAction |
getAction(Event event)
Get the action that's performed when the specified event takes place on this field. |
WidgetAnnotation |
getAnnotation(int annot)
Return the specified annotation. |
List |
getAnnotations()
Return a list of all the annotations associated with this form element. |
String |
getDescription()
Return the text description of this field if specified, or null if no
description is supplied. |
Form |
getForm()
Return the form this form element belongs to |
abstract String |
getValue()
Return the value for this element. |
boolean |
isReadOnly()
Get whether the field is read-only or not. |
boolean |
isRequired()
Get whether the field is required before the form is submitted. |
boolean |
isSubmitted()
Get whether the field is submitted or not. |
void |
rebuild()
Cause the annotations to be rebuilt. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a previously added PropertyChangeListener form this FormElement. |
void |
setAction(Event event,
PDFAction action)
Set the action to perform when the specified event takes place on this field. |
void |
setDescription(String s)
Set the text description of this field. |
void |
setReadOnly(boolean readonly)
Set whether the field is read-only or not. |
void |
setRequired(boolean required)
Set whether the field is required before the form is submitted. |
void |
setSubmitted(boolean submit)
Set whether the field is submitted or not. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public FormElement duplicate()
public Form getForm()
public List getAnnotations()
WidgetAnnotation
objects, which may be
accessed from this list or via the convenience method getAnnotation(int)
.
The resulting list may have elements removed or reordered, although adding
non-widget annotations, null objects or widgets from a different field will
result in an Exception.
PDFAnnotation
objects.public WidgetAnnotation getAnnotation(int annot)
getAnnotations().get(annot)
public abstract String getValue()
FormButton
and FormSignature
return null
from this method. See the method contract in each
subclass for more detail.
public String getDescription()
null
if no
description is supplied.
public void setDescription(String s)
null
to remove it.
public void setAction(Event event, PDFAction action)
Event.KEYPRESS
, Event.FORMAT
, Event.CHANGE
and Event.OTHERCHANGE
, which are the types of event that can take place on
a FormElement. You may also want to check setAction
in the WidgetAnnotation
class to see events that are triggered on the fields
annotation, rather than the field itself.
event
- the event to place the action onaction
- the action to invoke when the specified event takes place, or null
to remove the event.
IllegalArgumentException
- if the wrong type of event is set.WidgetAnnotation.setAction(org.faceless.pdf2.Event, org.faceless.pdf2.PDFAction)
,
Event
public PDFAction getAction(Event event)
setAction(org.faceless.pdf2.Event, org.faceless.pdf2.PDFAction)
API docs.
null
if no action is specified for the event.public void setReadOnly(boolean readonly)
readonly
- whether the field is read-only or notpublic boolean isReadOnly()
public void setRequired(boolean required)
required
- whether the field is a required field or notpublic boolean isRequired()
public void setSubmitted(boolean submit)
submit
- whether the element is submitted or not.public boolean isSubmitted()
public void rebuild()
public void flatten()
Form.flatten()
method.
PDFAnnotation.flatten()
,
Form.flatten()
public void addPropertyChangeListener(PropertyChangeListener l)
PDFAnnotation.addPropertyChangeListener(java.beans.PropertyChangeListener)
,
PDFPage.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener(java.beans.PropertyChangeListener)
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |