ITreeContentProvider cp = new WorkbenchContentProvider();
Class<?>[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
ViewerFilter filter = new TypedViewerFilter( acceptedClasses );
FolderSelectionDialog dialog = new FolderSelectionDialog( parent, lp, cp );
dialog.setTitle( "Output directory" );
dialog.setMessage( "Select output directory" );
dialog.addFilter( filter );
dialog.setInput( ResourcesPlugin.getWorkspace().getRoot() );
if ( dialog.open() == Window.OK ) {
IContainer c = (IContainer) dialog.getFirstResult();
if ( c.getProject() == ( (IFileEditorInput) getEditorInput() ).getFile().getProject() ) {
return "${project}/" + c.getProjectRelativePath().toString();
}
else {
return "${workspace}/" + c.getProject().getName() + "/" + c.getProjectRelativePath().toString();