From cd696cde7a7b289aa2576064364d96f40b473877 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 7 Jan 2015 17:20:41 +0000 Subject: [PATCH] Minor update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@102198 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/config/ExtendedLiveGridView.java | 56 +++++++++---------- .../config/GridAndCellSelectionModel.java | 6 +- 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/tdwx/client/config/ExtendedLiveGridView.java b/src/main/java/org/gcube/portlets/user/tdwx/client/config/ExtendedLiveGridView.java index a35f19e..1e17fe7 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/client/config/ExtendedLiveGridView.java +++ b/src/main/java/org/gcube/portlets/user/tdwx/client/config/ExtendedLiveGridView.java @@ -1,13 +1,6 @@ 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.messages.client.DefaultMessages; -import com.sencha.gxt.widget.core.client.event.LiveGridViewUpdateEvent; 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 extends LiveGridView { - private boolean isLoading; - private boolean isMasked; + //private boolean isLoading; + //private boolean isMasked; @SuppressWarnings("unused") private int viewIndexReload = -1; - private int lastViewIndex = -1; - private int lastScrollDirection = 0; - private int rowHeightAdjust; - private boolean measureRowHeight = true; - private boolean ignoreScroll; + //private int lastViewIndex = -1; + //private int lastScrollDirection = 0; + //private int rowHeightAdjust; + //private boolean measureRowHeight = true; + //private boolean ignoreScroll; // private boolean adjustScrollHeight; @@ -54,13 +47,14 @@ public class ExtendedLiveGridView extends LiveGridView { public void setCacheStore(ListStore list) { cacheStore = list; } - + /** * Returns the total number of rows that are visible given the current grid * height. * * @return the visible row count - */ + + @Override public int getVisibleRowCount() { int rh = getRowHeight(); @@ -75,12 +69,7 @@ public class ExtendedLiveGridView extends LiveGridView { calcHeight = rh * result; } - /* - * Log.debug("GetVisibleRowCount(): row height: " + rh + - * " visibleHeight: " + visibleHeight + " visible rows: " + result + - * " calcHeight: " + calcHeight); - */ - + return result; } @@ -102,11 +91,19 @@ public class ExtendedLiveGridView extends LiveGridView { } else if (type == Event.ONSCROLL && liveScroller.isOrHasChild(target)) { ge.stopPropagation(); ge.preventDefault(); - Log.debug("HandleComponentEvent: scrollTop:"+liveScroller.getScrollTop()+", rowHeight:"+getRowHeight()+", newIndex:"+(int) Math.ceil((double) liveScroller.getScrollTop() - / getRowHeight())); - updateRows( - (int) Math.ceil((double) liveScroller.getScrollTop() - / getRowHeight()), false); + + int newIndex = (int) Math.ceil((double) liveScroller.getScrollTop() + / getRowHeight()); + + + 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 extends LiveGridView { } } - /** * Updates the rows based on the new index. * * @param newIndex * the new index * @param reload * true to reload the data - */ + @Override protected void updateRows(int newIndex, boolean reload) { Log.debug("updateRows(): newIndex: " + newIndex + " reload:" + reload); @@ -238,5 +234,5 @@ public class ExtendedLiveGridView extends LiveGridView { totalCount, getVisibleRowCount())); lastViewIndex = viewIndex; } - + */ } \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/tdwx/client/config/GridAndCellSelectionModel.java b/src/main/java/org/gcube/portlets/user/tdwx/client/config/GridAndCellSelectionModel.java index bd9b140..5466b55 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/client/config/GridAndCellSelectionModel.java +++ b/src/main/java/org/gcube/portlets/user/tdwx/client/config/GridAndCellSelectionModel.java @@ -231,18 +231,18 @@ public class GridAndCellSelectionModel extends GridSelectionModel { @Override public void refresh() { - Log.debug("Selection Model Called Refresh()"); + //Log.debug("Selection Model Called Refresh()"); } @Override protected void onClear(StoreClearEvent event) { - Log.debug("Selection Model Called OnClear()"); + //Log.debug("Selection Model Called OnClear()"); } @Override protected void onRemove(M model) { - Log.debug("Selection Model Called OnRemove(): "); + //Log.debug("Selection Model Called OnRemove(): "); } @Override