001: /*
002: * JSGeneralOptionPane.java - JavaStyle general options panel
003: * Copyright (C) 2000,2001 Dirk Moebius
004: *
005: * jEdit buffer options:
006: * :tabSize=4:indentSize=4:noTabs=false:maxLineLen=0:
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: */
022: package org.acm.seguin.ide.jedit;
023:
024: import java.awt.Component;
025: import org.gjt.sp.jedit.AbstractOptionPane;
026: import org.acm.seguin.ide.common.options.*;
027:
028: /**
029: * @author Mike Atkinson (<a href="mailto:javastyle@ladyshot.demon.co.uk">
030: * Mike@ladyshot.demon.co.uk</a> )
031: * @created 04 September 2003
032: * @version $Version: $
033: * @since 1.0
034: */
035: public class JSOptionPane extends AbstractOptionPane {
036: private static final String[] names = new String[] {
037: "javastyle.general", "javastyle.indenting",
038: "javastyle.spacing", "javastyle.alignment",
039: "javastyle.sorting", "javastyle.javadoc",
040: "javastyle.stubs", "javastyle.stubs2",
041: "javastyle.stubs_junit", "javastyle.tags",
042: "javastyle.comments", "javastyle.pmd",
043: "javastyle.navigator", };
044: private JSHelpOptionPane options;
045:
046: public JSOptionPane(int type) {
047: super (names[type]);
048: switch (type) {
049: case 0:
050: options = new JSGeneralOptionPane(null);
051: break;
052: case 1:
053: options = new JSIndentOptionPane(null);
054: break;
055: case 2:
056: options = new JSSpacingOptionPane(null);
057: break;
058: case 3:
059: options = new JSAlignmentOptionPane(null);
060: break;
061: case 4:
062: options = new JSSortOptionPane(null);
063: break;
064: case 5:
065: options = new JSJavadocOptionPane(null);
066: break;
067: case 6:
068: options = new JSStubsOptionPane(null);
069: break;
070: case 7:
071: options = new JSStubs2OptionPane(null);
072: break;
073: case 8:
074: options = new JSStubsJUnitOptionPane(null);
075: break;
076: case 9:
077: options = new JSTagsOptionPane(null);
078: break;
079: case 10:
080: options = new JSCommentOptionPane(null);
081: break;
082: case 11:
083: options = new PMDOptionPane(null);
084: break;
085: case 12:
086: options = new NavigatorOptionPane(null);
087: break;
088: default:
089: throw new RuntimeException("unknown option type");
090: }
091: }
092:
093: /**
094: * Returns the internal name of this option pane. The option pane's label
095: * is set to the value of the property named
096: * <code>options.<i>name</i>.label</code>.
097: */
098: public String getName() {
099: return options.getName();
100: } //}}}
101:
102: //{{{ getComponent() method
103: /**
104: * Returns the component that should be displayed for this option pane.
105: * Because this class extends Component, it simply returns "this".
106: */
107: public Component getComponent() {
108: return options.getComponent();
109: } //}}}
110:
111: protected void _save() {
112: options._save();
113: }
114:
115: protected void _init() {
116: options._init();
117: }
118:
119: }
|