1 11 package org.eclipse.ui.views.navigator; 12 13 import org.eclipse.jface.viewers.Viewer; 14 import org.eclipse.swt.widgets.Shell; 15 import org.eclipse.ui.IWorkbench; 16 import org.eclipse.ui.IWorkbenchWindow; 17 import org.eclipse.ui.PlatformUI; 18 import org.eclipse.ui.actions.SelectionProviderAction; 19 20 23 public abstract class ResourceNavigatorAction extends SelectionProviderAction { 24 25 private IResourceNavigator navigator; 26 27 30 public ResourceNavigatorAction(IResourceNavigator navigator, String label) { 31 super(navigator.getViewer(), label); 32 this.navigator = navigator; 33 } 34 35 38 public IResourceNavigator getNavigator() { 39 return navigator; 40 } 41 42 45 protected Viewer getViewer() { 46 return getNavigator().getViewer(); 47 } 48 49 52 protected Shell getShell() { 53 return getNavigator().getSite().getShell(); 54 } 55 56 59 protected IWorkbench getWorkbench() { 60 return PlatformUI.getWorkbench(); 61 } 62 63 66 protected IWorkbenchWindow getWorkbenchWindow() { 67 return getNavigator().getSite().getWorkbenchWindow(); 68 } 69 } 70 | Popular Tags |