| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RenameOptions.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RemoveContentOverlay.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RenameOptions.java
|
| similarity index 63%
|
| copy from editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RemoveContentOverlay.java
|
| copy to editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RenameOptions.java
|
| index 72758a7f73900db530028bd06af695e70f3f10ed..70039c4377b2cb8aa7de6966697e1305dc7fdd0b 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RemoveContentOverlay.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/RenameOptions.java
|
| @@ -32,50 +32,47 @@ import java.util.Iterator;
|
| import org.apache.commons.lang3.StringUtils;
|
|
|
| /**
|
| - * A directive to remove an existing file content overlay. After processing this directive, the
|
| - * file contents will once again be read from the file system.
|
| - *
|
| - * If this directive is used on a file that doesn't currently have a content overlay, it has no
|
| - * effect.
|
| - *
|
| * @coverage dart.server.generated.types
|
| */
|
| @SuppressWarnings("unused")
|
| -public class RemoveContentOverlay {
|
| +public class RenameOptions extends RefactoringOptions {
|
|
|
| - public static final RemoveContentOverlay[] EMPTY_ARRAY = new RemoveContentOverlay[0];
|
| + public static final RenameOptions[] EMPTY_ARRAY = new RenameOptions[0];
|
|
|
| - public static final List<RemoveContentOverlay> EMPTY_LIST = Lists.newArrayList();
|
| + public static final List<RenameOptions> EMPTY_LIST = Lists.newArrayList();
|
|
|
| - private final String type;
|
| + /**
|
| + * The name that the element should have after the refactoring.
|
| + */
|
| + private final String newName;
|
|
|
| /**
|
| - * Constructor for {@link RemoveContentOverlay}.
|
| + * Constructor for {@link RenameOptions}.
|
| */
|
| - public RemoveContentOverlay() {
|
| - this.type = "remove";
|
| + public RenameOptions(String newName) {
|
| + this.newName = newName;
|
| }
|
|
|
| @Override
|
| public boolean equals(Object obj) {
|
| - if (obj instanceof RemoveContentOverlay) {
|
| - RemoveContentOverlay other = (RemoveContentOverlay) obj;
|
| + if (obj instanceof RenameOptions) {
|
| + RenameOptions other = (RenameOptions) obj;
|
| return
|
| - ObjectUtilities.equals(other.type, type);
|
| + ObjectUtilities.equals(other.newName, newName);
|
| }
|
| return false;
|
| }
|
|
|
| - public static RemoveContentOverlay fromJson(JsonObject jsonObject) {
|
| - String type = jsonObject.get("type").getAsString();
|
| - return new RemoveContentOverlay();
|
| + public static RenameOptions fromJson(JsonObject jsonObject) {
|
| + String newName = jsonObject.get("newName").getAsString();
|
| + return new RenameOptions(newName);
|
| }
|
|
|
| - public static List<RemoveContentOverlay> fromJsonArray(JsonArray jsonArray) {
|
| + public static List<RenameOptions> fromJsonArray(JsonArray jsonArray) {
|
| if (jsonArray == null) {
|
| return EMPTY_LIST;
|
| }
|
| - ArrayList<RemoveContentOverlay> list = new ArrayList<RemoveContentOverlay>(jsonArray.size());
|
| + ArrayList<RenameOptions> list = new ArrayList<RenameOptions>(jsonArray.size());
|
| Iterator<JsonElement> iterator = jsonArray.iterator();
|
| while (iterator.hasNext()) {
|
| list.add(fromJson(iterator.next().getAsJsonObject()));
|
| @@ -83,20 +80,23 @@ public class RemoveContentOverlay {
|
| return list;
|
| }
|
|
|
| - public String getType() {
|
| - return type;
|
| + /**
|
| + * The name that the element should have after the refactoring.
|
| + */
|
| + public String getNewName() {
|
| + return newName;
|
| }
|
|
|
| @Override
|
| public int hashCode() {
|
| HashCodeBuilder builder = new HashCodeBuilder();
|
| - builder.append(type);
|
| + builder.append(newName);
|
| return builder.toHashCode();
|
| }
|
|
|
| public JsonObject toJson() {
|
| JsonObject jsonObject = new JsonObject();
|
| - jsonObject.addProperty("type", type);
|
| + jsonObject.addProperty("newName", newName);
|
| return jsonObject;
|
| }
|
|
|
| @@ -104,8 +104,8 @@ public class RemoveContentOverlay {
|
| public String toString() {
|
| StringBuilder builder = new StringBuilder();
|
| builder.append("[");
|
| - builder.append("type=");
|
| - builder.append(type);
|
| + builder.append("newName=");
|
| + builder.append(newName);
|
| builder.append("]");
|
| return builder.toString();
|
| }
|
|
|