1 11 package org.eclipse.jdt.internal.ui.packageview; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.viewers.IStructuredSelection; 15 16 19 class GotoRequiredProjectAction extends Action { 20 21 private PackageExplorerPart fPackageExplorer; 22 23 GotoRequiredProjectAction(PackageExplorerPart part) { 24 super(PackagesMessages.GotoRequiredProjectAction_label); 25 setDescription(PackagesMessages.GotoRequiredProjectAction_description); 26 setToolTipText(PackagesMessages.GotoRequiredProjectAction_tooltip); 27 fPackageExplorer= part; 28 } 29 30 public void run() { 31 IStructuredSelection selection= (IStructuredSelection)fPackageExplorer.getSite().getSelectionProvider().getSelection(); 32 Object element= selection.getFirstElement(); 33 if (element instanceof ClassPathContainer.RequiredProjectWrapper) { 34 ClassPathContainer.RequiredProjectWrapper wrapper= (ClassPathContainer.RequiredProjectWrapper) element; 35 fPackageExplorer.tryToReveal(wrapper.getProject()); 36 } 37 } 38 } 39 | Popular Tags |