SWTとJFaceに必要な外部JARファイルを特定する - Identify the Required External JAR Files for SWT and JFace

http://wiki.eclipse.org/index.php/JFace#Identify_the_Required_External_JAR_Files_for_SWT_and_JFaceの日本語訳。
JFaceを使うために必要なJARファイルを知りたかったので翻訳しました。

本文

JFaceプロジェクトには、SWTのクラスとJFaceのクラス、その他JFaceが依存するEclipseのクラスが必要です。SWTプロジェクトのウェブサイトから、SWTのクラスを含むファイルをダウンロードできます。JFaceのファイルとJFaceが依存するファイルは、プロジェクトに手動で追加する必要があります。
JFaceを使うために必要なJARファイルを特定することが最初の一歩です。主要なファイルは、org.eclipse.jfaceの後にバージョン情報が続く名前のファイルです。さらに、このファイルはその他のEclipseのJARファイルに依存します。JFaceに必要なJARファイルは、Eclipseバージョン3.3.1.1では以下の通りです(<version info>にはバージョン情報が入ります)

A JFace project requires the SWT classes, JFace classes, and other Eclipse classes that JFace is dependent on. The SWT classes will be provided in the file we download from the SWT Project Website. The JFace file, and the files the JFace is dependent upon, need to be added to the project manually.
The first step is to identify the required JAR files for JFace. The primary file is called org.eclipse.jface, followed by specific version information. In addition, this file requires classes from other Eclipse JAR files. For Eclipse version 3.3.1.1, the required JAR files for JFace are as follows (where <version info> is the specific version information):

  • org.eclipse.core.commands_<version info>.jar
  • org.eclipse.equinox.common_<version info>.jar
  • org.eclipse.jface_<version info>.jar
  • org.eclipse.osgi_<version info>.jar
  • org.eclipse.ui.workbench_<version info>.jar

標準的なJFaceクラスの起動には、ファイルorg.eclipse.ui.workbench_<version info>.jarは必要ありません。しかし、このjarによっていくつかの有用なDialog(ListDialogやListSelectionDialogなど)を使えるようになるので、一覧に含めました。
プラグイン開発環境がある場合は、プラグイン依存関係ビューで自分のバージョンのEclipseでのJFaceの依存関係を調べることができます。以下のように調べます:

The file org.eclipse.ui.workbench_<version info>.jar is not required to run the standard JFace classes. However, since it adds a number of very useful Dialogs (such as ListDialog, ListSelectionDialog, and others), it is included here as well.
You can find the JFace dependencies for any Eclipse version if you have the Plug-in Development Environment, which includes the Plug-ins and Plug-in Dependencies views. To do this:

1. ウィンドウ/ビューの表示/PDE/プラグインを選択。(PDEビューフォルダが見つからない場合、Eclipseプラグイン開発環境がインストールされていません。)
2. 一覧からorg.eclipse.jfaceプラグインを選択。
3. 右クリックして「依存関係を開く」を選択。プラグイン依存関係ビューが表示されます。以下はこのビューの例です。

4. 「フラットレイアウトを設定します」ボタンを押すと、必要なプラグインがシンプルな一覧で見ることができます。以下のようになります。

5. 一覧の各プラグインは、Eclipseのpluginsディレクトリ内のJARファイルに対応します。あなたのEclipseのバージョンの一覧が上記の一覧と異なる場合には、足りないものを追加してください。これで、必要なJARファイルの一覧が揃いました。

1. Select Window/Show View/PDE/Plug-ins. (Note, if you don't have a PDE view folder, it means you don't have the Plug-in Developer Environment plug-in in your Eclipse installation.)
2. Select the org.eclipse.jface plug-in from the list.
3. Right-click and select Open Dependencies. This will open the Plug-in Dependencies view. An example of this view for Eclipse version 3.3.1.1 is shown below.
4. Press the Set Flat Layout button to see a simple flat list of the required plug-ins, as shown below.
5. Each plug-in on the list corresponds to a JAR file in the plugins directory for your Eclipse installation. If the list for your Eclipse version is different than the list above, make a note of it and modify the remaining instructions accordingly. At this point, we have the list of JAR files that we need.