commit | 3364aa26891c91766e28419f3caed71a49c25e60 | [log] [tgz] |
---|---|---|
author | rice@google.com <rice@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Wed Apr 14 17:17:19 2010 +0000 |
committer | rice@google.com <rice@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Wed Apr 14 17:17:19 2010 +0000 |
tree | 0ab29451b7a8e9e9e152d3eb8cbf95c4a865b1f4 | |
parent | c706e77d53b66a4663acbe73937fcd831a6a65f5 [diff] |
Move logic to send initial onRangedChanged to AbstractListViewAdapter.addView instead of ListView.setDelegate Review at http://gwt-code-reviews.appspot.com/349801 Review by: rjrjr@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7921 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/bikeshed/src/com/google/gwt/bikeshed/list/client/PagingTableListView.java b/bikeshed/src/com/google/gwt/bikeshed/list/client/PagingTableListView.java index d883ac9..703f902 100644 --- a/bikeshed/src/com/google/gwt/bikeshed/list/client/PagingTableListView.java +++ b/bikeshed/src/com/google/gwt/bikeshed/list/client/PagingTableListView.java
@@ -231,9 +231,6 @@ public void setDelegate(Delegate<T> delegate) { this.delegate = delegate; - if (delegate != null) { - delegate.onRangeChanged(this); - } } /**
diff --git a/bikeshed/src/com/google/gwt/bikeshed/list/client/SimpleCellList.java b/bikeshed/src/com/google/gwt/bikeshed/list/client/SimpleCellList.java index 7738c44..93c846f 100644 --- a/bikeshed/src/com/google/gwt/bikeshed/list/client/SimpleCellList.java +++ b/bikeshed/src/com/google/gwt/bikeshed/list/client/SimpleCellList.java
@@ -144,9 +144,6 @@ public void setDelegate(Delegate<T> delegate) { this.delegate = delegate; - if (delegate != null) { - delegate.onRangeChanged(this); - } } public void setValueUpdater(ValueUpdater<T, Void> valueUpdater) {
diff --git a/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListViewAdapter.java b/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListViewAdapter.java index d1e5cf6..4cbe210 100644 --- a/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListViewAdapter.java +++ b/bikeshed/src/com/google/gwt/bikeshed/list/shared/AbstractListViewAdapter.java
@@ -71,12 +71,19 @@ */ private ProvidesKey<T> keyProvider; + /** + * Adds a view to this adapter. The current range of interest of the view + * will be populated with data. + * + * @param view a {@Link ListView}. + */ public void addView(ListView<T> view) { if (views.contains(view)) { throw new IllegalStateException("ListView already added"); } views.add(view); view.setDelegate(delegate); + delegate.onRangeChanged(view); } /**
diff --git a/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeNodeView.java b/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeNodeView.java index 344bf9d..dc77540 100644 --- a/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeNodeView.java +++ b/bikeshed/src/com/google/gwt/bikeshed/tree/client/TreeNodeView.java
@@ -475,9 +475,6 @@ public void setDelegate(ListView.Delegate<C> delegate) { // Range never actually changes so no need to store the delegate - if (delegate != null) { - delegate.onRangeChanged(this); - } } }; nodeInfo.setView(view);