KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > api > webservices > WsCompileEditorSupport


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.api.webservices;
21
22 import java.util.List JavaDoc;
23 import java.util.Collections JavaDoc;
24
25 import javax.swing.JPanel JavaDoc;
26
27 import org.openide.WizardValidationException;
28
29 /**
30  *
31  * @author Peter Williams
32  */

33 public interface WsCompileEditorSupport {
34
35     /** Editor fires this property event when the user edits a feature list
36      */

37     public static final String JavaDoc PROP_FEATURES_CHANGED = "featuresChanged";
38     public static final String JavaDoc PROP_DEBUG_CHANGED = "debugChanged";
39     public static final String JavaDoc PROP_OPTIMIZE_CHANGED = "optimizeChanged";
40     public static final String JavaDoc PROP_VERBOSE_CHANGED = "verboseChanged";
41     
42     public WsCompileEditorSupport.Panel getWsCompileSupport();
43     
44     public interface Panel {
45
46         /** The panel for the host
47          */

48         public JPanel JavaDoc getComponent();
49         
50         /** Call to initialize the properties in the editor panel
51          */

52         public void initValues(List JavaDoc/*ServiceSettings*/ settings);
53         
54         /** Validation entry point.
55          */

56         public void validatePanel() throws WizardValidationException;
57     }
58     
59     public final class ServiceSettings {
60         private String JavaDoc name;
61         private StubDescriptor stubType;
62         private List JavaDoc/*String*/ availableFeatures;
63         private List JavaDoc/*String*/ importantFeatures;
64         private String JavaDoc currentFeatures;
65         private String JavaDoc newFeatures;
66         
67         public ServiceSettings(String JavaDoc sn, StubDescriptor st, String JavaDoc c, List JavaDoc a, List JavaDoc i) {
68             name = sn;
69             stubType = st;
70             currentFeatures = newFeatures = c;
71             availableFeatures = Collections.unmodifiableList(a);
72             importantFeatures = Collections.unmodifiableList(i);
73         }
74         
75         public String JavaDoc getServiceName() {
76             return name;
77         }
78         
79         public StubDescriptor getStubDescriptor() {
80             return stubType;
81         }
82         
83         public String JavaDoc getCurrentFeatures() {
84             return currentFeatures;
85         }
86         
87         public String JavaDoc getNewFeatures() {
88             return newFeatures;
89         }
90         
91         public List JavaDoc/*String*/ getAvailableFeatures() {
92             return availableFeatures;
93         }
94         
95         public List JavaDoc/*String*/ getImportantFeatures() {
96             return importantFeatures;
97         }
98         
99         public String JavaDoc toString() {
100             return getServiceName();
101         }
102         
103         public void setNewFeatures(String JavaDoc nf) {
104             newFeatures = nf;
105         }
106     }
107     
108     public final class FeatureDescriptor {
109         
110         private String JavaDoc serviceName;
111         private String JavaDoc features;
112         
113         public FeatureDescriptor(String JavaDoc serviceName, String JavaDoc features) {
114             this.serviceName = serviceName;
115             this.features = features;
116         }
117         
118         public String JavaDoc getServiceName() {
119             return serviceName;
120         }
121         
122         public String JavaDoc getFeatures() {
123             return features;
124         }
125     }
126 }
127
Popular Tags