diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-04-18 14:09:56 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-04-18 14:09:56 +0300 |
commit | 290f6b3a2b6b3eeadf3c9904fbaae0fa2f016595 (patch) | |
tree | e219c7615fa7aa14d89f274896a4eafb1f283cbb /src | |
parent | cf06923748ce75dc8113e66a40bb69297def7072 (diff) | |
parent | c3e10ebbbc48d124a88d6e92e16faccdebe43223 (diff) | |
download | vaadin-framework-290f6b3a2b6b3eeadf3c9904fbaae0fa2f016595.tar.gz vaadin-framework-290f6b3a2b6b3eeadf3c9904fbaae0fa2f016595.zip |
Merge remote branch 'origin/6.8'
Conflicts:
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
tests/server-side/com/vaadin/tests/server/component/tabsheet/TestTabSheet.java
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ApplicationConnection.java | 5 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java | 57 | ||||
-rw-r--r-- | src/com/vaadin/ui/TabSheet.java | 28 | ||||
-rw-r--r-- | src/com/vaadin/ui/Table.java | 11 |
4 files changed, 64 insertions, 37 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 5f5ef71c36..2d9398320e 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -766,8 +766,7 @@ public class ApplicationConnection { protected void startRequest() { if (hasActiveRequest) { - throw new IllegalStateException( - "Trying to start a new request while another is active"); + VConsole.error("Trying to start a new request while another is active"); } hasActiveRequest = true; requestStartTime = new Date(); @@ -794,7 +793,7 @@ public class ApplicationConnection { protected void endRequest() { if (!hasActiveRequest) { - throw new IllegalStateException("No active request"); + VConsole.error("No active request"); } // After checkForPendingVariableBursts() there may be a new active // request, so we must set hasActiveRequest to false before, not after, diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index cf6209e312..563ca04abe 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -1846,9 +1846,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets, isNewBody = false; if (firstvisible > 0) { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisible)); - firstRowInViewPort = firstvisible; + // FIXME #7607 + // Originally deferred due to Firefox oddities which should not + // occur any more. Currently deferring breaks Webkit scrolling with + // relative-height tables, but not deferring instead breaks tables + // with explicit page length. + Scheduler.get().scheduleDeferred(new Command() { + public void execute() { + scrollBodyPanel + .setScrollPosition(measureRowHeightOffset(firstvisible)); + firstRowInViewPort = firstvisible; + } + }); } if (enabled) { @@ -4968,21 +4977,33 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public void run() { TouchScrollDelegate activeScrollDelegate = TouchScrollDelegate .getActiveScrollDelegate(); - if (activeScrollDelegate != null - && !activeScrollDelegate.isMoved()) { - /* - * scrolling hasn't started. Cancel - * scrolling and let row handle this as - * drag start or context menu. - */ - activeScrollDelegate.stopScrolling(); - } else { - /* - * Scrolled or scrolling, clear touch - * start to indicate that row shouldn't - * handle touch move/end events. - */ - touchStart = null; + /* + * If there's a scroll delegate, check if + * we're actually scrolling and handle it. + * If no delegate, do nothing here and let + * the row handle potential drag'n'drop or + * context menu. + */ + if (activeScrollDelegate != null) { + if (activeScrollDelegate.isMoved()) { + /* + * Prevent the row from handling + * touch move/end events (the + * delegate handles those) and from + * doing drag'n'drop or opening a + * context menu. + */ + touchStart = null; + } else { + /* + * Scrolling hasn't started, so + * cancel delegate and let the row + * handle potential drag'n'drop or + * context menu. + */ + activeScrollDelegate + .stopScrolling(); + } } } }.schedule(TOUCHSCROLL_TIMEOUT); diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index 64e069dcfe..23dee15359 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -538,7 +538,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * * @param c * the component - * @return + * @return The tab instance associated with the given component, or null if + * the tabsheet does not contain the component. */ public Tab getTab(Component c) { return tabs.get(c); @@ -550,14 +551,15 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * * @param position * the position of the tab - * @return + * @return The tab in the given position, or null if the position is out of + * bounds. */ public Tab getTab(int position) { - Component c = components.get(position); - if (c != null) { - return tabs.get(c); + if (position >= 0 && position < getComponentCount()) { + return getTab(components.get(position)); + } else { + return null; } - return null; } /** @@ -608,17 +610,19 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @param tab */ public void setSelectedTab(Tab tab) { - setSelectedTab(tab.getComponent()); + if (tab != null) { + setSelectedTab(tab.getComponent()); + } } /** - * Sets the selected tab, identified by its position. Does nothing if - * <code>index < 0 || index > {@link #getComponentCount()}</code>. + * Sets the selected tab, identified by its position. Does nothing if the + * position is out of bounds. * - * @param index + * @param position */ - public void setSelectedTab(int index) { - setSelectedTab(getTab(index)); + public void setSelectedTab(int position) { + setSelectedTab(getTab(position)); } /** diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 0658c4e6a5..2fffedd9d6 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1370,11 +1370,14 @@ public class Table extends AbstractSelect implements Action.Container, maxIndex = 0; } - // Assume that we want to scroll to the very bottom (so that the bottom - // row is completely visible even if (table height) / (row height) is - // not an integer.) + /* + * FIXME #7607 Take somehow into account the case where we want to + * scroll to the bottom so that the last row is completely visible even + * if (table height) / (row height) is not an integer. Reverted the + * original fix because of #8662 regression. + */ if (newIndex > maxIndex) { - newIndex = maxIndex + 1; + newIndex = maxIndex; } // Refresh first item id |