01: /*
02: * JSStubsOptionPane.java - JavaStyle option pane for JavaDoc stubs
03: * Copyright (C) 2000,2001 Dirk Moebius
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * as published by the Free Software Foundation; either version 2
08: * of the License, or any later version.
09: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU General Public License for more details.
14: *
15: * You should have received a copy of the GNU General Public License
16: * along with this program; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19:
20: package org.acm.seguin.ide.common.options;
21:
22: import java.util.Hashtable;
23: import javax.swing.JTextField;
24:
25: /**
26: *@author Mike Atkinson (<a href="mailto:javastyle@ladyshot.demon.co.uk">
27: * Mike@ladyshot.demon.co.uk</a> )
28: *@author Dirk Moebius (<a href="mailto:dmoebius@gmx.net">dmoebius@gmx.net
29: * </a>)
30: *@created 04 September 2003
31: *@version $Version: $
32: *@since 1.0
33: */
34: public class JSStubs2OptionPane extends JSHelpOptionPane {
35:
36: private final static String[] STUBS = { "tostring",
37: "tostring.return", "equals", "equals.param",
38: "equals.return", "hashcode", "hashcode.return", "clone",
39: "clone.return", "copyconstructor", "listener.add",
40: "listener.remove", "listener.param", "finalize",
41: "instance", "instance.return" };
42:
43: private Hashtable components = new Hashtable();
44:
45: /**
46: * Constructor for the JSStubsOptionPane object
47: *
48: *@param project Description of the Parameter
49: */
50: public JSStubs2OptionPane(String project) {
51: super ("javastyle.stubs2", "pretty", project);
52: }
53:
54: /**
55: * Description of the Method
56: */
57: public void _init() {
58: for (int i = 0; i < STUBS.length; i++) {
59: components.put(STUBS[i], addStub(STUBS[i]));
60: }
61: addHelpArea();
62: }
63:
64: /**
65: * Called when the options dialog's `OK' button is pressed. This should
66: * save any properties saved in this option pane.
67: */
68: public void _save() {
69: for (int i = 0; i < STUBS.length; i++) {
70: ((SelectedPanel) components.get(STUBS[i])).save();
71: }
72: }
73:
74: /**
75: * Adds a feature to the Stub attribute of the JSStubsOptionPane object
76: *
77: *@param compName The feature to be added to the Stub attribute
78: *@return Description of the Return Value
79: */
80: private SelectedPanel addStub(String compName) {
81: return addComponent(compName + ".descr", "stubs." + compName,
82: new JTextField());
83: }
84:
85: }
|