com.aspose.html.forms

Class FormEditor

  • java.lang.Object
    • com.aspose.html.forms.FormEditor
  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FormElementBase>, com.aspose.ms.System.Collections.IEnumerable<FormElementBase>, com.aspose.ms.System.IDisposable, java.lang.Iterable<FormElementBase>


    public class FormEditor
    extends java.lang.Object
    implements com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FormElementBase>, com.aspose.ms.System.IDisposable

    This class represents the editor over the HTMLFormElement that creates a easier way for .net developers to edit the html forms.

    • Method Detail

      • getCount

        public int getCount()

        The number of form controls in the form.

      • setMethod

        public void setMethod(HttpMethod value)
      • getAction

        public java.lang.String getAction()

        Server-side form handler. See the action attribute definition in HTML 4.01.

      • setAction

        public void setAction(java.lang.String value)

        Server-side form handler. See the action attribute definition in HTML 4.01.

      • add

        public <T extends FormElementBase> T add(java.lang.String name,
                                                 java.lang.Class<T> clazz)

        Creates a new HTMLElement and adds it to the end of the form.

        Parameters:
        name - Name of the element

        T: Type of form element

        Returns:
        A new instance of form element
      • addInput

        public InputElement addInput(java.lang.String name)

        Creates a new InputElement and adds it to the end of the form.

        Parameters:
        name - Name of input element
        Returns:
        Returns a new created InputElement.
      • addInput

        public InputElement addInput(java.lang.String name,
                                     int type)

        Creates a new InputElement and adds it to the end of the form.

        Parameters:
        name - Name of input element
        type - Type of input element
        Returns:
        Returns a new created InputElement.
      • get_Item

        public FormElementBase get_Item(int index)

        Returns the element by specified index.

        Parameters:
        index - The index of the element
        Returns:
        Returns the element.
      • get_Item

        public FormElementBase get_Item(java.lang.String name)

        Returns the element by specified name or id.

        Parameters:
        name - The element name
        Returns:
        Returns the element.
      • getElement

        public <T extends FormElementBase> T getElement(java.lang.Class<T> typeOfT,
                                                        int index)

        Returns the element by specified index.

        Parameters:
        index - The index of the element

        T: Type of the form element

        Returns:
        Returns the element.
      • getElement

        public <T extends FormElementBase> T getElement(java.lang.Class<T> typeOfT,
                                                        java.lang.String name)

        Returns the element by specified name.

        Parameters:
        name - The element name

        T: Type of the form element

        Returns:
        Returns the element.
      • fill

        @Deprecated
        public void fill(com.aspose.ms.System.Collections.Generic.IGenericDictionary<java.lang.String,java.lang.String> values)
        Deprecated. 

        This method fills the whole form with the specified values.

        Parameters:
        values - The values represented by key-value pair that is contains name and value for form elements.
      • fill

        public void fill(java.util.Map values)
      • iterator

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<FormElementBase> iterator()

        Gets the enumerator.

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FormElementBase>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<FormElementBase>
        Specified by:
        iterator in interface java.lang.Iterable<FormElementBase>
        Returns:
        Returns the FormElements enumerator.
      • dispose

        public void dispose()

        Releases unmanaged and managed resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable