註釋類型

org.eclipse.ui.editors.annotationTypes

3.0

註釋是附加在文字文件特定區域的一段資訊。新的註釋種類可以使用此延伸點來定義。註釋是透過其註釋模型來附加到文件上,可以顯示在文字編輯器和視圖中。註釋類型形成階層:註釋類型可以藉由在它的 super 屬性中指定它來修正其他類型。 部分的註釋作為標記的 UI 對應項目(請參閱 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 UI 的 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 延伸點。