內容檢視器

org.eclipse.compare.contentViewers

這個延伸點可讓外掛程式登錄特定內容類型的檢視器。 當呈現資源的某版本或其中的子區段時,會在 EditionSelectionDialog 中使用這些檢視器。 系統預期檢視器會延伸 org.eclipse.jface.viewers.Viewer。 然而,因為檢視器沒有預設建構子,所以延伸點必須為檢視器 org.eclipse.compare.IViewerCreator 實作 Factory 介面。

<!ELEMENT extension (viewer* , contentTypeBinding*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT viewer EMPTY>

<!ATTLIST viewer

id         CDATA #REQUIRED

class      CDATA #REQUIRED

extensions CDATA #IMPLIED>


<!ELEMENT contentTypeBinding EMPTY>

<!ATTLIST contentTypeBinding

contentTypeId   CDATA #REQUIRED

contentViewerId CDATA #REQUIRED>


下列是文字檔(副檔名為 "txt")的檢視器的範例:

<extension point =

"org.eclipse.compare.contentViewers"

>

<viewer id=

"org.eclipse.compare.internal.TextViewer"

class=

"org.eclipse.compare.internal.TextViewerCreator"

extensions=

"txt"

/>

</extension>

提供的類別必須實作 org.eclipse.compare.IViewerCreator

「比較 UI」外掛程式會定義文字和影像的內容檢視器。