註解類型

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 延伸點。