| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/NavigationRegion.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/NavigationRegion.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/NavigationRegion.java
|
| index 8da8dbafe01681c939c221db98da99c1250999fb..a968156fc87410df4703e73d4034c19ceafd6e9e 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/NavigationRegion.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/NavigationRegion.java
|
| @@ -54,15 +54,17 @@ public class NavigationRegion {
|
| private final int length;
|
|
|
| /**
|
| - * The elements to which the given region is bound. By opening the declaration of the elements,
|
| - * clients can implement one form of navigation.
|
| + * The indexes of the targets (in the enclosing navigation response) to which the given region is
|
| + * bound. By opening the target, clients can implement one form of navigation.
|
| */
|
| - private final List<Element> targets;
|
| + private final int[] targets;
|
| +
|
| + private final List<NavigationTarget> targetObjects = Lists.newArrayList();
|
|
|
| /**
|
| * Constructor for {@link NavigationRegion}.
|
| */
|
| - public NavigationRegion(int offset, int length, List<Element> targets) {
|
| + public NavigationRegion(int offset, int length, int[] targets) {
|
| this.offset = offset;
|
| this.length = length;
|
| this.targets = targets;
|
| @@ -79,7 +81,7 @@ public class NavigationRegion {
|
| return
|
| other.offset == offset &&
|
| other.length == length &&
|
| - ObjectUtilities.equals(other.targets, targets);
|
| + Arrays.equals(other.targets, targets);
|
| }
|
| return false;
|
| }
|
| @@ -87,7 +89,7 @@ public class NavigationRegion {
|
| public static NavigationRegion fromJson(JsonObject jsonObject) {
|
| int offset = jsonObject.get("offset").getAsInt();
|
| int length = jsonObject.get("length").getAsInt();
|
| - List<Element> targets = Element.fromJsonArray(jsonObject.get("targets").getAsJsonArray());
|
| + int[] targets = JsonUtilities.decodeIntArray(jsonObject.get("targets").getAsJsonArray());
|
| return new NavigationRegion(offset, length, targets);
|
| }
|
|
|
| @@ -103,6 +105,10 @@ public class NavigationRegion {
|
| return list;
|
| }
|
|
|
| + public List<NavigationTarget> getTargetObjects() {
|
| + return targetObjects;
|
| + }
|
| +
|
| /**
|
| * The length of the region from which the user can navigate.
|
| */
|
| @@ -118,10 +124,10 @@ public class NavigationRegion {
|
| }
|
|
|
| /**
|
| - * The elements to which the given region is bound. By opening the declaration of the elements,
|
| - * clients can implement one form of navigation.
|
| + * The indexes of the targets (in the enclosing navigation response) to which the given region is
|
| + * bound. By opening the target, clients can implement one form of navigation.
|
| */
|
| - public List<Element> getTargets() {
|
| + public int[] getTargets() {
|
| return targets;
|
| }
|
|
|
| @@ -134,13 +140,21 @@ public class NavigationRegion {
|
| return builder.toHashCode();
|
| }
|
|
|
| + public void lookupTargets(List<NavigationTarget> allTargets) {
|
| + for (int i = 0; i < targets.length; i++) {
|
| + int targetIndex = targets[i];
|
| + NavigationTarget target = allTargets.get(targetIndex);
|
| + targetObjects.add(target);
|
| + }
|
| + }
|
| +
|
| public JsonObject toJson() {
|
| JsonObject jsonObject = new JsonObject();
|
| jsonObject.addProperty("offset", offset);
|
| jsonObject.addProperty("length", length);
|
| JsonArray jsonArrayTargets = new JsonArray();
|
| - for (Element elt : targets) {
|
| - jsonArrayTargets.add(elt.toJson());
|
| + for (int elt : targets) {
|
| + jsonArrayTargets.add(new JsonPrimitive(elt));
|
| }
|
| jsonObject.add("targets", jsonArrayTargets);
|
| return jsonObject;
|
|
|