com.aspose.html.forms

Class FormEditor

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


    public class FormEditor
    extends Object
    implements com.aspose.html.internal.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.html.forms.FormElementBase>, com.aspose.html.internal.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 String getAction()

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

      • setAction

        public void setAction(String value)

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

      • add

        public <T extends com.aspose.html.forms.FormElementBase> T add(String name,
                                                                       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(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 com.aspose.html.forms.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 com.aspose.html.forms.FormElementBase get_Item(String name)

        Returns the element by specified name or id.

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

        public <T extends com.aspose.html.forms.FormElementBase> T getElement(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 com.aspose.html.forms.FormElementBase> T getElement(Class<T> typeOfT,
                                                                              String name)

        Returns the element by specified name.

        Parameters:
        name - The element name

        T: Type of the form element

        Returns:
        Returns the element.
      • fill

        public void fill(com.aspose.html.internal.ms.System.Collections.Generic.Dictionary<String,String> values)

        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.
      • iterator

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

        Gets the enumerator.

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

        public void dispose()

        Releases unmanaged and managed resources.

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