| Incremental update of the facet's list [message #591980] |
Wed, 29 September 2004 07:26 |
Eclipse User |
|
|
|
Hi,
I have a problem with updating the list of facets after adding a new facet
to the facet contents. Here is the corresponding code snippet:
----------------------------
// load a schema
XSDSchema schema = load("test.xsd");
// Incrementally update the schema after each edit change
schema.setIncrementalUpdate(true);
// Build a new simple type and add it to the loaded schema
XSDSimpleTypeDefinition baseType = (XSDSimpleTypeDefinition)
schema.getTypeDefinitions().get(0);
XSDSimpleTypeDefinition simpleType = XSDFactory.eINSTANCE
.createXSDSimpleTypeDefinition();
simpleType.setBaseTypeDefinition(baseType);
schema.getContents().add(simpleType);
// Create a new facet and add it to the type
XSDMinLengthFacet minLength =
XSDFactory.eINSTANCE.createXSDMinLengthFacet();
minLength.setValue(10);
simpleType.getFacetContents().add(minLength);
// Print the facets of the type: MinLength isn't contained in the list
System.out.println(simpleType.getFacets());
// Enforce an update. Shouldn't be necessary because of the incremental
update
schema.update();
// Print the facets: Now MinLength is contained
System.out.println(simpleType.getFacets());
--------------------------
Shouldn't the manual update be unnecessary because the incremental update
is set to true? Or did I miss something in the JavaDoc or in my code?
Cheers
Klaas
|
|
|
Powered by
FUDForum. Page generated in 0.23423 seconds