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 JSStubsOptionPane extends JSHelpOptionPane {
35:
36: private final static String[] STUBS = { "class", "interface",
37: "constructor", "method", "field", "enum", "getter",
38: "getter.return", "setter", "setter.param", "adder",
39: "adder.param", "run", "main", "main.param" };
40:
41: private Hashtable components = new Hashtable();
42:
43: /**
44: * Constructor for the JSStubsOptionPane object
45: *
46: *@param project Description of the Parameter
47: */
48: public JSStubsOptionPane(String project) {
49: super ("javastyle.stubs", "pretty", project);
50: }
51:
52: /**
53: * Description of the Method
54: */
55: public void _init() {
56: for (int i = 0; i < STUBS.length; i++) {
57: components.put(STUBS[i], addStub(STUBS[i]));
58: }
59: addHelpArea();
60: }
61:
62: /**
63: * Called when the options dialog's `OK' button is pressed. This should
64: * save any properties saved in this option pane.
65: */
66: public void _save() {
67: for (int i = 0; i < STUBS.length; i++) {
68: ((SelectedPanel) components.get(STUBS[i])).save();
69: }
70: }
71:
72: /**
73: * Adds a feature to the Stub attribute of the JSStubsOptionPane object
74: *
75: *@param compName The feature to be added to the Stub attribute
76: *@return Description of the Return Value
77: */
78: private SelectedPanel addStub(String compName) {
79: return addComponent(compName + ".descr", "stubs." + compName,
80: new JTextField());
81: }
82:
83: }
|