1 14 package org.eclipse.jdt.internal.ui.callhierarchy; 15 16 import org.eclipse.ui.PlatformUI; 17 18 import org.eclipse.jdt.core.IMethod; 19 import org.eclipse.jdt.core.search.IJavaSearchScope; 20 21 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 22 import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; 23 24 25 class SearchScopeProjectAction extends SearchScopeAction { 26 private final SearchScopeActionGroup fGroup; 27 28 public SearchScopeProjectAction(SearchScopeActionGroup group) { 29 super(group, CallHierarchyMessages.SearchScopeActionGroup_project_text); 30 this.fGroup = group; 31 setToolTipText(CallHierarchyMessages.SearchScopeActionGroup_project_tooltip); 32 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_SEARCH_SCOPE_ACTION); 33 } 34 35 public IJavaSearchScope getSearchScope() { 36 IMethod method = this.fGroup.getView().getMethod(); 37 if (method == null) { 38 return null; 39 } 40 41 JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance(); 42 return factory.createJavaProjectSearchScope(method.getJavaProject(), true); 43 } 44 45 48 public int getSearchScopeType() { 49 return SearchScopeActionGroup.SEARCH_SCOPE_TYPE_PROJECT; 50 } 51 52 55 public String getFullDescription() { 56 IMethod method = this.fGroup.getView().getMethod(); 57 if (method != null) { 58 JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance(); 59 return factory.getProjectScopeDescription(method.getJavaProject(), true); 60 } 61 return ""; } 63 } 64 | Popular Tags |