diff options
4 files changed, 45 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index d27357c3c4..82cf925ec1 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -31,6 +31,9 @@ public class BrowserInfo { private static final String OS_ANDROID = "android"; private static final String OS_IOS = "ios"; + // Common CSS class for all touch devices + private static final String UI_TOUCH = "touch"; + private static BrowserInfo instance; private static String cssClass = null; @@ -169,7 +172,9 @@ public class BrowserInfo { if (osClass != null) { cssClass = cssClass + " " + prefix + osClass; } - + if (isTouchDevice()) { + cssClass = cssClass + " " + prefix + UI_TOUCH; + } } return cssClass; diff --git a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java index d29eda0d6a..70ec5e088a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java @@ -100,6 +100,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * contains an image tag with the rows icon (if an icon has been * specified) and the caption of the item */ + @Override public String getDisplayString() { final StringBuffer sb = new StringBuffer(); if (iconUri != null) { @@ -122,6 +123,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get a string that represents this item. This is used in the text box. */ + @Override public String getReplacementString() { return caption; } @@ -147,6 +149,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Executes a selection of this item. */ + @Override public void execute() { onSuggestionSelected(this); } @@ -449,6 +452,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * com.google.gwt.user.client.ui.PopupPanel$PositionCallback#setPosition * (int, int) */ + @Override public void setPosition(int offsetWidth, int offsetHeight) { int top = -1; @@ -585,6 +589,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor( 100, new ScheduledCommand() { + @Override public void execute() { if (suggestionPopup.isVisible() && suggestionPopup.isAttached()) { @@ -742,6 +747,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, private static final String SUBPART_PREFIX = "item"; + @Override public Element getSubPartElement(String subPart) { int index = Integer.parseInt(subPart.substring(SUBPART_PREFIX .length())); @@ -751,6 +757,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return item.getElement(); } + @Override public String getSubPartName(Element subElement) { if (!getElement().isOrHasChild(subElement)) { return null; @@ -773,6 +780,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return null; } + @Override public void onLoad(LoadEvent event) { // Handle icon onload events to ensure shadow is resized // correctly @@ -951,6 +959,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, public VFilterSelect() { selectedItemIcon.setStyleName("v-icon"); selectedItemIcon.addLoadHandler(new LoadHandler() { + @Override public void onLoad(LoadEvent event) { if (BrowserInfo.get().isIE8()) { // IE8 needs some help to discover it should reposition the @@ -1203,6 +1212,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { if (enabled && !readonly) { int keyCode = event.getNativeKeyCode(); @@ -1364,6 +1374,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * @param event * The KeyUpEvent of the key depressed */ + @Override public void onKeyUp(KeyUpEvent event) { if (enabled && !readonly) { switch (event.getNativeKeyCode()) { @@ -1411,6 +1422,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Listener for popupopener */ + @Override public void onClick(ClickEvent event) { if (textInputEnabled && event.getNativeEvent().getEventTarget().cast() == tb @@ -1474,6 +1486,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { /* @@ -1511,6 +1524,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * .dom.client.BlurEvent) */ + @Override public void onBlur(BlurEvent event) { if (BrowserInfo.get().isIE() && preventNextBlurEventInIE) { @@ -1567,6 +1581,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * * @see com.vaadin.terminal.gwt.client.Focusable#focus() */ + @Override public void focus() { focused = true; if (prompting && !readonly) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java index a0089f89b4..09ed5c9859 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java @@ -149,7 +149,14 @@ public class VRoot extends SimplePanel implements ResizeHandler, // should not be in the document focus flow getElement().setTabIndex(-1); TouchScrollDelegate.enableTouchScrolling(this, getElement()); + } + /** + * Start to periodically monitor for parent element resizes if embedded + * application (e.g. portlet). + */ + protected void onLoad() { + super.onLoad(); if (isMonitoringParentSize()) { resizeTimer = new Timer() { @Override @@ -180,6 +187,18 @@ public class VRoot extends SimplePanel implements ResizeHandler, } /** + * Stop monitoring for parent element resizes. + */ + @Override + protected void onUnload() { + if (resizeTimer != null) { + resizeTimer.cancel(); + resizeTimer = null; + } + super.onUnload(); + } + + /** * Called when the window or parent div might have been resized. * * This immediately checks the sizes of the window and the parent div (if diff --git a/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.html b/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.html index e13aa5a3e5..65487d8fa8 100644 --- a/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.html +++ b/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.html @@ -22,6 +22,11 @@ <td>10,10</td> </tr> <tr> + <td>pause</td> + <td>1000</td> + <td></td> +</tr> +<tr> <td>assertText</td> <td>vaadin=runRowUpdateShouldRetainContextMenu::Root/VContextMenu[0]#option0</td> <td>Action 1</td> |