~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/common/org/crosswire/common/config/choices/ActionChoice.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
 
/**
5
 
* An ActionChoice just presents a button for some custom action.
6
 
*
7
 
* <table border='1' cellPadding='3' cellSpacing='0' width="100%">
8
 
* <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
9
 
* Distribution Licence:<br />
10
 
* Project B is free software; you can redistribute it
11
 
* and/or modify it under the terms of the GNU General Public License,
12
 
* version 2 as published by the Free Software Foundation.<br />
13
 
* This program is distributed in the hope that it will be useful,
14
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
 
* General Public License for more details.<br />
17
 
* The License is available on the internet
18
 
* <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
19
 
* <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20
 
* MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
21
 
* The copyright to this program is held by it's authors.
22
 
* </font></td></tr></table>
23
 
* @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
24
 
* @see <{docs.Licence}>
25
 
* @author Joe Walker
26
 
*/
27
 
public abstract class ActionChoice extends AbstractChoice
28
 
{
29
 
    /**
30
 
    * Construct an ActionChoice
31
 
    */
32
 
    public ActionChoice(String label, Runnable runner)
33
 
    {
34
 
        this.label = label;
35
 
        this.runner = runner;
36
 
    }
37
 
 
38
 
    /**
39
 
    * Generalized read boolean from the Properties file
40
 
    * @return Found boolean or the default value
41
 
    */
42
 
    public String getString()
43
 
    {
44
 
        return "";
45
 
    }
46
 
 
47
 
    /**
48
 
    * Generalized set boolean to the Properties file
49
 
    * @param value The value to enter
50
 
    */
51
 
    public void setString(String value)
52
 
    {
53
 
    }
54
 
 
55
 
    /**
56
 
    * Save this setting to disk?
57
 
    */
58
 
    public boolean isSaveable()
59
 
    {
60
 
        return false;
61
 
    }
62
 
 
63
 
    /** Override this to check and note any change */
64
 
    public String getType()
65
 
    {
66
 
        return "action";
67
 
    }
68
 
 
69
 
    /** Override this to check and note any change */
70
 
    public Object getTypeOptions()
71
 
    {
72
 
        return new Object[] { runner, label };
73
 
    }
74
 
 
75
 
    /** The button label */
76
 
    private String label = null;
77
 
 
78
 
    /** What to do when we are clicked */
79
 
    private Runnable runner = null;
80
 
}