Class CPDFWidgetItems

Direct Known Subclasses:
CPDFComboboxWidget, CPDFListboxWidget

public abstract class CPDFWidgetItems extends CPDFWidget
Parent of Listbox or ComboBox forms.
See Also:
  • Method Details

    • getOptions

      public CPDFWidgetItem[] 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

      public CPDFWidgetItem getOptionByIndex(int index)
      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:
      resetForm in class CPDFWidget
      Returns:
      Returns whether to reset form.
    • setOptionItems

      public boolean setOptionItems(CPDFWidgetItem[] items, int[] selectIndexes)
      给ListBox或者ComboBox设置条目,并且设置这些条目中被选择的下标。 每个条目的text值不允许相等,否则会设置失败。如果
      Parameters:
      items -
      Returns:
    • setOptionItems

      public boolean setOptionItems(CPDFWidgetItem[] items)
      Sets the options for the ListBox or ComboBox, The text value of each CPDFWidgetItem is 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

      public boolean setTextProperty(CPDFTextAttribute freetextDa)
      Sets Freetext font style.
      Parameters:
      freetextDa - Font style.
      Returns:
      Returns whether to successfully set Freetext font style.
    • getTextProperty

      public CPDFTextAttribute getTextProperty()
      Gets the attribute of items in ListBox or ComboBox, more: CPDFTextAttribute
      Returns:
      Returns the attribute of items in ListBox or ComboBox.