Use GWT's built-in JsArray instead of NativeList
These are basically identical, except for a couple of utility methods, which are easily moved to static methods in Natives. Change-Id: I6fa23f462dc270595a19f4b373622ddee37e498e
This commit is contained in:
@@ -14,16 +14,16 @@
|
||||
|
||||
package com.google.gerrit.client.dashboards;
|
||||
|
||||
import com.google.gerrit.client.rpc.NativeList;
|
||||
import com.google.gerrit.client.rpc.RestApi;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gwt.core.client.JsArray;
|
||||
import com.google.gwt.http.client.URL;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
/** Project dashboards from {@code /projects/<name>/dashboards/}. */
|
||||
public class DashboardList extends NativeList<DashboardInfo> {
|
||||
public class DashboardList extends JsArray<DashboardInfo> {
|
||||
public static void all(Project.NameKey project,
|
||||
AsyncCallback<NativeList<DashboardList>> callback) {
|
||||
AsyncCallback<JsArray<DashboardList>> callback) {
|
||||
base(project).addParameterTrue("inherited").get(callback);
|
||||
}
|
||||
|
||||
|
@@ -15,10 +15,11 @@
|
||||
package com.google.gerrit.client.dashboards;
|
||||
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.rpc.NativeList;
|
||||
import com.google.gerrit.client.rpc.Natives;
|
||||
import com.google.gerrit.client.ui.NavigationTable;
|
||||
import com.google.gerrit.common.PageLinks;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gwt.core.client.JsArray;
|
||||
import com.google.gwt.user.client.History;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
|
||||
@@ -53,13 +54,13 @@ public class DashboardsTable extends NavigationTable<DashboardInfo> {
|
||||
}
|
||||
|
||||
public void display(DashboardList dashes) {
|
||||
display(dashes.asList());
|
||||
display(Natives.asList(dashes));
|
||||
}
|
||||
|
||||
public void display(NativeList<DashboardList> in) {
|
||||
public void display(JsArray<DashboardList> in) {
|
||||
Map<String, DashboardInfo> map = new HashMap<String, DashboardInfo>();
|
||||
for (DashboardList list : in.asList()) {
|
||||
for (DashboardInfo d : list.asList()) {
|
||||
for (DashboardList list : Natives.asList(in)) {
|
||||
for (DashboardInfo d : Natives.asList(list)) {
|
||||
if (!map.containsKey(d.id())) {
|
||||
map.put(d.id(), d);
|
||||
}
|
||||
|
Reference in New Issue
Block a user