/** * {@inheritDoc} */ @Override protected void setInput(ISelection selection) { if (!selection.isEmpty()) { assignment = (ExceptionSensorAssignment) ((IStructuredSelection) selection).getFirstElement(); } else { assignment = null; // NOPMD } }
/** * {@inheritDoc} */ @Override protected void setInput(ISelection selection) { if (!selection.isEmpty()) { assignment = (MethodSensorAssignment) ((IStructuredSelection) selection).getFirstElement(); } else { assignment = null; // NOPMD } }
public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection.isEmpty()) { fRemoveImportsButton.setEnabled(false); } else { fRemoveImportsButton.setEnabled(true); } } });
public void run() { if (selection.isEmpty()) internalSetContentPaneInput(fStructurePane2.getInput()); else internalSetContentPaneInput(getElement(selection)); } }
public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection.isEmpty()) { fRemoveFilterButton.setEnabled(false); } else { fRemoveFilterButton.setEnabled(true); } } });
@Override public ISelection getActiveContext() { if (fBreadcrumbSelection != null && !fBreadcrumbSelection.isEmpty()) { return fBreadcrumbSelection; } else { ISelection treeViewerSelection = fTreeViewerContextProvider.getActiveContext(); return treeViewerSelection != null ? treeViewerSelection : StructuredSelection.EMPTY; } }
private Object countable(final ISelection sel) { if (sel.isEmpty()) { return ICOUNT_0; } if (sel instanceof IStructuredSelection) { final IStructuredSelection ss = (IStructuredSelection) sel; return (ICountable) () -> ss.size(); } return ICOUNT_1; }
@Override public void selectionChanged(SelectionChangedEvent event){ if (fOpenButton != null){ fOpenButton.setEnabled(! getTableViewer().getSelection().isEmpty()); } } });
protected void updateButtonState() { ISelection selection = panel.getTableViewer().getSelection(); okButton.setEnabled(!selection.isEmpty()); } }
/** * {@inheritDoc} */ @Override protected void setInput(ISelection selection) { super.setInput(selection); if (!selection.isEmpty()) { assignment = (ChartingMethodSensorAssignment) ((IStructuredSelection) selection).getFirstElement(); } else { assignment = null; // NOPMD } }
@Override public void selectionChanged(SelectionChangedEvent event) { setEnabled(! event.getSelection().isEmpty()); } });
/** * {@inheritDoc} */ @Override protected void setInput(ISelection selection) { super.setInput(selection); if (!selection.isEmpty()) { assignment = (TimerMethodSensorAssignment) ((IStructuredSelection) selection).getFirstElement(); } else { assignment = null; // NOPMD } }
public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof TextSelection) { // only update global actions updateActions(event.getSelection()); } else if (selection.isEmpty()) { // XXX a styled text widget has lost focus, re-enable all edit actions forceEditActionsEnabled(); } }
public void widgetSelected(SelectionEvent e) { if (fStylesViewer.getSelection().isEmpty()) return; String namedStyle = ((IStructuredSelection) fStylesViewer.getSelection()).getFirstElement().toString(); getOverlayStore().setToDefault(namedStyle); applyStyles(); fText.redraw(); activate(namedStyle); } });
private boolean revealAndVerify(Object element) { if (element == null) return false; selectReveal(new StructuredSelection(element)); return ! getSite().getSelectionProvider().getSelection().isEmpty(); }
@Override public void selectionChanged(SelectionChangedEvent e) { ISelection s= e.getSelection(); if (s == null || s.isEmpty()) feed1(s); if (isEditionSelectionDialog()) firePropertyChange(new PropertyChangeEvent(this, PROP_SELECTED_EDITION, null, getSelectedEdition())); } }
/** * Activates the breadcrumb. This sets the keyboard focus * inside this breadcrumb and retargets the editor * actions. */ public void activate() { if (fBreadcrumbViewer.getSelection().isEmpty()) fBreadcrumbViewer.setSelection(new StructuredSelection(fBreadcrumbViewer.getInput())); fBreadcrumbViewer.setFocus(); }
@Override public void dragStart(DragSourceEvent event) { ISelection selection = fViewer.getSelection(); LocalSelectionTransfer.getTransfer().setSelection(selection); LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL); event.doit = !selection.isEmpty(); }
public ISelection getSelection() { StructuredViewer viewer = installedIUGroup.getStructuredViewer(); ISelection selection = viewer.getSelection(); if (selection.isEmpty()) { final Object[] all = ((IStructuredContentProvider) viewer.getContentProvider()).getElements(viewer.getInput()); return new StructuredSelection(all); } return selection; }
@Override public void refresh() { fTreeViewer.refresh(); super.refresh(); if (fTreeViewer.getSelection().isEmpty() && fSchema.getElementCount() > 0) { fTreeViewer.setSelection(new StructuredSelection(fSchema.getElements()[0])); } }