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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/ConvertGetterToMethodAction_NEW.java

Issue 766323002: Compressed/optimized navigation notification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updates for review comments. Created 6 years 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/ui/actions/ConvertGetterToMethodAction_NEW.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/ConvertGetterToMethodAction_NEW.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/ConvertGetterToMethodAction_NEW.java
index 9d4889c1119bce1fc1de17234f6870f6b32b5090..2f276f40b59d0b267e2ea0cb8889762a7f6932cc 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/ConvertGetterToMethodAction_NEW.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/ConvertGetterToMethodAction_NEW.java
@@ -13,9 +13,9 @@
*/
package com.google.dart.tools.ui.actions;
-import com.google.dart.server.generated.types.Element;
import com.google.dart.server.generated.types.ElementKind;
import com.google.dart.server.generated.types.NavigationRegion;
+import com.google.dart.server.generated.types.NavigationTarget;
import com.google.dart.tools.core.DartCore;
import com.google.dart.tools.core.analysis.model.AnalysisServerNavigationListener;
import com.google.dart.tools.ui.internal.actions.NewSelectionConverter;
@@ -86,10 +86,10 @@ public class ConvertGetterToMethodAction_NEW extends AbstractRefactoringAction_N
private void updateSelectedElement() {
setEnabled(false);
- Element[] elements = NewSelectionConverter.getNavigationTargets(file, selectionOffset);
- if (elements.length != 0) {
- Element element = elements[0];
- String kind = element.getKind();
+ NavigationTarget[] targets = NewSelectionConverter.getNavigationTargets(file, selectionOffset);
+ if (targets.length != 0) {
+ NavigationTarget target = targets[0];
+ String kind = target.getKind();
setEnabled(kind.equals(ElementKind.GETTER));
}
}

Powered by Google App Engine
This is Rietveld 408576698