~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/swing/fields/TextViewField.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.fields;
3
 
 
4
 
import java.io.IOException;
5
 
import java.net.URL;
6
 
 
7
 
import javax.swing.JComponent;
8
 
 
9
 
import org.crosswire.common.config.swing.Field;
10
 
import org.crosswire.common.swing.TextViewPanel;
11
 
import org.crosswire.common.util.Reporter;
12
 
 
13
 
/**
14
 
 * A TextViewField is a displays a TextViewPanel in a Config dialog.
15
 
 *
16
 
 * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
17
 
 * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
18
 
 * Distribution Licence:<br />
19
 
 * Project B is free software; you can redistribute it
20
 
 * and/or modify it under the terms of the GNU General Public License,
21
 
 * version 2 as published by the Free Software Foundation.<br />
22
 
 * This program is distributed in the hope that it will be useful,
23
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25
 
 * General Public License for more details.<br />
26
 
 * The License is available on the internet
27
 
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
28
 
 * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29
 
 * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
30
 
 * The copyright to this program is held by it's authors.
31
 
 * </font></td></tr></table>
32
 
 * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
33
 
 * @see <{docs.Licence}>
34
 
 * @author Joe Walker
35
 
 */
36
 
public class TextViewField extends TextViewPanel implements Field
37
 
{
38
 
    /**
39
 
     * Create a new FileField
40
 
     */
41
 
    public TextViewField()
42
 
    {
43
 
    }
44
 
 
45
 
    /**
46
 
     * This method does nothing because there is no configuring that this
47
 
     * class requires other than the current value.
48
 
     * @param obj The ignored paramter
49
 
     */
50
 
    public void setOptions(Object obj)
51
 
    {
52
 
        if (obj instanceof URL)
53
 
        {
54
 
            try
55
 
            {
56
 
                setText((URL) obj);
57
 
            }
58
 
            catch (IOException ex)
59
 
            {
60
 
                setText(ex.toString());
61
 
                Reporter.informUser(this, ex);
62
 
            }
63
 
        }
64
 
    }
65
 
 
66
 
    /**
67
 
     * Return a string version of the current value. Since this is
68
 
     * read-only as the moment, we just ignore this
69
 
     * @return The current value
70
 
     */
71
 
    public String getValue()
72
 
    {
73
 
        return "";
74
 
    }
75
 
 
76
 
    /**
77
 
     * Set the current value. Since this is read-only as the moment, we
78
 
     * just ignore this
79
 
     * @param value The new text
80
 
     */
81
 
    public void setValue(String value)
82
 
    {
83
 
    }
84
 
 
85
 
    /**
86
 
     * Get the actual component that we can add to a Panel.
87
 
     * (This can well be this in an implementation).
88
 
     */
89
 
    public JComponent getComponent()
90
 
    {
91
 
        return this;
92
 
    }
93
 
}