移動參與者

org.eclipse.ltk.core.refactoring.moveParticipants

3.0

這個延伸點用來定義重構移動參與者。表示式的讀者提供下列預先定義的變數,您可透過 <with variable="..."> 表示式元素來參照它們: 在表示式評估期間使用的預設變數會連結到 element 變數。

<!ELEMENT extension (moveParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT moveParticipant (enablement)>

<!ATTLIST moveParticipant

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


下列範例定義類型移動參與者。如果受重構影響的其中一個專案具有 Java 性質,而且要移動的類型是 JUnit 測試時, 則啟用這個參與者。

<moveParticipant id=

"org.eclipse.jdt.junit.moveTypeParticipant"

name=

"%MoveTypeParticipant.name"

class=

"org.eclipse.jdt.internal.junit.ui.TypeMoveParticipant"

>

<enablement>

<with variable=

"affectedNatures"

>

<iterate operator=

"or"

>

<equals value=

"org.eclipse.jdt.core.javanature"

/>

</iterate>

</with>

<with variable=

"element"

>

<instanceof value=

"org.eclipse.jdt.core.IType"

/>

<test property=

"org.eclipse.jdt.junit.isTest"

/>

</with>

</enablement>

</moveParticipant>

構成的類別必須延伸 org.eclipse.ltk.core.refactoring.participants.MoveParticipant