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.IField; 17 import org.eclipse.jdt.core.ILocalVariable; 18 import org.eclipse.jdt.core.search.IJavaSearchConstants; 19 20 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 21 import org.eclipse.jdt.internal.ui.JavaPluginImages; 22 import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; 23 import org.eclipse.jdt.internal.ui.search.SearchMessages; 24 25 34 public class FindReadReferencesAction extends FindReferencesAction { 35 36 43 public FindReadReferencesAction(IWorkbenchSite site) { 44 super(site); 45 } 46 47 51 public FindReadReferencesAction(JavaEditor editor) { 52 super(editor); 53 } 54 55 Class [] getValidTypes() { 56 return new Class [] { IField.class, ILocalVariable.class }; 57 } 58 59 void init() { 60 setText(SearchMessages.Search_FindReadReferencesAction_label); 61 setToolTipText(SearchMessages.Search_FindReadReferencesAction_tooltip); 62 setImageDescriptor(JavaPluginImages.DESC_OBJS_SEARCH_REF); 63 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.FIND_READ_REFERENCES_IN_WORKSPACE_ACTION); 64 } 65 66 int getLimitTo() { 67 return IJavaSearchConstants.READ_ACCESSES; 68 } 69 70 String getOperationUnavailableMessage() { 71 return SearchMessages.JavaElementAction_operationUnavailable_field; 72 } 73 } 74 | Popular Tags |