| 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();
|
| }
|
| }
|
|
|