org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog Java Examples

The following examples show how to use org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DialogUtils.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
public static IFolder chooseProjectFolder(Shell shell, IProject container) {
    FilteredResourcesSelectionDialog dlg = new FilteredResourcesSelectionDialog(shell, false, container, IResource.FOLDER & (~IResource.HIDDEN));
    dlg.setInitialPattern("**"); //$NON-NLS-1$
    if (dlg.open() == FilteredResourcesSelectionDialog.OK ) {
        return (IFolder)(dlg.getResult()[0]);
    }
    
    return null;
}
 
Example #2
Source File: NewExperimentWizardPage.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Uses the standard container selection dialog to choose the new value for the container field.
 *
 * @throws CoreException
 */
void handleBrowse() {
	final IContainer p = ResourcesPlugin.getWorkspace().getRoot();
	dialog = new FilteredResourcesSelectionDialog(getShell(), false, p, Resource.FILE);
	dialog.setInitialPattern("*.gaml");
	dialog.setTitle("Choose a gaml model in project " + p.getName());
	if (dialog.open() == Window.OK) {
		final Object[] result = dialog.getResult();
		if (result.length == 1) {
			final IResource res = (IResource) result[0];
			modelChooser.setText(res.getFullPath().toString());
		}
	}
}