Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java

Issue 22831038: Issue 12566. Add 'Who declares' and 'Who uses' items into omnibox. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java
index b8b532c6e179522f2bb84f42191eb6992f3f29e5..bac955597963d754afcc7bd75ef554d455a0e889 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/search/internal/ui/FindReferencesAction.java
@@ -60,6 +60,24 @@ import java.util.Set;
*/
public class FindReferencesAction extends AbstractDartSelectionAction {
/**
+ * Shows "Search" view with references to non-local elements with given name.
+ */
+ public static void searchNameUses(final String name) {
+ try {
+ SearchView view = (SearchView) DartToolsPlugin.getActivePage().showView(SearchView.ID);
+ view.showPage(new SearchMatchPage(view, "Searching for references...") {
+ @Override
+ protected List<SearchMatch> runQuery() {
+ SearchEngine searchEngine = DartCore.getProjectManager().newSearchEngine();
+ return searchEngine.searchQualifiedMemberReferences(name, null, null);
+ }
+ });
+ } catch (Throwable e) {
+ ExceptionHandler.handle(e, "Find references", "Exception during search.");
+ }
+ }
+
+ /**
* @return {@code true} if given {@link DartSelection} looks valid.
*/
private static boolean isValidSelection(DartSelection selection) {

Powered by Google App Engine
This is Rietveld 408576698