use of org.jboss.tools.openshift.internal.common.ui.SelectExistingProjectDialog in project jbosstools-openshift by jbosstools.
the class ApplicationSourceListPage method onBrowseProjects.
/**
* Open a dialog box to select an open project when clicking on the 'Browse' button.
*
* @return
*/
private SelectionListener onBrowseProjects() {
return new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SelectExistingProjectDialog dialog = new SelectExistingProjectDialog(model.getEclipseProject() == null ? "Select an existing workspace project from the list below." : NLS.bind("Currently project {0} is selected, you may pick a different one from the list below.", model.getEclipseProject().getName()), getShell());
if (model.getEclipseProject() != null) {
dialog.setInitialSelections(new Object[] { model.getEclipseProject() });
}
if (dialog.open() == Dialog.OK) {
Object selectedProject = dialog.getFirstResult();
model.setEclipseProject(((org.eclipse.core.resources.IProject) selectedProject));
}
}
};
}
Aggregations