3

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

目前我有以下定义:

<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-source 中显示为:

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

但我想要的是这样的:

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

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

4

1 回答 1

2

AFAIK,现在没有办法做到这一点。如果此功能曾经进入 Eclipse,您可以这样做(通过添加工具支持):https ://bugs.eclipse.org/bugs/show_bug.cgi?id=227055

于 2011-03-24T06:09:09.553 回答