如何限制RCP扩展点中的字符串属性?

问题描述:

我正在为具有某些属性的Eclipse RCP应用程序定义一个扩展点。 其中一个属性是字符串,它应该有最多3个字母字符如何限制RCP扩展点中的字符串属性?

此刻,我有如下定义:

<element name="type"> 
    <complexType> 
    <attribute name="type_identifier" type="string" use="required"> 
     <annotation> 
      <documentation> 
       Dieser String sollte noch auf maximal 3 Zeichn begrenzt werden 
      </documentation> 
     </annotation> 
    </attribute> 
    </complexType> 
</element> 

通过编辑我只能加枚举的限制,即在XML源作为显示:

<restriction base="string"> 
    <enumeration value="blubb"> 
    </enumeration> 
</restriction> 

但什么我想要的是这样的:

<restriction base="string"> 
    <pattern value="[A-Z]{3}"> 
    </pattern> 
</restriction> 

我可以使用此模式通知我的扩展点?我目前无法测试该设置,因此对于我来说简单的“只是试试看”是不可能的。

AFAIK,现在没有办法做到这一点。如果这个特性可以用于Eclipse,你可以这样做(通过添加工具支持):https://bugs.eclipse.org/bugs/show_bug.cgi?id=227055

+0

不是我喜欢的答案,但如果没有人反对,我恐怕这是我的答案。 **任何人反对?请继续!** ;-) – Kaadzia 2011-03-24 07:46:21

+0

好吧,所以不要反对。感谢普拉卡什。 – Kaadzia 2011-03-28 06:29:27