重新命名參與者

org.eclipse.ltk.core.refactoring.renameParticipants

3.0

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

<!ELEMENT extension (renameParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT renameParticipant (enablement)>

<!ATTLIST renameParticipant

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


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

<renameParticipant id=

"org.eclipse.jdt.junit.renameTypeParticipant"

name=

"%RenameTypeParticipant.name"

class=

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

>

<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>

</renameParticipant>

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