Class CPDFWidgetItems
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.form.CPDFWidget
com.compdfkit.core.annotation.form.CPDFWidgetItems
- Direct Known Subclasses:
CPDFComboboxWidget,CPDFListboxWidget
Parent of Listbox or ComboBox forms.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compdfkit.core.annotation.form.CPDFWidget
CPDFWidget.BorderStyle, CPDFWidget.CheckStyle, CPDFWidget.WidgetTypeNested classes/interfaces inherited from class com.compdfkit.core.annotation.CPDFAnnotation
CPDFAnnotation.AppearanceType, CPDFAnnotation.PSOAnnotationState, CPDFAnnotation.Type -
Method Summary
Modifier and TypeMethodDescriptionintGets the total count of items in ListBox or ComboBox.getOptionByIndex(int index) Gets the option by index in ListBox or ComboBox.Gets all options in ListBox or ComboBox.int[]Gets the list of indexes with a selected option in ListBox or ComboBox.Gets the attribute of items in ListBox or ComboBox, more:CPDFTextAttributebooleanWhether to allow to select multiple items in Listbox.booleanResets form.booleansetOptionItems(CPDFWidgetItem[] items) Sets the options for the ListBox or ComboBox, The text value of eachCPDFWidgetItemis not allowed to be equal, otherwise the setting will be failed.booleansetOptionItems(CPDFWidgetItem[] items, int[] selectIndexes) 给ListBox或者ComboBox设置条目,并且设置这些条目中被选择的下标。 每个条目的text值不允许相等,否则会设置失败。如果booleansetSelectedIndexes(int[] index) Sets the index items as selected in ListBox or ComboBox.booleansetTextProperty(CPDFTextAttribute freetextDa) Sets Freetext font style.Methods inherited from class com.compdfkit.core.annotation.form.CPDFWidget
clearBorderColor, clearFillColor, getBorderColor, getBorderStyles, getBorderWidth, getCheckStyle, getFieldFlag, getFieldName, getFieldType, getFillAlpha, getFillColor, getRect, getWidgetType, isReadOnly, setBorderColor, setBorderStyles, setBorderWidth, setCheckStyle, setFieldFlag, setFieldName, setFieldType, setFillAlpha, setFillColor, setReadOnly, setRect, updateAp, updateApMethods inherited from class com.compdfkit.core.annotation.CPDFAnnotation
addToPage, close, createReplyAnnotation, createReplyStateAnnotation, getContent, getCreationDate, getFlags, getMainAnnotNM, getName, getRecentlyModifyDate, getReplies, getState, getTitle, getType, hasAp, isAllowCorrectAnnotationAp, isExitMainAnnot, isHidden, isLocked, isMarkedStateAnnot, isReplyAnnot, isReviewStateAnnot, isValid, removeFromPage, removeFromPageIncludeReplyAnnot, setAllowCorrectAnnotationAp, setContent, setCreationDate, setFlags, setHidden, setLocked, setMarkedAnnotState, setName, setRecentlyModifyDate, setReviewAnnotState, setState, setTitle
-
Method Details
-
getOptions
Gets all options in ListBox or ComboBox. More:CPDFWidgetItem- Returns:
- Returns all options in ListBox or ComboBox.
-
getSelectedIndexes
public int[] getSelectedIndexes()Gets the list of indexes with a selected option in ListBox or ComboBox. May return null.- Returns:
- Returns all indexes with a selected option in ListBox or ComboBox.
-
getOptionByIndex
Gets the option by index in ListBox or ComboBox.- Parameters:
index- The index value of the option.- Returns:
- Returns the index option in ListBox or ComboBox.
-
setSelectedIndexes
public boolean setSelectedIndexes(int[] index) Sets the index items as selected in ListBox or ComboBox.- Parameters:
index- The index of selected items.- Returns:
- Returns whether to successfully select items in ListBox or ComboBox.
-
getItemCount
public int getItemCount()Gets the total count of items in ListBox or ComboBox.- Returns:
- Returns the total count of items in ListBox or ComboBox.
-
isMultiSelectListBox
public boolean isMultiSelectListBox()Whether to allow to select multiple items in Listbox.- Returns:
- Listbox Returns whether to allow to select multiple items in Listbox.
-
resetForm
public boolean resetForm()Resets form.- Overrides:
resetFormin classCPDFWidget- Returns:
- Returns whether to reset form.
-
setOptionItems
给ListBox或者ComboBox设置条目,并且设置这些条目中被选择的下标。 每个条目的text值不允许相等,否则会设置失败。如果- Parameters:
items-- Returns:
-
setOptionItems
Sets the options for the ListBox or ComboBox, The text value of eachCPDFWidgetItemis not allowed to be equal, otherwise the setting will be failed.- Parameters:
items- Array of options- Returns:
- Returns whether to successfully set the options for the ListBox or ComboBox
-
setTextProperty
Sets Freetext font style.- Parameters:
freetextDa- Font style.- Returns:
- Returns whether to successfully set Freetext font style.
-
getTextProperty
Gets the attribute of items in ListBox or ComboBox, more:CPDFTextAttribute- Returns:
- Returns the attribute of items in ListBox or ComboBox.
-