1 | /* JPasswordField.java --
|
---|
2 | Copyright (C) 2002 Free Software Foundation, Inc.
|
---|
3 |
|
---|
4 | This file is part of GNU Classpath.
|
---|
5 |
|
---|
6 | GNU Classpath is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | any later version.
|
---|
10 |
|
---|
11 | GNU Classpath is distributed in the hope that it will be useful, but
|
---|
12 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with GNU Classpath; see the file COPYING. If not, write to the
|
---|
18 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
---|
19 | 02111-1307 USA.
|
---|
20 |
|
---|
21 | Linking this library statically or dynamically with other modules is
|
---|
22 | making a combined work based on this library. Thus, the terms and
|
---|
23 | conditions of the GNU General Public License cover the whole
|
---|
24 | combination.
|
---|
25 |
|
---|
26 | As a special exception, the copyright holders of this library give you
|
---|
27 | permission to link this library with independent modules to produce an
|
---|
28 | executable, regardless of the license terms of these independent
|
---|
29 | modules, and to copy and distribute the resulting executable under
|
---|
30 | terms of your choice, provided that you also meet, for each linked
|
---|
31 | independent module, the terms and conditions of the license of that
|
---|
32 | module. An independent module is a module which is not derived from
|
---|
33 | or based on this library. If you modify this library, you may extend
|
---|
34 | this exception to your version of the library, but you are not
|
---|
35 | obligated to do so. If you do not wish to do so, delete this
|
---|
36 | exception statement from your version. */
|
---|
37 |
|
---|
38 | package javax.swing;
|
---|
39 |
|
---|
40 | // Imports
|
---|
41 | import java.io.*;
|
---|
42 | import javax.accessibility.*;
|
---|
43 | import javax.swing.text.*;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * JPasswordField
|
---|
47 | * @author Andrew Selkirk
|
---|
48 | * @version 1.0
|
---|
49 | */
|
---|
50 | public class JPasswordField extends JTextField {
|
---|
51 |
|
---|
52 | //-------------------------------------------------------------
|
---|
53 | // Classes ----------------------------------------------------
|
---|
54 | //-------------------------------------------------------------
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * AccessibleJPasswordField
|
---|
58 | */
|
---|
59 | protected class AccessibleJPasswordField extends AccessibleJTextField {
|
---|
60 |
|
---|
61 | //-------------------------------------------------------------
|
---|
62 | // Variables --------------------------------------------------
|
---|
63 | //-------------------------------------------------------------
|
---|
64 |
|
---|
65 |
|
---|
66 | //-------------------------------------------------------------
|
---|
67 | // Initialization ---------------------------------------------
|
---|
68 | //-------------------------------------------------------------
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * Constructor AccessibleJPasswordField
|
---|
72 | * @param component TODO
|
---|
73 | */
|
---|
74 | protected AccessibleJPasswordField(JPasswordField component) {
|
---|
75 | super(component);
|
---|
76 | // TODO
|
---|
77 | } // AccessibleJPasswordField()
|
---|
78 |
|
---|
79 |
|
---|
80 | //-------------------------------------------------------------
|
---|
81 | // Methods ----------------------------------------------------
|
---|
82 | //-------------------------------------------------------------
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * getAccessibleRole
|
---|
86 | * @returns AccessibleRole
|
---|
87 | */
|
---|
88 | public AccessibleRole getAccessibleRole() {
|
---|
89 | return AccessibleRole.PASSWORD_TEXT;
|
---|
90 | } // getAccessibleRole()
|
---|
91 |
|
---|
92 |
|
---|
93 | } // AccessibleJPasswordField
|
---|
94 |
|
---|
95 |
|
---|
96 | //-------------------------------------------------------------
|
---|
97 | // Variables --------------------------------------------------
|
---|
98 | //-------------------------------------------------------------
|
---|
99 |
|
---|
100 | /**
|
---|
101 | * uiClassID
|
---|
102 | */
|
---|
103 | private static final String uiClassID = "PasswordFIeldUI";
|
---|
104 |
|
---|
105 | /**
|
---|
106 | * echoChar. Default is 0
|
---|
107 | */
|
---|
108 | private char echoChar = 0;
|
---|
109 |
|
---|
110 |
|
---|
111 | //-------------------------------------------------------------
|
---|
112 | // Initialization ---------------------------------------------
|
---|
113 | //-------------------------------------------------------------
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * Constructor JPasswordField
|
---|
117 | */
|
---|
118 | public JPasswordField() {
|
---|
119 | // TODO
|
---|
120 | } // JPasswordField()
|
---|
121 |
|
---|
122 | /**
|
---|
123 | * Constructor JPasswordField
|
---|
124 | * @param text TODO
|
---|
125 | */
|
---|
126 | public JPasswordField(String text) {
|
---|
127 | // TODO
|
---|
128 | } // JPasswordField()
|
---|
129 |
|
---|
130 | /**
|
---|
131 | * Constructor JPasswordField
|
---|
132 | * @param columns TODO
|
---|
133 | */
|
---|
134 | public JPasswordField(int columns) {
|
---|
135 | // TODO
|
---|
136 | } // JPasswordField()
|
---|
137 |
|
---|
138 | /**
|
---|
139 | * Constructor JPasswordField
|
---|
140 | * @param text TODO
|
---|
141 | * @param columns TODO
|
---|
142 | */
|
---|
143 | public JPasswordField(String text, int columns) {
|
---|
144 | // TODO
|
---|
145 | } // JPasswordField()
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * Constructor JPasswordField
|
---|
149 | * @param document TODO
|
---|
150 | * @param text TODO
|
---|
151 | * @param columns TODO
|
---|
152 | */
|
---|
153 | public JPasswordField(Document document, String text, int columns) {
|
---|
154 | // TODO
|
---|
155 | } // JPasswordField()
|
---|
156 |
|
---|
157 |
|
---|
158 | //-------------------------------------------------------------
|
---|
159 | // Methods ----------------------------------------------------
|
---|
160 | //-------------------------------------------------------------
|
---|
161 |
|
---|
162 | /**
|
---|
163 | * writeObject
|
---|
164 | * @param stream TODO
|
---|
165 | * @exception IOException TODO
|
---|
166 | */
|
---|
167 | private void writeObject(ObjectOutputStream stream) throws IOException {
|
---|
168 | // TODO
|
---|
169 | } // writeObject()
|
---|
170 |
|
---|
171 | /**
|
---|
172 | * copy
|
---|
173 | */
|
---|
174 | public void copy() {
|
---|
175 | // TODO
|
---|
176 | } // copy()
|
---|
177 |
|
---|
178 | /**
|
---|
179 | * getUIClassID
|
---|
180 | * @returns String
|
---|
181 | */
|
---|
182 | public String getUIClassID() {
|
---|
183 | return uiClassID;
|
---|
184 | } // getUIClassID()
|
---|
185 |
|
---|
186 | /**
|
---|
187 | * getEchoChar
|
---|
188 | * @returns char
|
---|
189 | */
|
---|
190 | public char getEchoChar() {
|
---|
191 | return echoChar;
|
---|
192 | } // getEchoChar()
|
---|
193 |
|
---|
194 | /**
|
---|
195 | * setEchoChar
|
---|
196 | * @param echo TODO
|
---|
197 | */
|
---|
198 | public void setEchoChar(char echo) {
|
---|
199 | this.echoChar = echo;
|
---|
200 | // TODO
|
---|
201 | } // setEchoChar()
|
---|
202 |
|
---|
203 | /**
|
---|
204 | * echoCharIsSet
|
---|
205 | * @returns boolean
|
---|
206 | */
|
---|
207 | public boolean echoCharIsSet() {
|
---|
208 | return (echoChar == 0);
|
---|
209 | } // echoCharIsSet()
|
---|
210 |
|
---|
211 | /**
|
---|
212 | * cut
|
---|
213 | */
|
---|
214 | public void cut() {
|
---|
215 | // TODO
|
---|
216 | } // cut()
|
---|
217 |
|
---|
218 | /**
|
---|
219 | * getText
|
---|
220 | * @returns String
|
---|
221 | */
|
---|
222 | public String getText() {
|
---|
223 | return null; // TODO
|
---|
224 | } // getText()
|
---|
225 |
|
---|
226 | /**
|
---|
227 | * getText
|
---|
228 | * @param offset TODO
|
---|
229 | * @param length TODO
|
---|
230 | * @exception BadLocationException TODO
|
---|
231 | * @returns String
|
---|
232 | */
|
---|
233 | public String getText(int offset, int length) throws BadLocationException {
|
---|
234 | return null; // TODO
|
---|
235 | } // getText()
|
---|
236 |
|
---|
237 | /**
|
---|
238 | * getPassword
|
---|
239 | * @returns char[]
|
---|
240 | */
|
---|
241 | public char[] getPassword() {
|
---|
242 | return null; // TODO
|
---|
243 | } // getPassword()
|
---|
244 |
|
---|
245 | /**
|
---|
246 | * paramString
|
---|
247 | * @returns String
|
---|
248 | */
|
---|
249 | protected String paramString() {
|
---|
250 | return null; // TODO
|
---|
251 | } // paramString()
|
---|
252 |
|
---|
253 | /**
|
---|
254 | * getAccessibleContext
|
---|
255 | * @returns AccessibleContext
|
---|
256 | */
|
---|
257 | public AccessibleContext getAccessibleContext() {
|
---|
258 | if (accessibleContext == null) {
|
---|
259 | accessibleContext = new AccessibleJPasswordField(this);
|
---|
260 | } // if
|
---|
261 | return accessibleContext;
|
---|
262 | } // getAccessibleContext()
|
---|
263 |
|
---|
264 |
|
---|
265 | } // JPasswordField
|
---|