KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > text > html > FormSubmitEvent


1 /*
2  * @(#)FormSubmitEvent.java 1.3 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.text.html;
8
9 import javax.swing.text.*;
10 import java.net.URL JavaDoc;
11
12 /**
13  * FormSubmitEvent is used to notify interested
14    * parties that a form was submited.
15  *
16  * @version 1.3 12/19/03
17    * @since 1.5
18    * @author Denis Sharypov
19  */

20
21 public class FormSubmitEvent extends HTMLFrameHyperlinkEvent JavaDoc {
22
23     /**
24      * Represents an HTML form method type.
25      * <UL>
26      * <LI><code>GET</code> corresponds to the GET form method</LI>
27      * <LI><code>POST</code> corresponds to the POST from method</LI>
28      * </UL>
29      */

30     public enum MethodType { GET, POST };
31
32     /**
33      * Creates a new object representing an html form submit event.
34      *
35      * @param source the object responsible for the event
36      * @param type the event type
37      * @param actionURL the form action URL
38      * @param sourceElement the element that corresponds to the source
39      * of the event
40      * @param targetFrame the Frame to display the document in
41      * @param method the form method type
42      * @param data the form submission data
43      */

44     FormSubmitEvent(Object JavaDoc source, EventType type, URL JavaDoc targetURL,
45                    Element sourceElement, String JavaDoc targetFrame,
46                     MethodType method, String JavaDoc data) {
47         super(source, type, targetURL, sourceElement, targetFrame);
48         this.method = method;
49         this.data = data;
50     }
51
52
53     /**
54      * Gets the form method type.
55      *
56      * @return the form method type, either
57      * <code>Method.GET</code> or <code>Method.POST</code>.
58      */

59     public MethodType getMethod() {
60         return method;
61     }
62
63     /**
64      * Gets the form submission data.
65      *
66      * @return the string representing the form submission data.
67      */

68     public String JavaDoc getData() {
69         return data;
70     }
71
72     private MethodType method;
73     private String JavaDoc data;
74 }
75
Popular Tags