KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > oc4j > customizer > OC4JCustomizer


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.j2ee.oc4j.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
28 /**
29  * OC4J instance customizer which is accessible from server manager.
30  *
31  * @author Michal Mocnak
32  */

33 public class OC4JCustomizer extends JTabbedPane JavaDoc {
34     
35     private static final String JavaDoc CLASSPATH = J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH;
36     private static final String JavaDoc JAVADOC = J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC;
37     
38     private final J2eePlatformImpl platform;
39     private final OC4JCustomizerDataSupport custData;
40     
41     public OC4JCustomizer(OC4JCustomizerDataSupport custData, J2eePlatformImpl platform) {
42         this.custData = custData;
43         this.platform = platform;
44         initComponents();
45     }
46     
47     private void initComponents() {
48         getAccessibleContext().setAccessibleName(NbBundle.getMessage(OC4JCustomizer.class,"ACS_Customizer"));
49         getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(OC4JCustomizer.class,"ACS_Customizer"));
50         // set help ID according to selected tab
51
addChangeListener(new ChangeListener JavaDoc() {
52             public void stateChanged(ChangeEvent JavaDoc e) {
53                 String JavaDoc helpID = null;
54                 switch (getSelectedIndex()) {
55                     case 0 : helpID = "oc4j_customizer_user"; // NOI18N
56
break;
57                     case 1 : helpID = "oc4j_customizer_classes"; // NOI18N
58
break;
59                     case 2 : helpID = "oc4j_customizer_javadoc"; // NOI18N
60
break;
61                 }
62                 putClientProperty("HelpID", helpID); // NOI18N
63
}
64         });
65         addTab(NbBundle.getMessage(OC4JCustomizer.class,"TXT_Tab_User"),
66                 OC4JCustomizerSupport.createUserCustomizer(custData.getInstanceProperties()));
67         addTab(NbBundle.getMessage(OC4JCustomizer.class,"TXT_Tab_Classes"),
68                 OC4JCustomizerSupport.createClassesCustomizer(custData.getClassModel()));
69         addTab(NbBundle.getMessage(OC4JCustomizer.class,"TXT_Tab_Javadoc"),
70                 OC4JCustomizerSupport.createJavadocCustomizer(custData.getJavadocsModel(), null));
71     }
72 }
Popular Tags