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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/refactoring/descriptors/DartRefactoringContribution.java

Issue 9834028: Initial implementation of "Rename Local Variable" refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: LInked/inline mode for rename Created 8 years, 9 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.core/src/com/google/dart/tools/core/refactoring/descriptors/DartRefactoringContribution.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/refactoring/descriptors/DartRefactoringContribution.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/refactoring/descriptors/DartRefactoringContribution.java
new file mode 100644
index 0000000000000000000000000000000000000000..41ac89f217ff4f4d197ffb0f050eb46405e147e6
--- /dev/null
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/refactoring/descriptors/DartRefactoringContribution.java
@@ -0,0 +1,40 @@
+package com.google.dart.tools.core.refactoring.descriptors;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringContribution;
+import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
+import java.util.Map;
+
+/**
+ * Partial implementation of a Dart refactoring contribution.
+ * <p>
+ * Note: this class is not intended to be extended outside the refactoring framework.
+ * </p>
+ */
+public abstract class DartRefactoringContribution extends RefactoringContribution {
+
+ /**
+ * Creates the a new refactoring instance.
+ *
+ * @param descriptor the refactoring descriptor
+ * @param status the status used for the resulting status
+ * @return the refactoring, or <code>null</code>
+ * @throws CoreException if an error occurs while creating the refactoring
+ */
+ public abstract Refactoring createRefactoring(DartRefactoringDescriptor descriptor,
+ RefactoringStatus status) throws CoreException;
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public final Map<String, String> retrieveArgumentMap(final RefactoringDescriptor descriptor) {
+ Assert.isNotNull(descriptor);
+ if (descriptor instanceof DartRefactoringDescriptor) {
+ return ((DartRefactoringDescriptor) descriptor).getArguments();
+ }
+ return super.retrieveArgumentMap(descriptor);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698