KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > core > wseditor > support > EditWSAttributesTopComponent


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.websvc.core.wseditor.support;
21
22 import java.util.Set JavaDoc;
23 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
24 import org.netbeans.modules.websvc.core.wseditor.spi.WSEditor;
25 import org.openide.nodes.Node;
26 import org.openide.windows.TopComponent;
27
28 /**
29  * Top component which displays something.
30  */

31 public class EditWSAttributesTopComponent extends TopComponent {
32     
33     private static final long serialVersionUID = 1L;
34     
35     //private static EditWSAttributesTopComponent instance;
36
/** path to the icon used by the component and its open action */
37     static final String JavaDoc ICON_PATH = "org/netbeans/modules/websvc/core/ui/Context.gif";
38     
39     private static final String JavaDoc PREFERRED_ID = "EditWSAttributesTopComponent";
40     
41     public EditWSAttributesTopComponent() {
42         initComponents2();
43     }
44     
45     public void addTabs(Set JavaDoc<WSEditor> editors, Node node, JaxWsModel jaxWsModel){
46         jTabbedPane1.removeAll();
47         for (WSEditor editor : editors){
48             jTabbedPane1.addTab(editor.getTitle(), editor.createWSEditorComponent(node, jaxWsModel));
49         }
50     }
51     
52     private void initComponents2(){
53        jTabbedPane1 = new javax.swing.JTabbedPane JavaDoc();
54
55         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
56         this.setLayout(layout);
57         layout.setHorizontalGroup(
58             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
59             .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
60         );
61         layout.setVerticalGroup(
62             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
63             .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
64         );
65     }
66     
67     
68     /** This method is called from within the constructor to
69      * initialize the form.
70      * WARNING: Do NOT modify this code. The content of this method is
71      * always regenerated by the Form Editor.
72      */

73     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
74
private void initComponents() {
75         jTabbedPane1 = new javax.swing.JTabbedPane JavaDoc();
76
77         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
78         this.setLayout(layout);
79         layout.setHorizontalGroup(
80             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
81             .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
82         );
83         layout.setVerticalGroup(
84             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
85             .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
86         );
87     }// </editor-fold>//GEN-END:initComponents
88

89     
90     // Variables declaration - do not modify//GEN-BEGIN:variables
91
private javax.swing.JTabbedPane JavaDoc jTabbedPane1;
92     // End of variables declaration//GEN-END:variables
93

94    
95     public int getPersistenceType() {
96         return TopComponent.PERSISTENCE_ALWAYS;
97     }
98     
99     public void componentOpened() {
100         // TODO add custom code on component opening
101
}
102     
103     public void componentClosed() {
104         // TODO Offer the user to save here
105
}
106     
107     /** replaces this in object stream */
108     public Object JavaDoc writeReplace() {
109         //return new ResolvableHelper();
110
return null;
111     }
112     
113     protected String JavaDoc preferredID() {
114         return PREFERRED_ID;
115     }
116
117 }
118
Popular Tags