public void setSelection(ISelection selection, boolean reveal) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection, reveal); } }
@Override public void setSelection(ISelection selection) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection); } }
@Override public void setSelection(ISelection selection) { fViewer.setSelection(selection); }
@Override public void setSelection(ISelection selection) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection); } }
public void setSelection(ISelection selection) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection); } }
public void setSelection(ISelection selection, boolean reveal) { if (fViewerInFocus != null) { fViewerInFocus.setSelection(selection, reveal); } }
void setSelection(ISelection selection, boolean reveal) { if (selection != null && selection.equals(fViewer.getSelection())) return; fProcessSelectionEvents= false; fViewer.setSelection(selection, reveal); fProcessSelectionEvents= true; }
void setSelection(ISelection selection, boolean reveal) { if (selection != null && selection.equals(fViewer.getSelection())) return; fProcessSelectionEvents= false; fViewer.setSelection(selection, reveal); fProcessSelectionEvents= true; }
protected void setInput(Object input) { // Don't allow to clear input for this view if (input != null) super.setInput(input); else getViewer().setSelection(null); }
@Override public boolean selectChange(int flag) { if (flag == INavigatable.FIRST_CHANGE) { getViewer().setSelection(StructuredSelection.EMPTY); flag = INavigatable.NEXT_CHANGE; } else if (flag == INavigatable.LAST_CHANGE) { getViewer().setSelection(StructuredSelection.EMPTY); flag = INavigatable.PREVIOUS_CHANGE; } return navigate((TreeViewer)getViewer(), flag == INavigatable.NEXT_CHANGE, true, false); }
private void selectColorAtOffset(int offset) { String namedStyle = getNamedStyleAtOffset(offset); if (namedStyle != null) { fStylesViewer.setSelection(new StructuredSelection(namedStyle)); fStylesViewer.reveal(namedStyle); } else { fStylesViewer.setSelection(StructuredSelection.EMPTY); } activate(namedStyle); }
@Override protected void setInput(Object input) { // Don't allow to clear input for this view if (input != null) super.setInput(input); else getViewer().setSelection(null); }
@Override protected void setInput(Object input) { // Don't allow to clear input for this view if (input != null) super.setInput(input); else getViewer().setSelection(null); }
public boolean selectChange(int flag) { if (flag == INavigatable.FIRST_CHANGE) { getViewer().setSelection(StructuredSelection.EMPTY); flag = INavigatable.NEXT_CHANGE; } else if (flag == INavigatable.LAST_CHANGE) { getViewer().setSelection(StructuredSelection.EMPTY); flag = INavigatable.PREVIOUS_CHANGE; } return navigate((TreeViewer)getViewer(), flag == INavigatable.NEXT_CHANGE, true, false); }
@Override public void replace(final Object oldElement, final Object newElement, final int position) { final List<Object> selectedElements = new ArrayList<>(viewer.getStructuredSelection().toList()); remove(oldElement, position); insert(newElement, position); // Preserve selection selectionContains(selectedElements, oldElement).ifPresent(iter -> { iter.remove(); selectedElements.add(newElement); viewer.setSelection(new StructuredSelection(selectedElements)); }); }
public void initialize() { super.initialize(); fListViewer.setInput(fListModel); fListViewer.setSelection(new StructuredSelection(fJavaCategory)); }
public void run() { if (fAnnotationTypeViewer != null && !fAnnotationTypeViewer.getControl().isDisposed()) { fAnnotationTypeViewer.setSelection(new StructuredSelection(fListModel[0])); initializeFields(); } } });
/** * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent) */ public void widgetSelected(SelectionEvent e) { super.widgetSelected(e); if (sViewer instanceof TableTreeViewer) { TableTreeItem tableTreeItem = (TableTreeItem)getRow().getData(TABLETREEITEM_ID); StructuredSelection selection = new StructuredSelection(tableTreeItem.getData()); sViewer.setSelection(selection, true); } }
protected void performDefaults() { super.performDefaults(); getOverlayStore().loadDefaults(); applyStyles(); fStylesViewer.setSelection(StructuredSelection.EMPTY); activate(null); fText.redraw(); }
@SuppressWarnings("unchecked") public static <T> void multiSelectionList(StructuredViewer viewer, RxBox<ImmutableList<T>> box) { Preconditions.checkArgument(SwtMisc.flagIsSet(SWT.MULTI, viewer.getControl()), "Control style does not have SWT.MULTI set."); // set the box when the selection changes viewer.addSelectionChangedListener(event -> { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); box.set(ImmutableList.copyOf(selection.toList())); }); // set the selection when the box changes SwtExec.immediate().guardOn(viewer.getControl()).subscribe(box, list -> { viewer.setSelection(new StructuredSelection(list)); }); }