2011-03-23 65 views
3

我正在爲具有某些屬性的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> 

我可以使用此模式通知我的擴展點?我目前無法測試該設置,因此對於我來說簡單的「只是試試看」是不可能的。

回答

2

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