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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/DartRefactoringArguments.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.ui/src/com/google/dart/tools/internal/corext/refactoring/DartRefactoringArguments.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/DartRefactoringArguments.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/DartRefactoringArguments.java
new file mode 100644
index 0000000000000000000000000000000000000000..49412143c90827a15f8fddecd0f7b6c1f9890d43
--- /dev/null
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/internal/corext/refactoring/DartRefactoringArguments.java
@@ -0,0 +1,53 @@
+package com.google.dart.tools.internal.corext.refactoring;
+
+import com.google.dart.tools.core.refactoring.descriptors.DartRefactoringDescriptor;
+
+import java.util.Map;
+
+/**
+ * A wrapper around the Map received from {@link DartRefactoringDescriptor} to access and convert
+ * the options.
+ */
+public final class DartRefactoringArguments {
+
+ /** The attribute map (element type: <code>&lt;String, String&gt;</code>) */
+ private final Map<String, String> fAttributes;
+
+ /** The name of the project, or <code>null</code> for the workspace */
+ private final String fProject;
+
+ /**
+ * Creates a new refactoring arguments from arguments
+ *
+ * @param project the project, or <code>null</code> for the workspace
+ * @param arguments the arguments
+ */
+ public DartRefactoringArguments(String project, Map<String, String> arguments) {
+ fProject = project;
+ fAttributes = arguments;
+ }
+
+ /**
+ * Returns the attribute with the specified name.
+ *
+ * @param name the name of the attribute
+ * @return the attribute value, or <code>null</code>
+ */
+ public String getAttribute(final String name) {
+ return fAttributes.get(name);
+ }
+
+ /**
+ * Returns the name of the project.
+ *
+ * @return the name of the project, or <code>null</code> for the workspace
+ */
+ public String getProject() {
+ return fProject;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getName() + fAttributes.toString();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698