Minor update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@102198 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-01-07 17:20:41 +00:00 committed by Giancarlo Panichi
parent a212ad3b69
commit cd696cde7a
2 changed files with 29 additions and 33 deletions

View File

@ -1,13 +1,6 @@
package org.gcube.portlets.user.tdwx.client.config; package org.gcube.portlets.user.tdwx.client.config;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.EventTarget;
import com.google.gwt.user.client.Event;
import com.sencha.gxt.core.client.GXTLogConfiguration;
import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.messages.client.DefaultMessages;
import com.sencha.gxt.widget.core.client.event.LiveGridViewUpdateEvent;
import com.sencha.gxt.widget.core.client.grid.LiveGridView; import com.sencha.gxt.widget.core.client.grid.LiveGridView;
/** /**
@ -19,17 +12,17 @@ import com.sencha.gxt.widget.core.client.grid.LiveGridView;
*/ */
public class ExtendedLiveGridView<M> extends LiveGridView<M> { public class ExtendedLiveGridView<M> extends LiveGridView<M> {
private boolean isLoading; //private boolean isLoading;
private boolean isMasked; //private boolean isMasked;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private int viewIndexReload = -1; private int viewIndexReload = -1;
private int lastViewIndex = -1; //private int lastViewIndex = -1;
private int lastScrollDirection = 0; //private int lastScrollDirection = 0;
private int rowHeightAdjust; //private int rowHeightAdjust;
private boolean measureRowHeight = true; //private boolean measureRowHeight = true;
private boolean ignoreScroll; //private boolean ignoreScroll;
// private boolean adjustScrollHeight; // private boolean adjustScrollHeight;
@ -60,7 +53,8 @@ public class ExtendedLiveGridView<M> extends LiveGridView<M> {
* height. * height.
* *
* @return the visible row count * @return the visible row count
*/
@Override @Override
public int getVisibleRowCount() { public int getVisibleRowCount() {
int rh = getRowHeight(); int rh = getRowHeight();
@ -75,11 +69,6 @@ public class ExtendedLiveGridView<M> extends LiveGridView<M> {
calcHeight = rh * result; calcHeight = rh * result;
} }
/*
* Log.debug("GetVisibleRowCount(): row height: " + rh +
* " visibleHeight: " + visibleHeight + " visible rows: " + result +
* " calcHeight: " + calcHeight);
*/
return result; return result;
} }
@ -102,11 +91,19 @@ public class ExtendedLiveGridView<M> extends LiveGridView<M> {
} else if (type == Event.ONSCROLL && liveScroller.isOrHasChild(target)) { } else if (type == Event.ONSCROLL && liveScroller.isOrHasChild(target)) {
ge.stopPropagation(); ge.stopPropagation();
ge.preventDefault(); ge.preventDefault();
Log.debug("HandleComponentEvent: scrollTop:"+liveScroller.getScrollTop()+", rowHeight:"+getRowHeight()+", newIndex:"+(int) Math.ceil((double) liveScroller.getScrollTop()
/ getRowHeight())); int newIndex = (int) Math.ceil((double) liveScroller.getScrollTop()
updateRows( / getRowHeight());
(int) Math.ceil((double) liveScroller.getScrollTop()
/ getRowHeight()), false);
Log.debug("HandleComponentEvent: totalCount:" + totalCount
+ ", scrollHeight:" + liveScroller.getScrollHeight()
+ ", scrollTop:" + liveScroller.getScrollTop()
+ ", rowHeight:" + getRowHeight() + ", newIndex:"
+ newIndex);
updateRows(newIndex, false);
} }
} }
@ -117,14 +114,13 @@ public class ExtendedLiveGridView<M> extends LiveGridView<M> {
} }
} }
/**
* Updates the rows based on the new index. * Updates the rows based on the new index.
* *
* @param newIndex * @param newIndex
* the new index * the new index
* @param reload * @param reload
* true to reload the data * true to reload the data
*/
@Override @Override
protected void updateRows(int newIndex, boolean reload) { protected void updateRows(int newIndex, boolean reload) {
Log.debug("updateRows(): newIndex: " + newIndex + " reload:" + reload); Log.debug("updateRows(): newIndex: " + newIndex + " reload:" + reload);
@ -238,5 +234,5 @@ public class ExtendedLiveGridView<M> extends LiveGridView<M> {
totalCount, getVisibleRowCount())); totalCount, getVisibleRowCount()));
lastViewIndex = viewIndex; lastViewIndex = viewIndex;
} }
*/
} }

View File

@ -231,18 +231,18 @@ public class GridAndCellSelectionModel<M> extends GridSelectionModel<M> {
@Override @Override
public void refresh() { public void refresh() {
Log.debug("Selection Model Called Refresh()"); //Log.debug("Selection Model Called Refresh()");
} }
@Override @Override
protected void onClear(StoreClearEvent<M> event) { protected void onClear(StoreClearEvent<M> event) {
Log.debug("Selection Model Called OnClear()"); //Log.debug("Selection Model Called OnClear()");
} }
@Override @Override
protected void onRemove(M model) { protected void onRemove(M model) {
Log.debug("Selection Model Called OnRemove(): "); //Log.debug("Selection Model Called OnRemove(): ");
} }
@Override @Override