私は最近 Eclipse 4 に移行しました。Eclipse 3.x では、どのエディターがファイル拡張子に関連付けられるかを定義するために、関連付けられた拡張子を持つエディター拡張子を定義する必要がありました。エディターが継承しなくなったEclipse 4でそれを行う方法はEditorPart
、依存性注入で定義された部分です。
ここに古いバージョンがあります。プロジェクト ビューで特定の拡張子 (例: bcx) を持つファイルをダブルクリックしたときに開かれるカスタム エディターを定義するためのベスト プラクティスは何ですか?
<extension
point="org.eclipse.ui.editors">
<editor
class="com.abb.pestc.cothex.ui.editors.AirToAirEditor"
default="true"
extensions="acx"
icon="icons/cothexAirToAir.png"
id="com.abb.pestc.cothex.ui.editors.AirToAirEditor"
name="Air to Air Editor">
</editor>
<editor
class="com.abb.pestc.cothex.ui.editors.BaseToAirEditor"
default="true"
extensions="bcx"
icon="icons/cothexBaseToAir.png"
id="com.abb.pestc.cothex.ui.editors.BaseToAirEditor"
name="Base to Air Editor">
</editor>
</extension>