KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tomcat5 > customizer > Customizer


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.tomcat5.customizer;
20
21 import javax.swing.JTabbedPane JavaDoc;
22 import javax.swing.event.ChangeEvent JavaDoc;
23 import javax.swing.event.ChangeListener JavaDoc;
24 import org.openide.util.NbBundle;
25 import org.netbeans.modules.j2ee.deployment.common.api.J2eeLibraryTypeProvider;
26 import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl;
27 import org.netbeans.modules.tomcat5.TomcatManager;
28
29 /**
30  * Tomcat instance customizer which is accessible from server manager.
31  *
32  * @author Stepan Herold
33  */

34 public class Customizer extends JTabbedPane JavaDoc {
35
36     private static final String JavaDoc CLASSPATH = J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH;
37     private static final String JavaDoc SOURCES = J2eeLibraryTypeProvider.VOLUME_TYPE_SRC;
38     private static final String JavaDoc JAVADOC = J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC;
39
40     private TomcatManager manager;
41     private J2eePlatformImpl platform;
42
43     public Customizer(TomcatManager aManager) {
44         manager = aManager;
45         platform = manager.getTomcatPlatform();
46         initComponents ();
47     }
48
49     private void initComponents() {
50         getAccessibleContext().setAccessibleName (NbBundle.getMessage(Customizer.class,"ACS_Customizer")); // NOI18N
51
getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(Customizer.class,"ACS_Customizer")); // NOI18N
52
CustomizerDataSupport custData = new CustomizerDataSupport(manager);
53         // set help ID according to selected tab
54
addChangeListener(new ChangeListener JavaDoc() {
55             public void stateChanged(ChangeEvent JavaDoc e) {
56                 String JavaDoc helpID = null;
57                 switch (getSelectedIndex()) {
58                     case 0 : helpID = "tomcat_customizer_general"; // NOI18N
59
break;
60                     case 1 : helpID = "tomcat_customizer_startup"; // NOI18N
61
break;
62                     case 2 : helpID = "tomcat_customizer_platform"; // NOI18N
63
break;
64                     case 3 : helpID = "tomcat_customizer_classes"; // NOI18N
65
break;
66                     case 4 : helpID = "tomcat_customizer_sources"; // NOI18N
67
break;
68                     case 5 : helpID = "tomcat_customizer_javadoc"; // NOI18N
69
break;
70                 }
71                 putClientProperty("HelpID", helpID); // NOI18N
72
}
73         });
74         addTab(NbBundle.getMessage(Customizer.class,"TXT_General"), new CustomizerGeneral(custData));
75         addTab(NbBundle.getMessage(Customizer.class,"TXT_Startup"), new CustomizerStartup(custData));
76         addTab(NbBundle.getMessage(Customizer.class,"TXT_Platform"), new CustomizerJVM(custData));
77         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Classes"),
78                CustomizerSupport.createClassesCustomizer(custData.getClassModel()));
79         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Sources"),
80                 CustomizerSupport.createSourcesCustomizer(custData.getSourceModel(), null));
81         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Javadoc"),
82                 CustomizerSupport.createJavadocCustomizer(custData.getJavadocsModel(), null));
83     }
84 }
85
Popular Tags