mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
newSelectionModel: RefreshableSelectionModel now have a ListDataProvider
This commit is contained in:
1 parent
bbf553198b
commit
106924dc0d
2 files changed
+20
-8
No files matched your search
+10
-4
@@ -1,5 +1,6 @@
|
||||
package com.sap.sse.gwt.client.celltable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -30,14 +31,17 @@ public class RefreshableMultiSelectionModel<T> extends MultiSelectionModel<T>
|
||||
implements RefreshableSelectionModel<T>, HasData<T> {
|
||||
private final EntityIdentityComparator<T> comp;
|
||||
private boolean dontcheckSelectionState = false;
|
||||
private final ListDataProvider<T> listDataProvider;
|
||||
|
||||
/**
|
||||
* @param comp
|
||||
* {@link EntityIdentityComparator} to compare the identity of the objects
|
||||
*/
|
||||
public RefreshableMultiSelectionModel(EntityIdentityComparator<T> comp) {
|
||||
public RefreshableMultiSelectionModel(EntityIdentityComparator<T> comp, ListDataProvider<T> listDataProvider) {
|
||||
super();
|
||||
this.comp = comp;
|
||||
this.listDataProvider = listDataProvider;
|
||||
this.listDataProvider.addDataDisplay(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,9 +50,11 @@ public class RefreshableMultiSelectionModel<T> extends MultiSelectionModel<T>
|
||||
* @param comp
|
||||
* {@link EntityIdentityComparator} to compare the identity of the objects
|
||||
*/
|
||||
public RefreshableMultiSelectionModel(ProvidesKey<T> keyProvider, EntityIdentityComparator<T> comp) {
|
||||
public RefreshableMultiSelectionModel(ProvidesKey<T> keyProvider, EntityIdentityComparator<T> comp, ListDataProvider<T> listDataProvider) {
|
||||
super(keyProvider);
|
||||
this.comp = comp;
|
||||
this.listDataProvider = listDataProvider;
|
||||
this.listDataProvider.addDataDisplay(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,8 +121,8 @@ public class RefreshableMultiSelectionModel<T> extends MultiSelectionModel<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRowData(int start, List<? extends T> values) {
|
||||
//TODO /FIME refresh selectionModel with all data of ListDataProvider
|
||||
public void setRowData(int start, List<? extends T> values) {
|
||||
refreshSelectionModel(new ArrayList<>(listDataProvider.getList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-4
@@ -1,8 +1,10 @@
|
||||
package com.sap.sse.gwt.client.celltable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.google.gwt.event.shared.HandlerRegistration;
|
||||
import com.google.gwt.view.client.HasData;
|
||||
import com.google.gwt.view.client.ListDataProvider;
|
||||
import com.google.gwt.view.client.ProvidesKey;
|
||||
import com.google.gwt.view.client.Range;
|
||||
import com.google.gwt.view.client.SelectionChangeEvent;
|
||||
@@ -19,14 +21,17 @@ import com.google.gwt.view.client.RangeChangeEvent.Handler;
|
||||
public class RefreshableSingleSelectionModel<T> extends SingleSelectionModel<T> implements RefreshableSelectionModel<T>, HasData<T> {
|
||||
private final EntityIdentityComparator<T> comp;
|
||||
private boolean dontcheckSelectionState = false;
|
||||
private final ListDataProvider<T> listDataProvider;
|
||||
|
||||
/**
|
||||
* @param comp
|
||||
* {@link EntityIdentityComparator} to compare the identity of the objects
|
||||
*/
|
||||
public RefreshableSingleSelectionModel(EntityIdentityComparator<T> comp) {
|
||||
public RefreshableSingleSelectionModel(EntityIdentityComparator<T> comp, ListDataProvider<T> listDataProvider) {
|
||||
super();
|
||||
this.comp=comp;
|
||||
this.listDataProvider = listDataProvider;
|
||||
this.listDataProvider.addDataDisplay(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,9 +40,11 @@ public class RefreshableSingleSelectionModel<T> extends SingleSelectionModel<T>
|
||||
* @param comp
|
||||
* {@link EntityIdentityComparator} to compare the identity of the objects
|
||||
*/
|
||||
public RefreshableSingleSelectionModel(ProvidesKey<T> keyProvider, EntityIdentityComparator<T> comp) {
|
||||
public RefreshableSingleSelectionModel(ProvidesKey<T> keyProvider, EntityIdentityComparator<T> comp, ListDataProvider<T> listDataProvider) {
|
||||
super(keyProvider);
|
||||
this.comp =comp;
|
||||
this.listDataProvider = listDataProvider;
|
||||
this.listDataProvider.addDataDisplay(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,8 +86,7 @@ public class RefreshableSingleSelectionModel<T> extends SingleSelectionModel<T>
|
||||
|
||||
@Override
|
||||
public void setRowData(int start, List<? extends T> values) {
|
||||
//TODO / FIXME update with all elements of ListDataProvider
|
||||
|
||||
refreshSelectionModel(new ArrayList<>(listDataProvider.getList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user