~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/swing/PasswordField.java

  • Committer: joe
  • Date: 2002-10-08 21:36:18 UTC
  • Revision ID: svn-v4:a88caf3b-7e0a-0410-8d0d-cecb45342206:trunk:80
big config and comment update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
package org.crosswire.common.config.swing;
 
3
 
 
4
import javax.swing.JComponent;
 
5
import javax.swing.JPasswordField;
 
6
 
 
7
import org.crosswire.common.config.Choice;
 
8
 
 
9
/**
 
10
 * PasswordField.
 
11
 * 
 
12
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 
13
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
 
14
 *
 
15
 * Distribution Licence:<br />
 
16
 * JSword is free software; you can redistribute it
 
17
 * and/or modify it under the terms of the GNU General Public License,
 
18
 * version 2 as published by the Free Software Foundation.<br />
 
19
 * This program is distributed in the hope that it will be useful,
 
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
22
 * General Public License for more details.<br />
 
23
 * The License is available on the internet
 
24
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 
25
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 
26
 * MA 02111-1307, USA<br />
 
27
 * The copyright to this program is held by it's authors.
 
28
 * </font></td></tr></table>
 
29
 * @see docs.Licence
 
30
 * @author Joe Walker [joe at eireneh dot com]
 
31
 * @version $Id$
 
32
 */
 
33
public class PasswordField extends JPasswordField implements Field
 
34
{
 
35
    /**
 
36
     * Some fields will need some extra info to display properly
 
37
     * like the options in an options field. FieldMap calls this
 
38
     * method with options provided by the choice.
 
39
     * @param param The options provided by the Choice
 
40
     */
 
41
    public void setChoice(Choice param)
 
42
    {
 
43
    }
 
44
 
 
45
    /**
 
46
     * Return a string version of the current value
 
47
     * @return The current value
 
48
     */
 
49
    public String getValue()
 
50
    {
 
51
        return new String(getPassword());
 
52
    }
 
53
 
 
54
    /**
 
55
     * Set the current value
 
56
     * @param value The new text
 
57
     */
 
58
    public void setValue(String value)
 
59
    {
 
60
        setText(value);
 
61
    }
 
62
 
 
63
    /**
 
64
     * Get the actual component that we can add to a Panel.
 
65
     * (This can well be this in an implementation).
 
66
     */
 
67
    public JComponent getComponent()
 
68
    {
 
69
        return this;
 
70
    }
 
71
}