KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > jboss4 > 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.j2ee.jboss4.customizer;
20
21
22 import java.awt.GridBagConstraints JavaDoc;
23 import java.awt.GridBagLayout JavaDoc;
24 import java.awt.Insets JavaDoc;
25 import java.io.File JavaDoc;
26 import java.util.ArrayList JavaDoc;
27 import java.net.URL JavaDoc;
28 import java.net.URI JavaDoc;
29 import java.util.List JavaDoc;
30 import javax.swing.*;
31 import javax.swing.event.ChangeEvent JavaDoc;
32 import javax.swing.event.ChangeListener JavaDoc;
33 import org.openide.filesystems.FileUtil;
34 import org.openide.util.NbBundle;
35 import org.netbeans.modules.j2ee.deployment.common.api.J2eeLibraryTypeProvider;
36 import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl;
37 import org.netbeans.spi.project.libraries.LibraryImplementation;
38
39
40 /**
41  * JBoss instance customizer which is accessible from server manager.
42  *
43  *
44  */

45 public class Customizer extends JTabbedPane {
46
47     private static final String JavaDoc CLASSPATH = J2eeLibraryTypeProvider.VOLUME_TYPE_CLASSPATH;
48     private static final String JavaDoc SOURCES = J2eeLibraryTypeProvider.VOLUME_TYPE_SRC;
49     private static final String JavaDoc JAVADOC = J2eeLibraryTypeProvider.VOLUME_TYPE_JAVADOC;
50
51     private final J2eePlatformImpl platform;
52     private final CustomizerDataSupport custData;
53
54     public Customizer(CustomizerDataSupport custData, J2eePlatformImpl platform) {
55         this.custData = custData;
56         this.platform = platform;
57         initComponents ();
58     }
59
60     private void initComponents() {
61         getAccessibleContext().setAccessibleName (NbBundle.getMessage(Customizer.class,"ACS_Customizer"));
62         getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(Customizer.class,"ACS_Customizer"));
63         // set help ID according to selected tab
64
addChangeListener(new ChangeListener JavaDoc() {
65             public void stateChanged(ChangeEvent JavaDoc e) {
66                 String JavaDoc helpID = null;
67                 switch (getSelectedIndex()) {
68                     case 0 : helpID = "jboss_customizer_platform"; // NOI18N
69
break;
70                     case 1 : helpID = "jboss_customizer_classes"; // NOI18N
71
break;
72                     case 2 : helpID = "jboss_customizer_sources"; // NOI18N
73
break;
74                     case 3 : helpID = "jboss_customizer_javadoc"; // NOI18N
75
break;
76                 }
77                 putClientProperty("HelpID", helpID); // NOI18N
78
}
79         });
80         addTab(NbBundle.getMessage(Customizer.class,"TXT_Platform"), new CustomizerJVM(custData));
81         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Classes"),
82                CustomizerSupport.createClassesCustomizer(custData.getClassModel()));
83         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Sources"),
84                 CustomizerSupport.createSourcesCustomizer(custData.getSourceModel(), null));
85         addTab(NbBundle.getMessage(Customizer.class,"TXT_Tab_Javadoc"),
86                 CustomizerSupport.createJavadocCustomizer(custData.getJavadocsModel(), null));
87     }
88 }
89
Popular Tags