@Override public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) { ArrayList<ISourceContainer> containers = new ArrayList<>(); IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true); if (dialog.open() == Window.OK) { IWorkingSet[] selections = dialog.getSelection(); if (selections != null) { for (int i = 0; i < selections.length; i++) { containers.add(new WorkingSetSourceContainer(selections[i])); } } } return containers.toArray(new ISourceContainer[containers.size()]); }
public void widgetSelected(final SelectionEvent e) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(shell, true, WORKING_SET_IDS.toArray(new String[0])); if(dialog.open() == Window.OK) { IWorkingSet[] workingSets = dialog.getSelection(); selectWorkingSets(Arrays.asList(workingSets)); } } });
public void widgetSelected(SelectionEvent e) { Shell shell = getShell(); IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true); if ( dialog.open() == Window.OK){ workingSets = dialog.getSelection(); valueForWorkingSetsText = ""; for (int i = 0; i < workingSets.length; i++){ valueForWorkingSetsText += workingSets[i].getLabel(); // if not the last item, we add a comma if ( i != workingSets.length - 1) valueForWorkingSetsText += ", "; } workingSetsText.setText(valueForWorkingSetsText); } // Set working sets radio button enabled, disable other buttons radioButton[2].setSelection(false); radioButton[1].setSelection(false); radioButton[0].setSelection(false); radioButton[3].setSelection(true); scopeChangeHandler(radioButton[3]); } });
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 }
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 }
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); }
public IWorkingSet[] queryWorkingSets() throws JavaModelException, 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 }
@Override public void run(IAction action) { IWorkingSetSelectionDialog selectionDialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog( DebugUIPlugin.getShell(), false, new String[] {IDebugUIConstants.BREAKPOINT_WORKINGSET_ID}); selectionDialog.open(); } }
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); }
private IWorkingSet queryForWorkingSet() { IWorkingSetManager manager = window.getWorkbench() .getWorkingSetManager(); IWorkingSetSelectionDialog dialog = manager .createWorkingSetSelectionDialog(window.getShell(), false); dialog.open(); IWorkingSet[] sets = dialog.getSelection(); //check for cancel if (sets == null || sets.length == 0) { return null; } return sets[0]; }
/** * Calls a dialog asking the user to choose the working Sets he wants * to do the search on * @return */ public static IWorkingSet[] queryWorkingSets(){ Shell shell= XSDEditorPlugin.getShell(); if (shell == null) return null; IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true); if (dialog.open() == Window.OK) { IWorkingSet[] workingSets= dialog.getSelection(); if (workingSets.length > 0) return workingSets; } return null; } }
private void handleAddWorkingSet() { IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(PDEPlugin.getActiveWorkbenchShell(), true); if (dialog.open() == Window.OK) { IWorkingSet[] workingSets = dialog.getSelection(); IProduct product = getProduct(); IProductModelFactory factory = product.getModel().getFactory(); ArrayList<IProductPlugin> pluginList = new ArrayList<>(); for (IWorkingSet workingSet : workingSets) { IAdaptable[] elements = workingSet.getElements(); for (IAdaptable element : elements) { IPluginModelBase model = findModel(element); if (model != null) { IProductPlugin plugin = factory.createPlugin(); IPluginBase base = model.getPluginBase(); plugin.setId(base.getId()); pluginList.add(plugin); } } } product.addPlugins(pluginList.toArray(new IProductPlugin[pluginList.size()])); } }
/** * Handles the working set choose button pressed. Returns the name of the chosen working set or <code>null</code> if none. */ private void handleChooseButtonPressed() { IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(getShell(), false); if (dialog.open() == Window.CANCEL) { return; } IWorkingSet[] sets = dialog.getSelection(); if (sets == null) { return; } if (sets.length == 0) { setWorkingSet(null); // ok pressed with no working set selected } else { setWorkingSet(sets[0]); // We disallowed multi-select } }
@Override protected ISearchQuery createQuery(TextSearchQueryProvider provider, String searchForString) throws CoreException { IWorkbenchPage page= getWorkbenchPage(); if (page != null) { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog= manager.createWorkingSetSelectionDialog(page.getWorkbenchWindow().getShell(), true); if (dialog.open() == Window.OK) { IWorkingSet[] workingSets= dialog.getSelection(); if (workingSets != null) { return provider.createQuery(searchForString, workingSets); } } } throw new OperationCanceledException(); } }
protected ISearchQuery createQuery(TextSearchQueryProvider provider, String searchForString) throws CoreException { IWorkbenchPage page= getWorkbenchPage(); if (page != null) { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog= manager.createWorkingSetSelectionDialog(page.getWorkbenchWindow().getShell(), true); if (dialog.open() == Window.OK) { IWorkingSet[] workingSets= dialog.getSelection(); if (workingSets != null) { return provider.createQuery(searchForString, workingSets); } } } throw new OperationCanceledException(); } }
@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); } }
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); } }
@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); } }
private void handleWorkingSets() { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(getShell(), true); if (dialog.open() == Window.OK) { String[] ids = getPluginIDs(dialog.getSelection()); for (String id : ids) { IPluginModelBase model = PluginRegistry.findModel(id); if (model != null) { if (!fPluginTreeViewer.getChecked(model)) { setChecked(model, true); if (model.getUnderlyingResource() == null) { fNumExternalChecked += 1; } else { fNumWorkspaceChecked += 1; } } } } adjustGroupState(); } }
/** * Opens the working set selection dialog. */ void selectPressed() { IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench() .getWorkingSetManager().createWorkingSetSelectionDialog( getShell(), false); IWorkingSet workingSet = getWorkingSet(); if (workingSet != null) { dialog.setSelection(new IWorkingSet[] { workingSet }); } if (dialog.open() == Window.OK) { IWorkingSet[] result = dialog.getSelection(); if (result != null && result.length > 0) { setWorkingSet(result[0]); } else { setWorkingSet(null); } if (getSelection() == false) { setSelection(true); } } }