Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Content Assist filtering
Content Assist filtering [message #173398] Thu, 06 July 2006 12:27 Go to next message
Brian Jakubik is currently offline Brian Jakubik
Messages: 140
Registered: July 2009
Senior Member
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
Re: Content Assist filtering [message #173534 is a reply to message #173398] Fri, 07 July 2006 21:07 Go to previous message
Craig Salter is currently offline Craig Salter
Messages: 169
Registered: July 2009
Senior Member
The 'strict' content assist option may help ...

http://www.eclipse.org/webtools/wst/components/xml/1.0/new_a nd_noteworthy/wst-xml-1.0news.html
Previous Topic:Compiled JSP
Next Topic:XML editor content assistor problem with multiple schemas
Goto Forum:
  


Current Time: Wed Jul 30 21:34:06 EDT 2014

Powered by FUDForum. Page generated in 0.01550 seconds