org.eclipse.ui.dialogs.IWorkingSetSelectionDialog Java Examples

The following examples show how to use org.eclipse.ui.dialogs.IWorkingSetSelectionDialog. 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: GlobalRefreshResourceSelectionPage.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private void selectWorkingSetAction() {
	IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(getShell(), true);
	dialog.open();
	IWorkingSet[] sets = dialog.getSelection();
	if(sets != null) {
		workingSets = sets;
	} else {
		// dialog cancelled
		return;
	}
	updateWorkingSetScope();
	updateWorkingSetLabel();
	
	participantScope.setSelection(false);
	selectedResourcesScope.setSelection(false);
	workingSetScope.setSelection(true);
}
 
Example #2
Source File: SelectWorkingSetAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void run() {
	Shell shell= getShell();
	IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
	IWorkingSetSelectionDialog dialog= manager.createWorkingSetSelectionDialog(shell, false);
	IWorkingSet workingSet= fActionGroup.getWorkingSet();
	if (workingSet != null)
		dialog.setSelection(new IWorkingSet[]{workingSet});

	if (dialog.open() == Window.OK) {
		IWorkingSet[] result= dialog.getSelection();
		if (result != null && result.length > 0) {
			fActionGroup.setWorkingSet(result[0], true);
			manager.addRecentWorkingSet(result[0]);
		}
		else
			fActionGroup.setWorkingSet(null, true);
	}
}
 
Example #3
Source File: JavaSearchScopeFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public IWorkingSet[] queryWorkingSets() throws InterruptedException {
	Shell shell= JavaPlugin.getActiveWorkbenchShell();
	if (shell == null)
		return null;
	IWorkingSetSelectionDialog dialog= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
	if (dialog.open() != Window.OK) {
		throw new InterruptedException();
	}

	IWorkingSet[] workingSets= dialog.getSelection();
	if (workingSets.length > 0)
		return workingSets;
	return null; // 'no working set' selected
}