// TODO try to preselect the current file
dialog.open();
Object[] results = dialog.getResult();
if (results != null && results.length > 0 && results[0] instanceof IResource) {
IPath path = ((IResource) results[0]).getFullPath();
if (project != null && path.segment(0).equals(project.getProject().getName())) {
setProjectLoc(path.removeFirstSegments(1).makeRelative().toString());
} else {
String containerName = path.makeRelative().toString();
setWorkspaceLoc("${workspace_loc:" + containerName + "}");
}