1 11 package org.eclipse.jdt.ui.actions; 12 13 import org.eclipse.ui.IWorkbenchSite; 14 import org.eclipse.ui.PlatformUI; 15 16 import org.eclipse.jdt.core.ICompilationUnit; 17 import org.eclipse.jdt.core.IField; 18 import org.eclipse.jdt.core.IImportDeclaration; 19 import org.eclipse.jdt.core.ILocalVariable; 20 import org.eclipse.jdt.core.IMethod; 21 import org.eclipse.jdt.core.IPackageDeclaration; 22 import org.eclipse.jdt.core.IPackageFragment; 23 import org.eclipse.jdt.core.IType; 24 import org.eclipse.jdt.core.ITypeParameter; 25 import org.eclipse.jdt.core.search.IJavaSearchConstants; 26 27 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 28 import org.eclipse.jdt.internal.ui.JavaPluginImages; 29 import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; 30 import org.eclipse.jdt.internal.ui.search.SearchMessages; 31 32 42 public class FindDeclarationsAction extends FindAction { 43 44 51 public FindDeclarationsAction(IWorkbenchSite site) { 52 super(site); 53 } 54 55 59 public FindDeclarationsAction(JavaEditor editor) { 60 super(editor); 61 } 62 63 void init() { 64 setText(SearchMessages.Search_FindDeclarationAction_label); 65 setToolTipText(SearchMessages.Search_FindDeclarationAction_tooltip); 66 setImageDescriptor(JavaPluginImages.DESC_OBJS_SEARCH_DECL); 67 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.FIND_DECLARATIONS_IN_WORKSPACE_ACTION); 68 } 69 70 Class [] getValidTypes() { 71 return new Class [] { IField.class, IMethod.class, IType.class, ICompilationUnit.class, IPackageDeclaration.class, IImportDeclaration.class, IPackageFragment.class, ILocalVariable.class, ITypeParameter.class }; 72 } 73 74 int getLimitTo() { 75 return IJavaSearchConstants.DECLARATIONS | IJavaSearchConstants.IGNORE_DECLARING_TYPE | IJavaSearchConstants.IGNORE_RETURN_TYPE; 76 } 77 78 } 79 | Popular Tags |