Minor update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@102178 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
04a227ad6c
commit
a212ad3b69
|
@ -834,6 +834,7 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
// TODO we need to manually reset the sort
|
||||
sm.onChangeNumberOfRows();
|
||||
tdxLiveToolItem.setNoSelected();
|
||||
|
||||
loader.clearSortInfo();
|
||||
reader.setDefinition(tableDefinition);
|
||||
grid.reconfigure(store, columnModel);
|
||||
|
|
|
@ -29,8 +29,8 @@ public class GridAndCellSelectionModel<M> extends GridSelectionModel<M> {
|
|||
private CellSelection<M> cellSelected;
|
||||
private boolean focusCellCalled;
|
||||
private int indexOnSelectNoShift;
|
||||
//private List<M> totalSelected = new ArrayList<M>();
|
||||
|
||||
|
||||
// private List<M> totalSelected = new ArrayList<M>();
|
||||
|
||||
public GridAndCellSelectionModel() {
|
||||
super();
|
||||
|
@ -234,65 +234,68 @@ public class GridAndCellSelectionModel<M> extends GridSelectionModel<M> {
|
|||
Log.debug("Selection Model Called Refresh()");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onClear(StoreClearEvent<M> event) {
|
||||
Log.debug("Selection Model Called OnClear()");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRemove(M model) {
|
||||
protected void onRemove(M model) {
|
||||
Log.debug("Selection Model Called OnRemove(): ");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAdd(List<? extends M> models) {
|
||||
super.onAdd(models);
|
||||
|
||||
|
||||
ModelKeyProvider<? super M> mod = grid.getStore().getKeyProvider();
|
||||
for(M item: selected){
|
||||
Log.debug("Selected: "+mod.getKey(item));
|
||||
for (M item : selected) {
|
||||
Log.debug("Selected: " + mod.getKey(item));
|
||||
}
|
||||
|
||||
|
||||
|
||||
ExtendedLiveGridView<M> gridView = (ExtendedLiveGridView<M>) grid
|
||||
.getView();
|
||||
boolean notChanged;
|
||||
for (M model : gridView.getCacheStore().getAll()) {
|
||||
notChanged=true;
|
||||
notChanged = true;
|
||||
for (M item : selected) {
|
||||
if (mod.getKey(model).compareTo(mod.getKey(item)) == 0) {
|
||||
onSelectChange(model, true);
|
||||
notChanged=false;
|
||||
notChanged = false;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if(notChanged){
|
||||
if (notChanged) {
|
||||
onSelectChange(model, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void onChangeNumberOfRows(){
|
||||
public void onChangeNumberOfRows() {
|
||||
Log.debug("Selection Model Called OnChangeNumberOfRows()");
|
||||
if(selected!=null){
|
||||
Log.debug("Rows Selected: "+selected.size());
|
||||
if (selected != null) {
|
||||
Log.debug("Rows Selected: " + selected.size());
|
||||
}
|
||||
|
||||
deselectAll();
|
||||
fireSelectionChange();
|
||||
|
||||
if(selected!=null){
|
||||
Log.debug("After deselect Rows Selected: "+selected.size());
|
||||
} else{
|
||||
|
||||
int oldSize = selected.size();
|
||||
selected.clear();
|
||||
lastSelected = null;
|
||||
setLastFocused(null);
|
||||
if (oldSize > 0)
|
||||
fireSelectionChange();
|
||||
|
||||
//deselectAll();
|
||||
//fireSelectionChange();
|
||||
|
||||
if (selected != null) {
|
||||
Log.debug("After deselect Rows Selected: " + selected.size());
|
||||
} else {
|
||||
Log.debug("After deselect No Rows Selected");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ public class TDXLiveToolItem extends LiveToolItem {
|
|||
|
||||
@Override
|
||||
public String displayNoSelectedMessage() {
|
||||
totalSelected=0;
|
||||
String msg = new String("<span>Displaying " + start
|
||||
+ " - " + end + " of " + total + "</span>");
|
||||
return msg;
|
||||
|
|
Loading…
Reference in New Issue