我正在用一些属性为eclipse rcp应用程序定义一个扩展点。
其中一个属性是字符串,它应该最多包含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源中显示为:
<restriction base="string">
  <enumeration value="blubb">
  </enumeration>
</restriction>

但我想要的是:
<restriction base="string">
  <pattern value="[A-Z]{3}">
  </pattern>
</restriction>

我可以将此模式通知用于扩展点吗?我现在无法测试设置,所以对我来说简单的“试一试”是不可能的。

最佳答案

阿飞,现在没办法了。如果这个特性在eclipse中出现,您可以这样做(通过添加工具支持):https://bugs.eclipse.org/bugs/show_bug.cgi?id=227055

07-27 22:58