javax.swing.text.html
Class FormView.SubmitThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjavax.swing.text.html.FormView.SubmitThread
All Implemented Interfaces:
Runnable
Enclosing class:
FormView

class FormView.SubmitThread
extends Thread

The SubmitThread is responsible for submitting the form. It performs a POST or GET based on the value of method attribute associated with HTML.Tag.FORM. In addition to submitting, it is also responsible for display the results of the form submission.


Field Summary
(package private)  String data
           
(package private)  AttributeSet formAttr
           
(package private)  HTMLDocument hdoc
           
(package private)  InputStream in
           
(package private)  HTMLDocument newDoc
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FormView.SubmitThread(Element elem, String data)
           
 
Method Summary
 String getAction()
          Get the value of the action attribute.
(package private)  String getMethod()
          Get the form's method parameter.
 void loadDocument()
          This method is responsible for loading the document into the FormView's container, which is a JEditorPane.
 void postData(URLConnection connection, String data)
          This method is responsible for writing out the form submission data when the method is POST.
 void run()
          This method is responsible for extracting the method and action attributes associated with the <FORM> and using those to determine how (POST or GET) and where (URL) to submit the form.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

String data

hdoc

HTMLDocument hdoc

newDoc

HTMLDocument newDoc

formAttr

AttributeSet formAttr

in

InputStream in
Constructor Detail

FormView.SubmitThread

public FormView.SubmitThread(Element elem,
                             String data)
Method Detail

run

public void run()
This method is responsible for extracting the method and action attributes associated with the <FORM> and using those to determine how (POST or GET) and where (URL) to submit the form. If action is not specified, the base url of the existing document is used. Also, if method is not specified, the default is GET. Once form submission is done, run uses the SwingUtilities.invokeLater() method, to load the results of the form submission into the current JEditorPane.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.start(), Thread.stop(), Thread.Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String), Runnable.run()

loadDocument

public void loadDocument()
This method is responsible for loading the document into the FormView's container, which is a JEditorPane.


getAction

public String getAction()
Get the value of the action attribute.


getMethod

String getMethod()
Get the form's method parameter.


postData

public void postData(URLConnection connection,
                     String data)
This method is responsible for writing out the form submission data when the method is POST.

Parameters:
connection - to use.
data - to write.