喜好設定轉送

org.eclipse.ui.preferenceTransfer

3.1

工作台提供維護喜好設定的支援。 這個延伸點的目的是容許外掛程式新增對儲存和載入特定喜好設定群組的特定支援。 通常這是用於作業中,例如「匯入」及「匯出」。

<!ELEMENT extension (transfer*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT transfer (mapping+ , description?)>

<!ATTLIST transfer

id   CDATA #REQUIRED

name CDATA #REQUIRED

icon CDATA #IMPLIED>


<!ELEMENT description (#PCDATA)>

選用性的子元素,其主體應該代表轉送引擎功能的簡短說明。



<!ELEMENT mapping (entry*)>

<!ATTLIST mapping

scope CDATA #REQUIRED>

代表 org.eclipse.core.runtime.preferences.IPreferenceFilter 的子元素。從範圍 org.eclipse.core.runtime.preferences.IScope 指定 1 或多個對映給 0 或多個節點,每個節點指定了 0 或多個按鍵。匯出及匯入行為過濾器的規則可以在 org.eclipse.core.runtime.preferences.IPreferenceFilter 的規格中找到。



<!ELEMENT entry (key*)>

<!ATTLIST entry

node CDATA #IMPLIED>

指定要轉送至給定範圍的節點及按鍵之子元素。



<!ELEMENT key EMPTY>

<!ATTLIST key

name CDATA #REQUIRED>


匯出所有轉送,匯出指定範圍中所有節點的範例。

   

<extension point=

"org.eclipse.ui.preferenceTransfer"

>

<transfer icon=

"XYZ.gif"

name=

"Export All Transfer Test"

id=

"org.eclipse.ui.tests.all"

>

<mapping scope=

"instance"

>

</mapping>

<mapping scope=

"configuration"

>

</mapping>

<mapping scope=

"project"

>

</mapping>

<description>

Export all tranfer, exports all nodes for specified scopes

</description>

</transfer>

</extension>

非當簡單的轉送,僅提供必要的資訊。

   

<extension point=

"org.eclipse.ui.preferenceTransfer"

>

<transfer name=

"Bare Bones Transfer Test"

id=

"org.eclipse.ui.tests.all"

>

<mapping scope=

"instance"

>

</mapping>

</transfer>

</extension>

匯出許多按鍵及節點組合的範例

   

<extension point=

"org.eclipse.ui.preferenceTransfer"

>

<transfer icon=

"XYZ.gif"

name=

"Export many preferences"

id=

"org.eclipse.ui.tests.all"

>

<mapping scope=

"instance"

>

<entry node=

"org.eclipse.ui"

>

<key name=

"showIntro,DOCK_PERSPECTIVE_BAR"

/>

</entry>

<entry node=

"org.eclipse.ui.workbench"

>

<key name=

"bogus,RUN_IN_BACKGROUND"

/>

</entry>

<entry node=

"org.eclipse.ui.ide"

/>

<entry node=

"org.eclipse.core.resources"

/>

</mapping>

<mapping scope=

"configuration"

>

</mapping>

<description>

Export many combinations of keys and nodes

</description>

</transfer>

</extension>