重命名参与者

org.eclipse.ltk.core.refactoring.renameParticipants

3.0

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

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