KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > api > client > WsCompileClientEditorSupport


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.client;
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 WsCompileClientEditorSupport {
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"; //NOI18N
38
public static final String JavaDoc PROP_OPTIONS_CHANGED = "optionsChanged"; //NOI18N
39

40     public WsCompileClientEditorSupport.Panel getWsCompileSupport();
41     
42     public interface Panel {
43
44         /** The panel for the host
45          */

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

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

54         public void validatePanel() throws WizardValidationException;
55     }
56     
57     public final class ServiceSettings {
58         private String JavaDoc name;
59         private ClientStubDescriptor stubType;
60         private List JavaDoc/*String*/ availableFeatures;
61         private List JavaDoc/*String*/ importantFeatures;
62         private String JavaDoc currentFeatures;
63         private String JavaDoc newFeatures;
64         private boolean[] options;
65         
66         public ServiceSettings(String JavaDoc sn, ClientStubDescriptor st, boolean[] options, String JavaDoc c, List JavaDoc a, List JavaDoc i) {
67             name = sn;
68             stubType = st;
69             this.options=options;
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 ClientStubDescriptor getClientStubDescriptor() {
80             return stubType;
81         }
82         
83         public String JavaDoc getCurrentFeatures() {
84             return currentFeatures;
85         }
86         
87         public boolean[] getOptions() {
88             return options;
89         }
90         
91         public void setOptions(boolean[] options) {
92             this.options=options;
93         }
94         
95         public String JavaDoc getNewFeatures() {
96             return newFeatures;
97         }
98         
99         public List JavaDoc/*String*/ getAvailableFeatures() {
100             return availableFeatures;
101         }
102         
103         public List JavaDoc/*String*/ getImportantFeatures() {
104             return importantFeatures;
105         }
106         
107         public String JavaDoc toString() {
108             return getServiceName();
109         }
110         
111         public void setNewFeatures(String JavaDoc nf) {
112             newFeatures = nf;
113         }
114     }
115     
116     public final class FeatureDescriptor {
117         
118         private String JavaDoc serviceName;
119         private String JavaDoc features;
120         
121         public FeatureDescriptor(String JavaDoc serviceName, String JavaDoc features) {
122             this.serviceName = serviceName;
123             this.features = features;
124         }
125         
126         public String JavaDoc getServiceName() {
127             return serviceName;
128         }
129         
130         public String JavaDoc getFeatures() {
131             return features;
132         }
133     }
134     
135     public final class OptionDescriptor {
136         private String JavaDoc serviceName;
137         private boolean[] options;
138         
139         public OptionDescriptor(String JavaDoc serviceName, boolean[] options) {
140             this.serviceName = serviceName;
141             this.options = options;
142         }
143         
144         public String JavaDoc getServiceName() {
145             return serviceName;
146         }
147         
148         public boolean[] getOptions() {
149             return options;
150         }
151     }
152 }
153
Popular Tags