use of org.whole.lang.ui.controls.JavaSourceFolderValidator in project whole by wholeplatform.
the class OperationLauncherRegistry method openJavaSourceFoldersDialog.
public static IContainer[] openJavaSourceFoldersDialog(Shell shell, boolean allowMultipleSelection) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
dialog.setValidator(new JavaSourceFolderValidator());
dialog.setTitle("Java Source Folder Selection");
dialog.setMessage("Choose a destination folder for generated code");
dialog.addFilter(new JavaSourceFolderFilter());
dialog.setInput(JDTUtils.getWorkspaceRoot());
dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
dialog.setAllowMultiple(allowMultipleSelection);
if (dialog.open() == Window.OK) {
Object[] elements = dialog.getResult();
IContainer[] containers = new IContainer[elements.length];
for (int i = 0; i < containers.length; i++) containers[i] = (IContainer) elements[i];
return containers;
}
return new IContainer[0];
}
Aggregations