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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerMoveFileRefactoring.java

Issue 589723002: Use MOVE_FILE refactoring to implement file rename participant in Editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/ui/internal/refactoring/ServerMoveFileRefactoring.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerInlineLocalRefactoring.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerMoveFileRefactoring.java
similarity index 59%
copy from editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerInlineLocalRefactoring.java
copy to editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerMoveFileRefactoring.java
index 29f63eba2047fcf0edfc34921a6b7f1114b205e7..9228ccc86b30bf73998e00c8a9c76af434ac1234 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerInlineLocalRefactoring.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/refactoring/ServerMoveFileRefactoring.java
@@ -14,41 +14,39 @@
package com.google.dart.tools.ui.internal.refactoring;
-import com.google.dart.server.generated.types.InlineLocalVariableFeedback;
+import com.google.dart.server.generated.types.MoveFileOptions;
import com.google.dart.server.generated.types.RefactoringFeedback;
import com.google.dart.server.generated.types.RefactoringKind;
import com.google.dart.server.generated.types.RefactoringOptions;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+
/**
- * LTK wrapper around Analysis Server 'Inline Local' refactoring.
+ * LTK wrapper around Analysis Server 'Move File' refactoring.
*
* @coverage dart.editor.ui.refactoring.ui
*/
-public class ServerInlineLocalRefactoring extends ServerRefactoring {
- private String variableName;
- private int occurrences;
-
- public ServerInlineLocalRefactoring(String file, int offset, int length) {
- super(RefactoringKind.INLINE_LOCAL_VARIABLE, "Inline Local", file, offset, length);
- }
+public class ServerMoveFileRefactoring extends ServerRefactoring {
+ private MoveFileOptions options = new MoveFileOptions(null);
- public int getOccurrences() {
- return occurrences;
+ public ServerMoveFileRefactoring(String file) {
+ super(RefactoringKind.MOVE_FILE, "Move File", file, 0, 0);
}
- public String getVariableName() {
- return variableName;
+ public RefactoringStatus setNewFile(String newFile) {
+ options.setNewFile(newFile);
+ if (!setOptions(true)) {
+ return TIMEOUT_STATUS;
+ }
+ return optionsStatus;
}
@Override
protected RefactoringOptions getOptions() {
- return null;
+ return options;
}
@Override
protected void setFeedback(RefactoringFeedback _feedback) {
- InlineLocalVariableFeedback feedback = (InlineLocalVariableFeedback) _feedback;
- variableName = feedback.getName();
- occurrences = feedback.getOccurrences();
}
}

Powered by Google App Engine
This is Rietveld 408576698