JDT UI プラグインは、ユーティリティー・クラス JavaUI を提供します。 このクラスを使用することにより、プログラムで JDT ユーザー・インターフェースを起動することができます。
以下は、型プロンプター・ダイアログを開くコードの断片です。
public IType selectType() throws JavaModelException
{
SelectionDialog dialog=
JavaUI.createTypeDialog(parent,
new ProgressMonitorDialog(parent),
SearchEngine.createWorkspaceScope(),
IJavaElementSearchConstants.CONSIDER_TYPES,
false);
dialog.setTitle("My Dialog Title");
dialog.setMessage("My Dialog Message");
if (dialog.open() == IDialogConstants.CANCEL_ID)
return null;
Object[] types= dialog.getResult();
if (types == null || types.length == 0)
return
null;
return (IType)types[0];
}