KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitconf > ui > service > ServicePanelFactory


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.service;
21
22 import javax.swing.undo.UndoManager JavaDoc;
23 import org.netbeans.api.project.Project;
24 import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
25 import org.netbeans.modules.xml.multiview.ui.SectionInnerPanel;
26 import org.netbeans.modules.xml.multiview.ui.SectionView;
27 import org.netbeans.modules.xml.multiview.ui.ToolBarDesignEditor;
28 import org.netbeans.modules.xml.wsdl.model.Binding;
29 import org.netbeans.modules.xml.wsdl.model.BindingFault;
30 import org.netbeans.modules.xml.wsdl.model.BindingInput;
31 import org.netbeans.modules.xml.wsdl.model.BindingOperation;
32 import org.netbeans.modules.xml.wsdl.model.BindingOutput;
33 import org.openide.nodes.Node;
34
35 /**
36  *
37  * @author Martin Grebac
38  */

39 public class ServicePanelFactory implements org.netbeans.modules.xml.multiview.ui.InnerPanelFactory {
40     
41     private ToolBarDesignEditor editor;
42     private boolean isFromJava;
43     private Node node;
44     private UndoManager JavaDoc undoManager;
45     private Project project;
46     private JaxWsModel jaxwsmodel;
47     
48     /**
49      * Creates a new instance of ServicePanelFactory
50      */

51     ServicePanelFactory(ToolBarDesignEditor editor, Node node, UndoManager JavaDoc undoManager, Project p, JaxWsModel jxwsmodel) {
52         this.editor=editor;
53         this.node = node;
54         this.project = p;
55         this.jaxwsmodel = jxwsmodel;
56         this.undoManager = undoManager;
57         this.isFromJava = false;
58     }
59
60     public SectionInnerPanel createInnerPanel(Object JavaDoc key) {
61         if (key instanceof Binding) {
62             Binding b = (Binding)key;
63             return new ServicePanel((SectionView) editor.getContentView(), node, project, b, undoManager, jaxwsmodel);
64         }
65         if (key instanceof BindingOperation) {
66             BindingOperation o = (BindingOperation)key;
67             return new OperationPanel((SectionView) editor.getContentView(), node, project, o, undoManager, jaxwsmodel);
68         }
69         if (key instanceof BindingInput) {
70             BindingInput i = (BindingInput)key;
71             return new InputPanel((SectionView) editor.getContentView(), node, i, undoManager);
72         }
73         if (key instanceof BindingOutput) {
74             BindingOutput o = (BindingOutput)key;
75             return new OutputPanel((SectionView) editor.getContentView(), node, o, undoManager);
76         }
77         if (key instanceof BindingFault) {
78             BindingFault f = (BindingFault)key;
79             return new FaultPanel((SectionView) editor.getContentView(), node, f, undoManager);
80         }
81         return null;
82     }
83 }
84
Popular Tags