删除参与者

org.eclipse.ltk.core.refactoring.deleteParticipants

3.0

此扩展点用来定义重构删除参与者。表达式的阅读器提供以下预定义的变量,可以通过 <with variable="..."> 表达式元素来引用这些变量: 在表达式求值期间使用的缺省变量将绑定至元素变量。

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