KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > j2ee > ui > 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
20 package org.netbeans.modules.j2ee.sun.ide.j2ee.ui;
21
22
23
24 import javax.enterprise.deploy.spi.DeploymentManager JavaDoc;
25 import javax.swing.JTabbedPane JavaDoc;
26 import javax.swing.event.ChangeEvent JavaDoc;
27 import javax.swing.event.ChangeListener JavaDoc;
28 import org.openide.util.NbBundle;
29 import org.netbeans.modules.j2ee.sun.ide.j2ee.DeploymentManagerProperties;
30
31 /**
32  * AppServer instance customizer which is accessible from server manager.
33  *
34  * @author Stepan Herold
35  */

36 public class Customizer extends JTabbedPane JavaDoc {
37
38     private final DeploymentManager JavaDoc dmp;
39     private ConnectionTabVisualPanel ctvp;
40
41     public Customizer(DeploymentManager JavaDoc dmp) {
42         
43         this.dmp = dmp;
44         initComponents ();
45     }
46     public void removeNotify(){
47         ctvp.syncUpWithModel();
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
// set help ID according to selected tab
53
addChangeListener(new ChangeListener JavaDoc() {
54             public void stateChanged(ChangeEvent JavaDoc e) {
55                 String JavaDoc helpID = null;
56                 switch (getSelectedIndex()) {
57                     case 0 : helpID = "appsrv81_customizer_connection"; // NOI18N
58
break;
59                     case 1 : helpID = "appsrv81_customizer_classes"; // NOI18N
60
break;
61                     case 2 : helpID = "appsrv81_customizer_sources"; // NOI18N
62
break;
63                     case 3 : helpID = "appsrv81_customizer_javadoc"; // NOI18N
64
break;
65                 }
66                 putClientProperty("HelpID", helpID); // NOI18N
67
}
68         });
69         DeploymentManagerProperties dmpr = new DeploymentManagerProperties(dmp);
70
71         CustomizerDataSupport custData = new CustomizerDataSupport(dmpr);
72         ctvp = new ConnectionTabVisualPanel(dmp);
73         addTab(NbBundle.getMessage(Customizer.class,"TXT_Connection"), ctvp);
74         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Classes"),
75                CustomizerSupport.createClassesCustomizer(custData.getClassModel()));
76         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Sources"),
77                 CustomizerSupport.createSourcesCustomizer(custData.getSourceModel(), null));
78         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Javadoc"),
79                 CustomizerSupport.createJavadocCustomizer(custData.getJavadocsModel(), null));
80     }
81 }
82
Popular Tags