com.crionics.jpdf.forms
Class TextField

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.forms.AbstractField
          extended by com.crionics.jpdf.forms.TextField

public class TextField
extends AbstractField

Represents a Textfield form object


Method Summary
static TextField createInstance(PdfDocument doc, java.lang.String name, int pageIndex, java.awt.Rectangle rect)
           
 java.lang.String getDefaultValue()
          Returns the Form Field default value.
 int getMaxChars()
          Returns the maximum number of chars allowed for this field
 int getTextJustification()
          Returns the text justification, LEFT, CENTERED or RIGHT
 java.lang.String getValue()
          Returns the Form Field value.
 boolean hasValue()
          return true if the field has a value defined
 boolean isCheckSpelled()
          Returns true if the spell checker should check this field
 boolean isMultiline()
          returns true if the field is multiline
 boolean isPassword()
          returns true if the field is a password
 boolean isRichText()
          return true if the field accepts Rich Text xml values.
 boolean isScrollingLongText()
          returns true if the field is scrolling long text
 void setCheckSpelled(boolean checkSpell)
          Sets a flag which tells if the viewer should spell check the field
 void setDefaultValue(java.lang.String value)
          Sets the Form Field default value.
 void setMaxChars(int max)
          Sets the maximum number of characters allowed for this field
 void setMultiline(boolean multiline)
          Set the setting which controls if the field accepts strings that show on more than one line
 void setPassword(boolean password)
          Sets the flag as a password field, clears Value and Default Value when property is set
 void setRichText(boolean richText)
          Sets if the field accepts rich text input.
 void setScrollLongText(boolean scrollLongText)
          Set the setting which controls if the field to resize the its content to fit the area or the field, or allow the scrolling of its content.
 void setTextJustification(int justification)
          Sets the text justification, must be one of the values in ITextJustification
 void setValue(java.lang.String value)
          Sets the Form Field value.
 
Methods inherited from class com.crionics.jpdf.forms.AbstractField
getAssociatedPageIndex, getBorderColor, getBorderStyle, getBorderWidth, getFillColor, getName, getOrientation, getPosition, getTextColor, getTextFont, getTextSize, getToolTip, isHidden, isPrintable, isReadOnly, setBorderColor, setBorderStyle, setBorderWidth, setFillColor, setHidden, setOrientation, setPosition, setPrintable, setReadOnly, setTextColor, setTextFont, setTextFont, setTextSize, setToolTip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static TextField createInstance(PdfDocument doc,
                                       java.lang.String name,
                                       int pageIndex,
                                       java.awt.Rectangle rect)
                                throws PdfException,
                                       java.io.IOException
Throws:
PdfException
java.io.IOException

getDefaultValue

public java.lang.String getDefaultValue()
                                 throws PdfException,
                                        java.io.IOException
Returns the Form Field default value.

Returns:
The Form Field default value or null if none is present.
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

getMaxChars

public int getMaxChars()
                throws PdfException,
                       java.io.IOException
Returns the maximum number of chars allowed for this field

Returns:
the maximum number of chars allowed for this field, 0 no limits
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

getTextJustification

public int getTextJustification()
                         throws PdfException,
                                java.io.IOException
Returns the text justification, LEFT, CENTERED or RIGHT

Returns:
one the entries in ITextJustification
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

getValue

public java.lang.String getValue()
                          throws PdfException,
                                 java.io.IOException
Returns the Form Field value.

Returns:
The Form Field value or null.
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

hasValue

public boolean hasValue()
                 throws java.io.IOException,
                        PdfException
return true if the field has a value defined

Returns:
true if the field has a value defined
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

isCheckSpelled

public boolean isCheckSpelled()
Returns true if the spell checker should check this field

Returns:
true if the spell checker should check this field

isMultiline

public boolean isMultiline()
returns true if the field is multiline

Returns:
true if the field is multiline

isPassword

public boolean isPassword()
returns true if the field is a password

Returns:
true if the field is a password

isRichText

public boolean isRichText()
return true if the field accepts Rich Text xml values.

Returns:
true if the field accepts Rich Text xml values.

isScrollingLongText

public boolean isScrollingLongText()
returns true if the field is scrolling long text

Returns:
true if the field is scrolling long text

setCheckSpelled

public void setCheckSpelled(boolean checkSpell)
                     throws PdfException,
                            java.io.IOException
Sets a flag which tells if the viewer should spell check the field

Parameters:
checkSpell - true will activate spell checking on this field
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setDefaultValue

public void setDefaultValue(java.lang.String value)
                     throws PdfException,
                            java.io.IOException
Sets the Form Field default value.

Parameters:
value - The Form Field default value to set.
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setMaxChars

public void setMaxChars(int max)
                 throws PdfException,
                        java.io.IOException
Sets the maximum number of characters allowed for this field

Parameters:
max - the maximum number of characters for this field
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setMultiline

public void setMultiline(boolean multiline)
                  throws PdfException,
                         java.io.IOException
Set the setting which controls if the field accepts strings that show on more than one line

Parameters:
multiline - true if the field accept multiline inputs
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setPassword

public void setPassword(boolean password)
                 throws PdfException,
                        java.io.IOException
Sets the flag as a password field, clears Value and Default Value when property is set

Parameters:
password - true is field data must be hidden
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setRichText

public void setRichText(boolean richText)
                 throws PdfException,
                        java.io.IOException
Sets if the field accepts rich text input. Rich Text field do not need to have a uniform style, they can easily hold bols, italics , colors..etc See online tutorial for further details on the XML grammar to set their value.

Parameters:
richText - true if the field accepts rich text input
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setScrollLongText

public void setScrollLongText(boolean scrollLongText)
                       throws PdfException,
                              java.io.IOException
Set the setting which controls if the field to resize the its content to fit the area or the field, or allow the scrolling of its content.

Parameters:
scrollLongText - true if the field scroll long text, false to resize the font.
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setTextJustification

public void setTextJustification(int justification)
                          throws PdfException,
                                 java.io.IOException
Sets the text justification, must be one of the values in ITextJustification

Parameters:
justification - one of ITextJustification
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.

setValue

public void setValue(java.lang.String value)
              throws PdfException,
                     java.io.IOException
Sets the Form Field value.

Parameters:
value - The Form Field value to set.
Throws:
PdfException - Raised if a problem occurred while parsing the file.
java.io.IOException - Raised if a problem occurred while reading the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.