public ISelection getSelection() { if (fViewerInFocus != null) { return fViewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
/** * {@inheritDoc} */ public Object getUIState() { return fViewer.getSelection(); }
@Override public ISelection getSelection() { if (fViewerInFocus != null) { return fViewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
/** * Returns the current selection. */ protected ISelection getSelection() { StructuredViewer viewerInFocus= fSelectionProviderMediator.getViewerInFocus(); if (viewerInFocus != null) { return viewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
private IStructuredSelection getCurrentSelection() { Viewer viewer = getViewer(); if (viewer instanceof StructuredViewer) { StructuredViewer sv = (StructuredViewer) viewer; ISelection selection = sv.getSelection(); if (selection instanceof IStructuredSelection) { return (IStructuredSelection) selection; } } return StructuredSelection.EMPTY; }
/** * Returns the current selection. * @return selection */ protected ISelection getSelection() { StructuredViewer viewerInFocus= fSelectionProviderMediator.getViewerInFocus(); if (viewerInFocus != null) { return viewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
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; }
/** * Returns the current selection. * @return selection */ protected ISelection getSelection() { StructuredViewer viewerInFocus= fSelectionProviderMediator.getViewerInFocus(); if (viewerInFocus != null) { return viewerInFocus.getSelection(); } return StructuredSelection.EMPTY; }
private Iterator getSelection() { ISelection s= fViewer.getSelection(); if (s instanceof IStructuredSelection) return ((IStructuredSelection)s).iterator(); return Collections.EMPTY_LIST.iterator(); }
@Override public void dragStart(DragSourceEvent event) { IStructuredSelection selection= (IStructuredSelection)fViewer.getSelection(); if (selection.isEmpty()) { event.doit= false; return; } super.dragStart(event); } }
@Override public void dragStart(DragSourceEvent event) { IStructuredSelection selection= (IStructuredSelection)fViewer.getSelection(); if (selection.isEmpty()) { event.doit= false; return; } super.dragStart(event); } }
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); } });
@Override public void dragSetData(DragSourceEvent event) { IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); Object[] list = selection.toList().toArray(); for (Object object : list) { if (object instanceof PrimitiveFeatureTreeNode) { event.data = ((PrimitiveFeatureTreeNode) object).getValue(); } else if (object instanceof AnnotationTreeNode) { event.data = ((AnnotationTreeNode) object).getAnnotation().getCoveredText(); } } }
public synchronized Saveable[] getActiveSaveables() { ITreeContentProvider contentProvider = (ITreeContentProvider) viewer .getContentProvider(); IStructuredSelection selection = (IStructuredSelection) viewer .getSelection(); if (selection instanceof ITreeSelection) { return getActiveSaveablesFromTreeSelection((ITreeSelection) selection); } else if (contentProvider instanceof ITreePathContentProvider) { return getActiveSaveablesFromTreePathProvider(selection, (ITreePathContentProvider) contentProvider); } else { return getActiveSaveablesFromTreeProvider(selection, contentProvider); } }
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; }
public void menuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection= (IStructuredSelection) fViewer.getSelection(); int size= selection.size(); Object element= selection.getFirstElement(); if (size == 1) addOpenNewWindowAction(menu, element); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
@Override public void menuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection= (IStructuredSelection) fViewer.getSelection(); int size= selection.size(); Object element= selection.getFirstElement(); if (size == 1) addOpenNewWindowAction(menu, element); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
@Override public void menuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection= (IStructuredSelection) fViewer.getSelection(); int size= selection.size(); Object element= selection.getFirstElement(); if (size == 1) addOpenNewWindowAction(menu, element); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
/** * Invoked once when the action bars are set. * @param actionBars the action bars */ protected void fillActionBars(IActionBars actionBars) { getActionGroup().fillActionBars(actionBars); updateActionBars((IStructuredSelection) getViewer().getSelection()); Object input = getViewer().getInput(); if (input instanceof ISynchronizeModelElement) { getActionGroup().modelChanged((ISynchronizeModelElement) input); } }