001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.tomcat5.customizer;
042:
043: import javax.swing.JTabbedPane;
044: import javax.swing.event.ChangeEvent;
045: import javax.swing.event.ChangeListener;
046: import org.openide.util.NbBundle;
047: import org.netbeans.modules.tomcat5.TomcatManager;
048:
049: /**
050: * Tomcat instance customizer which is accessible from server manager.
051: *
052: * @author Stepan Herold
053: */
054: public class Customizer extends JTabbedPane {
055:
056: private final TomcatManager manager;
057:
058: public Customizer(TomcatManager aManager) {
059: manager = aManager;
060: initComponents();
061: }
062:
063: private void initComponents() {
064: getAccessibleContext()
065: .setAccessibleName(
066: NbBundle.getMessage(Customizer.class,
067: "ACS_Customizer")); // NOI18N
068: getAccessibleContext()
069: .setAccessibleDescription(
070: NbBundle.getMessage(Customizer.class,
071: "ACS_Customizer")); // NOI18N
072: CustomizerDataSupport custData = new CustomizerDataSupport(
073: manager);
074: // set help ID according to selected tab
075: addChangeListener(new ChangeListener() {
076: public void stateChanged(ChangeEvent e) {
077: String helpID = null;
078: switch (getSelectedIndex()) {
079: case 0:
080: helpID = "tomcat_customizer_general"; // NOI18N
081: break;
082: case 1:
083: helpID = "tomcat_customizer_startup"; // NOI18N
084: break;
085: case 2:
086: helpID = "tomcat_customizer_platform"; // NOI18N
087: break;
088: case 3:
089: helpID = "tomcat_customizer_deployment"; // NOI18N
090: break;
091: case 4:
092: helpID = "tomcat_customizer_classes"; // NOI18N
093: break;
094: case 5:
095: helpID = "tomcat_customizer_sources"; // NOI18N
096: break;
097: case 6:
098: helpID = "tomcat_customizer_javadoc"; // NOI18N
099: break;
100: }
101: putClientProperty("HelpID", helpID); // NOI18N
102: }
103: });
104: addTab(NbBundle.getMessage(Customizer.class, "TXT_General"),
105: new CustomizerGeneral(custData));
106: addTab(NbBundle.getMessage(Customizer.class, "TXT_Startup"),
107: new CustomizerStartup(custData, manager
108: .getTomcatProperties().getCatalinaHome()));
109: addTab(NbBundle.getMessage(Customizer.class, "TXT_Platform"),
110: new CustomizerJVM(custData));
111: addTab(NbBundle.getMessage(Customizer.class, "TXT_Deployment"),
112: new CustomizerDeployment(custData));
113: addTab(
114: NbBundle
115: .getMessage(Customizer.class, "TXT_Tab_Classes"),
116: CustomizerSupport.createClassesCustomizer(custData
117: .getClassModel()));
118: addTab(
119: NbBundle
120: .getMessage(Customizer.class, "TXT_Tab_Sources"),
121: CustomizerSupport.createSourcesCustomizer(custData
122: .getSourceModel(), null));
123: addTab(
124: NbBundle
125: .getMessage(Customizer.class, "TXT_Tab_Javadoc"),
126: CustomizerSupport.createJavadocCustomizer(custData
127: .getJavadocsModel(), null));
128: }
129: }
|