创建参与者

org.eclipse.ltk.core.refactoring.createParticipants

3.0

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

<!ELEMENT extension (createParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT createParticipant (enablement)>

<!ATTLIST createParticipant

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


以下示例定义创建参与者。如果一个受重构影响的项目具有 Java 性质且当要创建的元素是文件夹时,则启用该参与者。

<createParticipant id=

"org.myCompany.createParticipant"

name=

"%CreateParticipant.name"

class=

"org.myCompany.CreateParticipant"

>

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

/>

</with>

</enablement>

</createParticipant>

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