2
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
* The contents of this file are subject to the terms of either the GNU
7
* General Public License Version 2 only ("GPL") or the Common
8
* Development and Distribution License("CDDL") (collectively, the
9
* "License"). You may not use this file except in compliance with the
10
* License. You can obtain a copy of the License at
11
* http://www.netbeans.org/cddl-gplv2.html
12
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
* specific language governing permissions and limitations under the
14
* License. When distributing the software, include this License Header
15
* Notice in each file and include the License file at
16
* nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17
* particular file as subject to the "Classpath" exception as provided
18
* by Sun in the GPL Version 2 section of the License file that
19
* accompanied this code. If applicable, add the following below the
20
* License Header, with the fields enclosed by brackets [] replaced by
21
* your own identifying information:
22
* "Portions Copyrighted [year] [name of copyright owner]"
26
* The Original Software is NetBeans. The Initial Developer of the Original
27
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
28
* Microsystems, Inc. All Rights Reserved.
30
* If you wish your version of this file to be governed by only the CDDL
31
* or only the GPL Version 2, indicate your decision by adding
32
* "[Contributor] elects to include this software in this distribution
33
* under the [CDDL or GPL Version 2] license." If you do not indicate a
34
* single choice of license, a recipient has the option to distribute
35
* your version of this file under either the CDDL, the GPL Version 2 or
36
* to extend the choice of license to its licensees as provided above.
37
* However, if you add GPL Version 2 code and therefore, elected the GPL
38
* Version 2 license, then the option applies only if the new code is
39
* made subject to such option by the copyright holder.
43
* This generated bean class SimpleCustomizer
44
* matches the schema element 'SimpleCustomizer'.
45
* The root bean class is ElementProperties
47
* ===============================================================
49
* Use the builtin chooser that are available (the names are defined under builtInCustomizerTypes simple type as enumerations,
50
* name: specifies which builtin chooser to use.
52
* ===============================================================
53
* Generated on Mon Feb 05 17:54:51 PST 2007
57
package org.netbeans.modules.xml.wsdl.ui.property.model;
59
public class SimpleCustomizer {
60
public static final String NAME = "Name"; // NOI18N
62
private java.lang.String _Name = "MessageChooser";
65
* Normal starting point constructor.
67
public SimpleCustomizer() {
71
* Required parameters constructor
73
public SimpleCustomizer(java.lang.String name) {
80
public SimpleCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer source) {
86
* @param justData just copy the XML relevant data
88
public SimpleCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer source, boolean justData) {
92
// This attribute is mandatory
93
public void setName(java.lang.String value) {
97
public java.lang.String getName() {
101
public void writeNode(java.io.Writer out) throws java.io.IOException {
103
myName = "SimpleCustomizer";
104
writeNode(out, myName, ""); // NOI18N
107
public void writeNode(java.io.Writer out, String nodeName, String indent) throws java.io.IOException {
108
writeNode(out, nodeName, null, indent, new java.util.HashMap());
112
* It's not recommended to call this method directly.
114
public void writeNode(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException {
117
if (namespace != null) {
118
out.write((String)namespaceMap.get(namespace));
122
writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap);
123
writeNodeChildren(out, nodeName, namespace, indent, namespaceMap);
127
protected void writeNodeAttributes(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException {
128
// name is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
130
out.write(" name='");
131
org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _Name, true);
132
out.write("'"); // NOI18N
136
protected void writeNodeChildren(java.io.Writer out, String nodeName, String namespace, String indent, java.util.Map namespaceMap) throws java.io.IOException {
139
public void readNode(org.w3c.dom.Node node) {
140
readNode(node, new java.util.HashMap());
143
public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) {
144
if (node.hasAttributes()) {
145
org.w3c.dom.NamedNodeMap attrs = node.getAttributes();
146
org.w3c.dom.Attr attr;
147
java.lang.String attrValue;
148
boolean firstNamespaceDef = true;
149
for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) {
150
attr = (org.w3c.dom.Attr) attrs.item(attrNum);
151
String attrName = attr.getName();
152
if (attrName.startsWith("xmlns:")) {
153
if (firstNamespaceDef) {
154
firstNamespaceDef = false;
155
// Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries.
156
namespacePrefixes = new java.util.HashMap(namespacePrefixes);
158
String attrNSPrefix = attrName.substring(6, attrName.length());
159
namespacePrefixes.put(attrNSPrefix, attr.getValue());
162
readNodeAttributes(node, namespacePrefixes, attrs);
164
readNodeChildren(node, namespacePrefixes);
167
protected void readNodeAttributes(org.w3c.dom.Node node, java.util.Map namespacePrefixes, org.w3c.dom.NamedNodeMap attrs) {
168
org.w3c.dom.Attr attr;
169
java.lang.String attrValue;
170
attr = (org.w3c.dom.Attr) attrs.getNamedItem("name");
172
attrValue = attr.getValue();
177
protected void readNodeChildren(org.w3c.dom.Node node, java.util.Map namespacePrefixes) {
180
public void changePropertyByName(String name, Object value) {
181
if (name == null) return;
182
name = name.intern();
184
setName((java.lang.String)value);
186
throw new IllegalArgumentException(name+" is not a valid property name for SimpleCustomizer");
189
public Object fetchPropertyByName(String name) {
192
throw new IllegalArgumentException(name+" is not a valid property name for SimpleCustomizer");
195
public String nameSelf() {
196
return "SimpleCustomizer";
199
public String nameChild(Object childObj) {
200
return nameChild(childObj, false, false);
204
* @param childObj The child object to search for
205
* @param returnSchemaName Whether or not the schema name should be returned or the property name
206
* @return null if not found
208
public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName) {
209
return nameChild(childObj, returnConstName, returnSchemaName, false);
213
* @param childObj The child object to search for
214
* @param returnSchemaName Whether or not the schema name should be returned or the property name
215
* @return null if not found
217
public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) {
218
if (childObj instanceof java.lang.String) {
219
java.lang.String child = (java.lang.String) childObj;
220
if (child == _Name) {
221
if (returnConstName) {
223
} else if (returnSchemaName) {
225
} else if (returnXPathName) {
236
* Return an array of all of the properties that are beans and are set.
238
public java.lang.Object[] childBeans(boolean recursive) {
239
java.util.List children = new java.util.LinkedList();
240
childBeans(recursive, children);
241
java.lang.Object[] result = new java.lang.Object[children.size()];
242
return (java.lang.Object[]) children.toArray(result);
246
* Put all child beans into the beans list.
248
public void childBeans(boolean recursive, java.util.List beans) {
251
public boolean equals(Object o) {
252
return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer && equals((org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer) o);
255
public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.SimpleCustomizer inst) {
262
if (!(_Name == null ? inst._Name == null : _Name.equals(inst._Name))) {
268
public int hashCode() {
270
result = 37*result + (_Name == null ? 0 : _Name.hashCode());
278
The following schema file has been used for generation:
280
<?xml version="1.0" encoding="UTF-8"?>
282
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
283
targetNamespace="http://xml.netbeans.org/schema/wsdlui/property"
284
xmlns:tns="http://xml.netbeans.org/schema/wsdlui/property"
285
elementFormDefault="qualified">
286
<xsd:element name="ElementProperties">
288
<xsd:documentation xml:lang="en-US">Root node for specifying customizers for a element.
289
This needs to be on the GlobalElement which would represent the node in the WSDL tree.
290
If this is defined in local elements it is ignored.</xsd:documentation>
294
<xsd:element ref="tns:PropertyGroup" maxOccurs="unbounded" />
295
<xsd:element ref="tns:Property" maxOccurs="unbounded" />
296
<xsd:element ref="tns:GroupedProperty" maxOccurs="unbounded" />
301
<xsd:element name="PropertyGroup">
303
<xsd:documentation xml:lang="en-US">Used to create groups in the property sheet.
304
By default, if no groups are defined all the properties will be shown
305
in the default Property sheet called "Properties".
306
name : defines the name of the Group.
307
groupOrder : defines the order in which the groups will be created. The groupOrder starts with 1.
308
isDefault : overrides the default property sheet to be this group rather than "Properties".
309
This enables the user to put non-customized properties (which do not have a Property defined in this xml) to go into this property sheet.
315
<xsd:attribute name="name" type="xsd:string" use="required"/>
316
<xsd:attribute name="groupOrder" type="xsd:int"/>
317
<xsd:attribute name="isDefault" type="xsd:boolean" default="false"/>
320
<xsd:element name="Property">
322
<xsd:documentation xml:lang="en-US">Property represents each attribute that would be created for the Node in the wsdleditor tree.
323
It defines a way to specify customizers for attributes.
324
There are 3 types of Property customizers:
325
SchemaCustomizer : The default Customizer is the SchemaCustomizer, which shows drop downs for enumerations and boolean attributes,
326
and String customizer for all other types. So if there is no Property defined for a attribute, it will have
328
BuiltInCustomizer : specifies a way to put already defined customizer to be shown. Examples are part chooser, message chooser etc.
329
NewCustomizer : provides a way to create a custom customizer specific to the user requirement. When using this the developer has
330
to implement the SPI org.netbeans.modules.xml.wsdl.ui.spi.WSDLLookupProvider, and add a implementation of
331
org.netbeans.modules.xml.wsdl.ui.spi.NewCustomizerProvider, which will provide the custom Node.Property to be shown in the
332
wsdl editor property sheet.
337
<xsd:element name="SchemaCustomizer"/>
338
<xsd:element name="BuiltInCustomizer">
339
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
341
<xsd:element name="DependsOnCustomizer">
343
<xsd:documentation xml:lang="en-US">Use a built-in customizer whose value(s) depend on some other attribute
344
of the the same element or some other source.
349
<xsd:element name="StaticCustomizer">
351
<xsd:documentation xml:lang="en-US">dependsOnAttributeName : the attribute on which the value(s) of the chooser would depend on.
352
For example: some elements may have a attribute for message and another for part, and the PartsChooser should show parts from the message that is selected in the message attribute.
353
In that the dependsOnAttributeName for PartChooser would be message.
357
<xsd:attribute name="dependsOnAttributeName" type="xsd:QName"/>
360
<!--No use case as of yet, xsd:element name="DynamicCustomizer">
362
<xsd:documentation xml:lang="en-US">
367
<xsd:attribute name="dependsOnAttributeValueType" type="xsd:string"/>
368
<xsd:attribute name="attributeValueProviderClass" type="xsd:string"/>
372
<xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
375
<xsd:element name="SimpleCustomizer">
377
<xsd:documentation xml:lang="en-US">
378
Use the builtin chooser that are available (the names are defined under builtInCustomizerTypes simple type as enumerations,
379
name: specifies which builtin chooser to use.
382
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
384
<xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
390
<xsd:element ref="tns:NewCustomizer"/>
392
<xsd:attribute name="attributeName" type="xsd:string" use="required"/>
393
<xsd:attribute name="isNameableAttribute" type="xsd:boolean" default="false"/>
394
<xsd:attribute name="decoratorAttribute" type="xsd:QName"/>
395
<xsd:attribute name="groupName" type="xsd:string"/>
396
<xsd:attribute name="propertyOrder" type="xsd:int"/>
399
<xsd:element name="GroupedProperty">
401
<xsd:documentation xml:lang="en-US">Some attributes in a element are mutually exclusive, so in the UI, for unambiguous usage, the user may want to add a single property chooser for 2 or more attributes, which will set the appropriate attribute depending on some criteria that the customizer may determine.
402
groupedAttributeNames : specify all the mutually exclusive attributes. There will be a single customizer for all these attributes.
403
groupName : specifies which PropertyGroup this belongs to.
404
propertyOrder : specifies the order in the PropertyGroup where this property would be placed.
405
displayName: specifies the Display name of the combined chooser.
410
<xsd:element name="BuiltInCustomizer" >
412
<xsd:documentation xml:lang="en-US">To use pre-built customizers.
417
<xsd:element name="ElementOrTypeChooser">
419
<xsd:documentation xml:lang="en-US">Shows a Tree based selector, which shows all the elements/types from Inline/Imported schemas.
420
elementAttributeName : the attribute on which GlobalElement data type would be set.
421
typeAttributeName : the attribute on which GlobalType data type would be set.
425
<xsd:attribute name="elementAttributeName" type="xsd:NCName"/>
426
<xsd:attribute name="typeAttributeName" type="xsd:NCName"/>
429
<xsd:element name="ElementOrTypeOrMessagePartChooser">
431
<xsd:documentation xml:lang="en-US">Shows a Tree based selector, which shows all the elements/types from Inline/Imported schemas and also the messages from all imported and existing wsdls.
432
elementAttributeName : the attribute on which GlobalElement data type would be set.
433
typeAttributeName : the attribute on which GlobalType data type would be set.
434
messageAttributeName : the attribute on which Message data type would be set.
435
partAttributeName : the attribute on which part would be set.
436
This chooser can select between a GlobalElement or GlobalType or a wsdl Part.
441
<xsd:attribute name="elementAttributeName" type="xsd:NCName"/>
442
<xsd:attribute name="typeAttributeName" type="xsd:NCName"/>
443
<xsd:attribute name="messageAttributeName" type="xsd:NCName"/>
444
<xsd:attribute name="partAttributeName" type="xsd:NCName"/>
450
<xsd:element ref="tns:NewCustomizer"/>
452
<xsd:attribute name="groupedAttributeNames" type="tns:attributeList" use="required"/>
453
<xsd:attribute name="groupName" type="xsd:string"/>
454
<xsd:attribute name="propertyOrder" type="xsd:int"/>
455
<xsd:attribute name="displayName" type="xsd:NCName" use="required"/>
460
<xsd:element name="NewCustomizer">
462
<xsd:documentation xml:lang="en-US">Provides a way for developer to provide a custom property customizer for the attribute, if the builtin chooser dont satisfy their requirements.
463
When using this the developer has to implement the SPI org.netbeans.modules.xml.wsdl.ui.spi.WSDLLookupProvider, and add a implementation of org.netbeans.modules.xml.wsdl.ui.spi.NewCustomizerProvider, which will provide the custom Node.Property to be shown in the wsdl editor property sheet.
469
<xsd:simpleType name="builtInCustomizerTypes">
470
<xsd:restriction base="xsd:string">
471
<xsd:enumeration value="MessageChooser">
473
<xsd:documentation xml:lang="en-US">Shows a drop down of all messages in the current WSDL document and also ones in imported WSDL documents.</xsd:documentation>
476
<xsd:enumeration value="PartChooser">
478
<xsd:documentation xml:lang="en-US">Show a drop down of all parts for a message. By default, the chooser assumes that it is in the binding section under input/output/fault, and shows all the parts for the message selected in the input/output/fault.
479
If not, then the dependsOnCustomizer needs to be used to specify the attribute which represents the message, whose parts will be shown</xsd:documentation>
482
<xsd:enumeration value="PortTypeChooser">
484
<xsd:documentation xml:lang="en-US">Show a drop down of all port types in the WSDL Document/Imported WSDL Documents.</xsd:documentation>
487
<xsd:enumeration value="PartsChooser">
489
<xsd:documentation xml:lang="en-US">Show a dialog of all parts for a message, from which multiple parts can be selected. By default, the chooser assumes that it is in the binding section under input/output/fault, and shows all the parts for the message selected in the input/output/fault.
490
If not, then the dependsOnCustomizer needs to be used to specify the attribute which represents the message, whose parts will be shown</xsd:documentation>
496
<xsd:simpleType name="attributeList">
497
<xsd:list itemType="xsd:string"/>