Participants の移動

org.eclipse.ltk.core.refactoring.moveParticipants

3.0

この拡張ポイントを使用して、リファクタリング移動 participant を定義します。 式のリーダーは、<with variable="..."> 式エレメントを介して参照可能な、以下の事前定義値を提供します。 式の評価の際に使用されるデフォルトの変数は、エレメント変数にバウンドされます。

<!ELEMENT extension (moveParticipant*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT moveParticipant (enablement)>

<!ATTLIST moveParticipant

id    CDATA #REQUIRED

name  CDATA #REQUIRED

class CDATA #REQUIRED>


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

<moveParticipant id=

"org.eclipse.jdt.junit.moveTypeParticipant"

name=

"%MoveTypeParticipant.name"

class=

"org.eclipse.jdt.internal.junit.ui.TypeMoveParticipant"

>

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

</moveParticipant>

提供されたクラスは、org.eclipse.ltk.core.refactoring.participants.MoveParticipant を拡張しなければなりません。