KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > core > palette > items > SQLStmt


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.core.palette.items;
21 import javax.swing.text.JTextComponent JavaDoc;
22
23
24
25 /**
26  *
27  * @author Libor Kotouc
28  */

29 public class SQLStmt {
30
31     public static final String JavaDoc[] scopes = new String JavaDoc[] { "page", "request", "session", "application" }; // NOI18N
32
public static final int SCOPE_DEFAULT = 0;
33
34     //user data
35
private String JavaDoc variable;
36     private int scopeIndex;
37     private String JavaDoc dataSource;
38     private String JavaDoc stmt;
39
40     private String JavaDoc helpID;
41
42     public SQLStmt(String JavaDoc variable, int scopeIndex, String JavaDoc dataSource, String JavaDoc stmt, String JavaDoc helpID) {
43                    
44         this.variable = variable;
45         this.scopeIndex = scopeIndex;
46         this.dataSource = dataSource;
47         this.stmt = stmt;
48         
49         this.helpID = helpID;
50     }
51
52     public boolean customize(JTextComponent JavaDoc target, String JavaDoc displayName, String JavaDoc stmtLabel, String JavaDoc stmtACSN, String JavaDoc stmtACSD) {
53
54         SQLStmtCustomizer c = new SQLStmtCustomizer(this, target, displayName, stmtLabel, stmtACSN, stmtACSD, helpID);
55         boolean accept = c.showDialog();
56         
57         return accept;
58     }
59
60     public String JavaDoc getVariable() {
61         return variable;
62     }
63
64     public void setVariable(String JavaDoc variable) {
65         this.variable = variable;
66     }
67
68     public int getScopeIndex() {
69         return scopeIndex;
70     }
71
72     public void setScopeIndex(int scopeIndex) {
73         this.scopeIndex = scopeIndex;
74     }
75
76     public String JavaDoc getStmt() {
77         return stmt;
78     }
79
80     public void setStmt(String JavaDoc query) {
81         this.stmt = query;
82     }
83
84     public String JavaDoc getDataSource() {
85         return dataSource;
86     }
87
88     public void setDataSource(String JavaDoc dataSource) {
89         this.dataSource = dataSource;
90     }
91
92 }
93
Popular Tags