@Override public void setSelection(ISelection s) { if (fViewer != null) fViewer.setSelection(s); }
/** * The viewer implementation of this <code>ISelectionProvider</code> * method make the new selection for this viewer without making it visible. * <p> * This method is equivalent to <code>setSelection(selection,false)</code>. * </p> * <p> * Note that some implementations may not be able to set the selection * without also revealing it, for example (as of 3.3) TreeViewer. * </p> */ public void setSelection(ISelection selection) { setSelection(selection, false); }
public void setSelection(ISelection s) { if (fViewer != null) fViewer.setSelection(s); }
/** * The viewer implementation of this <code>ISelectionProvider</code> * method make the new selection for this viewer without making it visible. * <p> * This method is equivalent to <code>setSelection(selection,false)</code>. * </p> * <p> * Note that some implementations may not be able to set the selection * without also revealing it, for example (as of 3.3) TreeViewer. * </p> */ @Override public void setSelection(ISelection selection) { setSelection(selection, false); }
/** * The viewer implementation of this <code>ISelectionProvider</code> * method make the new selection for this viewer without making it visible. * <p> * This method is equivalent to <code>setSelection(selection,false)</code>. * </p> * <p> * Note that some implementations may not be able to set the selection * without also revealing it, for example (as of 3.3) TreeViewer. * </p> */ @Override public void setSelection(ISelection selection) { setSelection(selection, false); }
public void run() { // Try to select the items in the current content viewer of the editor. // if (currentViewer != null) { currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); } } };
/** * Set the initial selection in the tree. */ public void doInitialTreeSelection() { fLaunchConfigurationView.getViewer().setSelection(fInitialSelection); }
public void setViewerSelection(Node node) { if (fViewer != null) { fViewer.setSelection(new StructuredSelection(node), true); } } }
public void setViewerSelection(List list) { if (fViewer != null) { fViewer.setSelection(new StructuredSelection(list), true); } }
/** * Set the selection on a structured viewer. * * @param viewer * @param selected */ private static void setSelectionOn(Viewer viewer, final Object selected) { ISelection selection; if (selected == null) { selection = StructuredSelection.EMPTY; } else { selection = new StructuredSelection(selected); } boolean reveal = selection != StructuredSelection.EMPTY; viewer.setSelection(selection, reveal); }
@Override public void run() { viewer.setSelection(viewer.getSelection()); viewer.refresh(); } });
@Override protected void doSetValue(Object source, Object value) { IStructuredSelection selection = value == null ? StructuredSelection.EMPTY : new StructuredSelection(value); if (source instanceof Viewer) { ((Viewer) source).setSelection(selection, true); } else { ((ISelectionProvider) source).setSelection(selection); } }
/** * Move the libraries of the given selection up. * @param selection the current viewer selection */ public void up(IStructuredSelection selection) { Set libraries= getSelectedLibraries(selection); for (int i= 0; i < fLibraries.length - 1; i++) { if (libraries.contains(fLibraries[i + 1])) { LibraryStandin temp= fLibraries[i]; fLibraries[i]= fLibraries[i + 1]; fLibraries[i + 1]= temp; } } fViewer.refresh(); fViewer.setSelection(selection); }
/** * Move the libraries of the given selection down. * @param selection the current viewer selection */ public void down(IStructuredSelection selection) { Set libraries= getSelectedLibraries(selection); for (int i= fLibraries.length - 1; i > 0; i--) { if (libraries.contains(fLibraries[i - 1])) { LibraryStandin temp= fLibraries[i]; fLibraries[i]= fLibraries[i - 1]; fLibraries[i - 1]= temp; } } fViewer.refresh(); fViewer.setSelection(selection); }
/** * @see IActionDelegate#run(IAction) */ @Override public void run(IAction action){ if (!(getView() instanceof IDebugView)) { return; } Viewer viewer = ((IDebugView) getView()).getViewer(); if (viewer instanceof TreeViewer) { ArrayList<TreeItem> allVisible= new ArrayList<>(); Tree tree= ((TreeViewer) viewer).getTree(); collectExpandedAndVisible(tree.getItems(), allVisible); tree.setSelection(allVisible.toArray(new TreeItem[allVisible.size()])); // force viewer selection change viewer.setSelection(viewer.getSelection()); } }
/** * Resets the selected and checked delegate in the preferred launcher view part to be the one from the workspace */ private void resetDelegate() { try { ILaunchDelegate preferred = fConfiguration.getType().getPreferredDelegate(getCurrentModeSet()); Viewer viewer = getViewer(); if(preferred != null) { viewer.setSelection(new StructuredSelection(preferred)); } else { viewer.setSelection(new StructuredSelection()); } getButton(IDialogConstants.OK_ID).setEnabled(isValid()); } catch (CoreException ce) {DebugUIPlugin.log(ce);} }
@Override public void run() { Viewer viewer = getView().getViewer(); Control control = viewer.getControl(); if (control instanceof Table) { ((Table) control).selectAll(); viewer.setSelection(viewer.getSelection(), false); } } }
@Override public void run(IAction action) { Viewer viewer = ((AbstractDebugView) getView()).getViewer(); ((Tree) viewer.getControl()).selectAll(); // ensure that the selection change callback is fired viewer.setSelection(viewer.getSelection()); }
@Override protected void initializeControls() { final Viewer viewer = getViewer(); try { ILaunchDelegate delegate = fConfiguration.getPreferredDelegate(getCurrentModeSet()); if(delegate != null) { viewer.setSelection(new StructuredSelection(delegate)); configspecific.setSelection(true); } else { viewer.getControl().setEnabled(false); resetDelegate(); } } catch (CoreException ce) {DebugUIPlugin.log(ce);} }
protected void selectServerProcess(Object process) { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ; if (window != null) { IWorkbenchPage page = window.getActivePage(); if (page != null) { IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW); if (part != null) { IDebugView view = (IDebugView)part.getAdapter(IDebugView.class); if (view != null) { Viewer viewer = view.getViewer(); if (viewer != null) { viewer.setSelection(new StructuredSelection(process)); } } } } } }