private ISelection getSelection() { ISelectionProvider provider = fView.getSite().getSelectionProvider(); if (provider != null) { return provider.getSelection(); } return null; }
private ISelection getSelection() { ISelectionProvider provider= fViewPart.getSite().getSelectionProvider(); if (provider != null) { return provider.getSelection(); } return null; }
public void selectionChanged(SelectionChangedEvent event) { ((MultiPageSelectionProvider) getSite() .getSelectionProvider()) .fireSelectionChanged(event); } });
/** * Creates a new <code>GenerateActionGroup</code>. The group * requires that the selection provided by the part's selection provider * is of type <code>org.eclipse.jface.viewers.IStructuredSelection</code>. * * @param part the view part that owns this action group */ public GenerateBuildPathActionGroup(IViewPart part) { this(part.getSite(), part.getSite().getSelectionProvider()); } /**
private ISelection getSelection() { ISelectionProvider provider= fViewPart.getSite().getSelectionProvider(); if (provider != null) { return provider.getSelection(); } return null; }
private ISelection getSelection() { ISelectionProvider provider= fView.getSite().getSelectionProvider(); if (provider != null) { return provider.getSelection(); } return null; }
public ShowInContext getShowInContext() { return new ShowInContext( null, getSite().getSelectionProvider().getSelection()); } };
@Override public ShowInContext getShowInContext() { return new ShowInContext( null, getSite().getSelectionProvider().getSelection()); } };
private void uninstallSelectionListener(IWorkbenchPart part) { ISelectionProvider provider = part.getSite().getSelectionProvider(); if (provider instanceof IPostSelectionProvider) ((IPostSelectionProvider) provider) .removePostSelectionChangedListener(this); else if (provider != null) provider.removeSelectionChangedListener(this); monitoredPart = null; }
protected ISelection getTargetSelection() { IWorkbenchPart part = getTargetPart(); if (part != null) { ISelectionProvider provider = part.getSite().getSelectionProvider(); if (provider != null) { return provider.getSelection(); } } return null; }
/** * Maximizes the active sub-view if that is possible. */ public void maximizeActiveSubView() { if (canMaximizeActiveSubView()) { maximizeSubView((AbstractCompositeSubView) subView, activeSubView); isMaximizedMode = true; ISelectionProvider selectionProvider = getSite().getSelectionProvider(); selectionProvider.setSelection(StructuredSelection.EMPTY); } }
void setSelectionFromEditor(IWorkbenchPart part) { if (!fProcessSelectionEvents || !linkBrowsingViewSelectionToEditor() || !(part instanceof IEditorPart)) return; IWorkbenchPartSite site= part.getSite(); if (site == null) return; ISelectionProvider provider= site.getSelectionProvider(); if (provider != null) setSelectionFromEditor(part, provider.getSelection()); }
void setSelectionFromEditor(IWorkbenchPart part) { if (!fProcessSelectionEvents || !linkBrowsingViewSelectionToEditor() || !(part instanceof IEditorPart)) return; IWorkbenchPartSite site= part.getSite(); if (site == null) return; ISelectionProvider provider= site.getSelectionProvider(); if (provider != null) setSelectionFromEditor(part, provider.getSelection()); }
@Override public void selectionChanged(SelectionChangedEvent event) { // only handle selection changed from parent's selection provider if (event.getSource() == fParent.getSite().getSelectionProvider()) { MemoryBlocksTreeViewPane.this.selectionChanged(fParent, event.getSelection()); } }
private boolean revealAndVerify(Object element) { if (element == null) return false; selectReveal(new StructuredSelection(element)); return ! getSite().getSelectionProvider().getSelection().isEmpty(); }
public void run() { IStructuredSelection selection= (IStructuredSelection)fPackageExplorer.getSite().getSelectionProvider().getSelection(); Object element= selection.getFirstElement(); if (element instanceof ClassPathContainer.RequiredProjectWrapper) { ClassPathContainer.RequiredProjectWrapper wrapper= (ClassPathContainer.RequiredProjectWrapper) element; fPackageExplorer.tryToReveal(wrapper.getProject()); } } }
public EditWatchExpressinInPlaceAction(ExpressionView view) { fView = view; fViewer = (TreeModelViewer)view.getViewer(); fEditActionDelegate.init(view); ISelectionProvider selectionProvider = fView.getSite().getSelectionProvider(); selectionProvider.addSelectionChangedListener(this); fEditActionDelegate.selectionChanged(this, selectionProvider.getSelection()); }
private void fillMethodsViewerContextMenu(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); // viewer entries fMethodsViewer.contributeToContextMenu(menu); fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection())); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
private void fillTypesViewerContextMenu(TypeHierarchyViewer viewer, IMenuManager menu) { JavaPlugin.createStandardGroups(menu); menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, new Separator(GROUP_FOCUS)); // viewer entries viewer.contributeToContextMenu(menu); if (fFocusOnSelectionAction.canActionBeAdded()) menu.appendToGroup(GROUP_FOCUS, fFocusOnSelectionAction); menu.appendToGroup(GROUP_FOCUS, fFocusOnTypeAction); fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection())); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
private void fillTypesViewerContextMenu(TypeHierarchyViewer viewer, IMenuManager menu) { JavaPlugin.createStandardGroups(menu); menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, new Separator(GROUP_FOCUS)); // viewer entries viewer.contributeToContextMenu(menu); if (fFocusOnSelectionAction.canActionBeAdded()) menu.appendToGroup(GROUP_FOCUS, fFocusOnSelectionAction); menu.appendToGroup(GROUP_FOCUS, fFocusOnTypeAction); fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection())); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }