KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > ui > view > grapheditor > widget > RequestReplyOperationWidget


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

19
20 /*
21  * PortTypeColumnWidget.java
22  *
23  * Created on November 5, 2006, 10:42 PM
24  *
25  * To change this template, choose Tools | Template Manager
26  * and open the template in the editor.
27  */

28
29 package org.netbeans.modules.xml.wsdl.ui.view.grapheditor.widget;
30
31
32 import java.awt.Dimension JavaDoc;
33
34 import org.netbeans.api.visual.layout.LayoutFactory;
35 import org.netbeans.api.visual.layout.LayoutFactory.SerialAlignment;
36 import org.netbeans.api.visual.widget.Scene;
37 import org.netbeans.api.visual.widget.Widget;
38 import org.netbeans.modules.xml.wsdl.model.RequestResponseOperation;
39 import org.netbeans.modules.xml.wsdl.ui.view.grapheditor.layout.OneSideJustifiedLayout;
40 import org.openide.util.Lookup;
41
42 /**
43  *
44  * @author radval
45  */

46 public class RequestReplyOperationWidget
47         extends OperationWithFaultWidget<RequestResponseOperation> {
48     private Widget verticalWidget;
49
50     
51     
52     /** Creates a new instance of PortTypeColumnWidget */
53     public RequestReplyOperationWidget(Scene scene, RequestResponseOperation operation,
54             Lookup lookup) {
55         super(scene, operation, lookup);
56         //setBorder(BorderFactory.createLineBorder(Color.RED));
57
}
58     
59     @Override JavaDoc
60     protected void init() {
61         setLayout(LayoutFactory.createVerticalLayout());
62         
63         //already initialized?
64
if (getChildren().size() > 0) return;
65         
66         Scene scene = getScene();
67         Lookup lookup = getLookup();
68         WidgetFactory factory = WidgetFactory.getInstance();
69         Widget inputWidget = factory.createWidget(scene,
70                 getWSDLComponent().getInput(), lookup);
71         Widget outputWidget = factory.createWidget(scene,
72                 getWSDLComponent().getOutput(), lookup);
73         
74         verticalWidget = new Widget(scene);
75         verticalWidget.setLayout(LayoutFactory.createVerticalLayout(SerialAlignment.JUSTIFY, 3));
76         verticalWidget.addChild(inputWidget);
77         verticalWidget.addChild(outputWidget);
78         
79         Widget horizontalWidget = new Widget(scene);
80         horizontalWidget.setLayout(new OneSideJustifiedLayout(isRightSided()));
81         horizontalWidget.addChild(verticalWidget);
82         horizontalWidget.addChild(mOperationRectangleWidget);
83         
84         addChild(getLabel());
85         addChild(horizontalWidget);
86         
87     }
88     
89     @Override JavaDoc
90     protected Widget getVerticalWidget() {
91         return verticalWidget;
92     }
93     
94     
95 }
96
Popular Tags