KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitconf > ui > client > ClientPanelFactory


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 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.wsitconf.ui.client;
21
22 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
23 import org.netbeans.modules.websvc.wsitconf.wsdlmodelext.PolicyModelHelper;
24 import org.netbeans.modules.xml.multiview.ui.SectionInnerPanel;
25 import org.netbeans.modules.xml.multiview.ui.SectionView;
26 import org.netbeans.modules.xml.multiview.ui.ToolBarDesignEditor;
27 import org.netbeans.modules.xml.wsdl.model.Binding;
28 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
29 import org.openide.nodes.Node;
30
31 /**
32  *
33  * @author Martin Grebac
34  */

35 public class ClientPanelFactory implements org.netbeans.modules.xml.multiview.ui.InnerPanelFactory {
36     
37     private ToolBarDesignEditor editor;
38     private WSDLModel clientModel;
39     private WSDLModel serviceModel;
40     private Node node;
41     private JaxWsModel jaxwsmodel;
42     
43     /**
44      * Creates a new instance of ClientPanelFactory
45      */

46     ClientPanelFactory(ToolBarDesignEditor editor, WSDLModel model, Node node, WSDLModel serviceModel, JaxWsModel jxwsmodel) {
47         this.editor=editor;
48         this.clientModel = model;
49         this.serviceModel = serviceModel;
50         this.jaxwsmodel = jxwsmodel;
51         this.node = node;
52     }
53     
54     public SectionInnerPanel createInnerPanel(Object JavaDoc key) {
55         if (key instanceof String JavaDoc) {
56             String JavaDoc id = (String JavaDoc)key;
57             if (id.startsWith(ClientView.KEYSTORE_NODE_ID)) {
58                 Binding b = PolicyModelHelper.getBinding(clientModel, id.substring(ClientView.KEYSTORE_NODE_ID.length()));
59                 return new KeystorePanel((SectionView) editor.getContentView(), clientModel, node, b, jaxwsmodel);
60             }
61             if (id.startsWith(ClientView.CALLBACK_NODE_ID)) {
62                 Binding b = PolicyModelHelper.getBinding(clientModel, id.substring(ClientView.CALLBACK_NODE_ID.length()));
63                 return new CallbackPanel((SectionView) editor.getContentView(), clientModel, node, b, jaxwsmodel);
64             }
65             if (id.startsWith(ClientView.STS_NODE_ID)) {
66                 Binding b = PolicyModelHelper.getBinding(clientModel, id.substring(ClientView.STS_NODE_ID.length()));
67                 return new STSClientPanel((SectionView) editor.getContentView(), node, b, jaxwsmodel);
68             }
69             if (id.startsWith(ClientView.TRANSPORT_NODE_ID)) {
70                 Binding b = PolicyModelHelper.getBinding(clientModel, id.substring(ClientView.TRANSPORT_NODE_ID.length()));
71                 return new TransportPanelClient((SectionView) editor.getContentView(), node, b, serviceModel, jaxwsmodel);
72             }
73             if (id.startsWith(ClientView.ADVANCEDCONFIG_NODE_ID)) {
74                 Binding b = PolicyModelHelper.getBinding(clientModel, id.substring(ClientView.ADVANCEDCONFIG_NODE_ID.length()));
75                 return new AdvancedConfigPanelClient((SectionView) editor.getContentView(), node, b, serviceModel);
76             }
77         }
78         return null;
79     }
80 }
81
Popular Tags