How to limit number of extension elements available for an Extension Point [message #308324] |
Tue, 19 September 2006 16:48  |
Eclipse User |
|
|
|
Hi,
I have an extension point "org.test" with an element "context" which has
some attributes. I would like to make it so that any user wanting to
plug-in to my "org.test" extension point can only create one 'context'
element. Any subsequent tries to create a new element either don't show the
'context' element or show it greyed out.
I'm pretty sure I've seen this before but it does not seem to be working for
me and I was hoping someone could point me in the right direction.
Here is a cut down sample of my schema.
---------------------------------------------------------
<element name="extension">
<complexType>
<choice>
<element ref="context"/>
</choice>
<attribute name="point" type="string" use="required"/>
<attribute name="id" type="string"/>
<attribute name="name" type="string"/>
</complexType>
</element>
<element name="context">
<complexType>
<attribute name="someAttribute" type="string" use="required"/>
</complexType>
</element>
---------------------------------------------------------
Note: I have tried using both <choice> and <sequence>. I have tried forcing
' maxOccur="1" ' to be an attribute for the element within the
choice/sequence but this made no difference. I have also tried setting the
minOccus to 0 and maxOccurs to 1.
But so far when I add my extension point and try to add the extension
elements it allows me to add as many as I want (as though it thinks its
unbounded).
Can anyone point me in the right direction for how to accomplish limiting it
to one occurance of the element.
Thanks in advance,
Adam
|
|
|
|
Powered by
FUDForum. Page generated in 0.04266 seconds