~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/choices/AbstractChoice.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.choices;
3
 
 
4
 
import org.crosswire.common.config.Choice;
5
 
import org.crosswire.common.util.UserLevel;
6
 
 
7
 
/**
8
 
 * An AbstractChoice is one that registers itself with
9
 
 * AbstractChoice when it starts up, so that we don't need to pass
10
 
 * parameters around the place the whole time.
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 abstract class AbstractChoice implements Choice
34
 
{
35
 
    /**
36
 
     * Gets a default user level (beginner to advanced)
37
 
     * @return The user level
38
 
     */
39
 
    public UserLevel getUserLevel()
40
 
    {
41
 
        return UserLevel.BEGINNER;
42
 
    }
43
 
 
44
 
    /**
45
 
     * Get some help on this Field. In this case we are just providing
46
 
     * a default help text, that isn't much use.
47
 
     * @return The default help text
48
 
     */
49
 
    public String getHelpText()
50
 
    {
51
 
        return "";
52
 
    }
53
 
 
54
 
    /**
55
 
     * This method is used to configure a good way of editing this
56
 
     * component. It returns a MIME style string, which a config
57
 
     * ui can use to select a suitable ui tool.
58
 
     * @return The editor style to use to edit this Choice
59
 
     */
60
 
    public String getType()
61
 
    {
62
 
        return "text";
63
 
    }
64
 
 
65
 
    /**
66
 
     * This method is used to configure a the type selected above.
67
 
     * The object returned will depend on the type of editor selected.
68
 
     * For example an editor of type "options" may need a String array.
69
 
     * @return a configuration parameter for the type
70
 
     */
71
 
    public Object getTypeOptions()
72
 
    {
73
 
        return null;
74
 
    }
75
 
 
76
 
    /**
77
 
     * Is this Choice OK to write out to a file, or should we use settings
78
 
     * in this run of the program, but forget them for next time. A
79
 
     * typical use of this is for password configuration.
80
 
     * @return True if it is safe to store the value in a config file.
81
 
     */
82
 
    public boolean isSaveable()
83
 
    {
84
 
        return true;
85
 
    }
86
 
 
87
 
    /**
88
 
     * Sometimes we need to ensure that we configure items in a certain
89
 
     * order, the config package moves the changes to the application
90
 
     * starting with the highest priority, moving to the lowest
91
 
     * @return A priority level
92
 
     */
93
 
    public int priority()
94
 
    {
95
 
        return PRIORITY_NORMAL;
96
 
    }
97
 
 
98
 
    /**
99
 
     * Do we need to restart the program in order for this change to have
100
 
     * effect?
101
 
     * @return True if a restart is required
102
 
     */
103
 
    public boolean requiresRestart()
104
 
    {
105
 
        return false;
106
 
    }
107
 
}
108