Participants の作成

org.eclipse.ltk.core.refactoring.createParticipants

3.0

この拡張ポイントを使用して、リファクタリング作成 participant を定義します。 式のリーダーは、<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>


作成 participant を定義する例を、以下に示します。 リファクタリングによって影響を受けるプロジェクトの 1 つが Java ネーチャーを持つ場合で、 作成されるエレメントがフォルダーであるときに、participant が使用可能になります。

<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 を拡張しなければなりません。