复制参与者

org.eclipse.ltk.core.refactoring.copyParticipants

3.1

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

<!ELEMENT extension (copyParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT copyParticipant (enablement)>

<!ATTLIST copyParticipant

id              CDATA #REQUIRED

name            CDATA #REQUIRED

class           CDATA #REQUIRED

processOnCancel CDATA #IMPLIED>


以下示例定义用于复制文件的参与者。如果一个受重构影响的项目具有 Java 性质,则启用该参与者。

<copyParticipant id=

"org.eclipse.samples.copyParticipant"

name=

"%CopyFileParticipant.name"

class=

"org.eclipse.samples.CopyFileParticipant"

>

<enablement>

<with variable=

"affectedNatures"

>

<iterate operator=

"or"

>

<equals value=

"org.eclipse.jdt.core.javanature"

/>

</iterate>

</with>

<with variable=

"element"

>

<instanceof value=

"org.eclipse.core.resources.IFile"

/>

</with>

</enablement>

</copyParticipant>

提供的类必须扩展 org.eclipse.ltk.core.refactoring.participants.CopyParticipant