Content Assist filtering [message #173398] |
Thu, 06 July 2006 12:27  |
Eclipse User |
|
|
|
I have the following schema (snippet), and I want to only allow the user to
put in one tag1 in the parent, but content assist allows me to do as many as
I want (assuming from the maxOccurs="unbounded").
<xsd:element name="parent">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="tag1" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="tag2" minOccurs="0" maxOccurs="1"/>
<!-- other items that can appear * time... -->
</xsd:choice>
<xsd:attribute name="should" type="xsd:boolean"/>
</xsd:complexType>
</xsd:element>
So when im in content assit, I want to filter out the entry tag1 if the
parent already has one,
I have my class that extends XMLContentAssistProcessor and think i could
figure out if it should be in the list by digging into the
contentassistrequest dom stuff ... and removing it from the proposal list if
it exists.
Does anyone see anything wrong with this approach, any side affects I might
be creating, or have a better suggestion (other than changing the schema)?
Thanks
Brian J
|
|
|
|
Powered by
FUDForum. Page generated in 0.04431 seconds