注释类型

org.eclipse.ui.editors.annotationTypes

3.0

注释是与文本文档的特定区域相连的一些信息。可以使用此扩展点来定义新类型的注释。注释通过它们的注释模型与文档相连,注释可以显示在文本编辑器和视图中。各种注释类型组成层次结构:注释类型可以通过在它的 super 属性中指定另一种类型来优化另一种类型。某些注释充当标记的用户界面等效件(请参阅 org.eclipse.core.resources.IMarker),而其它注释独立存在,没有持久存在的形式。标记与注释类型之间的映射是由可选的 markerTypemarkerSeverity 属性定义的。

<!ELEMENT extension (type)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT type EMPTY>

<!ATTLIST type

name           CDATA #REQUIRED

markerType     CDATA #IMPLIED

super          CDATA #IMPLIED

markerSeverity (0|1|2) >

标记类型定义。



以下内容摘录自 JDT 用户界面的 plugin.xml,它添加了 java 编译器错误和警告注释:
   

<extension point=

"org.eclipse.ui.editors.annotationTypes"

>

<type name=

"org.eclipse.jdt.ui.error"

super=

"org.eclipse.ui.workbench.texteditor.error"

markerType=

"org.eclipse.jdt.core.problem"

markerSeverity=

"2"

>

</type>

<type name=

"org.eclipse.jdt.ui.warning"

super=

"org.eclipse.ui.workbench.texteditor.warning"

markerType=

"org.eclipse.jdt.core.problem"

markerSeverity=

"1"

>

</type>

<type name=

"org.eclipse.jdt.ui.info"

super=

"org.eclipse.ui.workbench.texteditor.info"

markerType=

"org.eclipse.jdt.core.problem"

markerSeverity=

"0"

>

</type>

</extension>

请参阅 org.eclipse.jface.text.source.Annotation 类和 org.eclipse.ui.editors.markerAnnotationSpecification 扩展点。