Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to limit number of extension elements available for an Extension Point
How to limit number of extension elements available for an Extension Point [message #308324] Tue, 19 September 2006 16:48 Go to next message
Eclipse UserFriend
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
Re: How to limit number of extension elements available for an Extension Point [message #308344 is a reply to message #308324] Wed, 20 September 2006 08:08 Go to previous message
Eclipse UserFriend
you should specify maxOccur="1".

It's not honoured currently:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=116939


Later,
PW
Previous Topic:Finding the IProject in content assistance or IDocument
Next Topic:Relaunching eclipse with new command line params
Goto Forum:
  


Current Time: Thu May 08 21:26:23 EDT 2025

Powered by FUDForum. Page generated in 0.04266 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top