刪除參與者

org.eclipse.ltk.core.refactoring.deleteParticipants

3.0

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

<!ELEMENT extension (deleteParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT deleteParticipant (enablement)>

<!ATTLIST deleteParticipant

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


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

<deleteParticipant id=

"org.myCompany.deleteParticipant"

name=

"%DeleteParticipant.name"

class=

"org.myCompany.Participant"

>

<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.ICompilationUnit"

/>

</with>

</enablement>

</deleteParticipant>

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