Tworzenie okien dialogowych specyficznych dla języka Java

W poniższym fragmencie kodu użyto klasy JavaUI do otwarcia okna dialogowego Otwórz typ:

    public IType selectType() throws JavaModelException {
        SelectionDialog dialog= JavaUI.createTypeDialog(
            parent, new ProgressMonitorDialog(parent),
            SearchEngine.createWorkspaceScope(),
            IJavaElementSearchConstants.CONSIDER_ALL_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];
    }

Klasa JavaUI udostępnia dodatkowe metody do tworzenia okien dialogowych Otwórz pakiet i Otwórz typ główny.