for (int i=0; i<p.length; i++) {
//FIXME: we should make sure that we are adding IJavaProjects because
// the ProjectSelectionDialog constructor expects Set<IJavaProject> projectsWithSpecifics
projects.add(p[i]);
}
ProjectSelectionDialog dialog = new ProjectSelectionDialog(Display.getCurrent().getActiveShell(), projects);
dialog.setTitle(Messages.AddMacroLibrary_Title);
dialog.setMessage(Messages.AddMacroLibrary_Message);
int rtn = dialog.open();
if (rtn == IDialogConstants.OK_ID) {
if (dialog.getFirstResult() instanceof IJavaProject) {
project = ((IJavaProject) dialog.getFirstResult()).getProject();
}
else {
MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.AddMacroLibrary_Error, Messages.AddMacroLibrary_ErrorDesc);
}
}