summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/terminal')
-rw-r--r--src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml7
-rw-r--r--src/com/vaadin/terminal/gwt/client/BrowserInfo.java12
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java1
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java28
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java5
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java12
8 files changed, 53 insertions, 22 deletions
diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
index 9bc05dee2e..3d66bab0a3 100644
--- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
+++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
@@ -50,6 +50,13 @@
</any>
</replace-with>
+ <!-- Fall through to this rule for everything but IE -->
+ <replace-with
+ class="com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper">
+ <when-type-is
+ class="com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper" />
+ </replace-with>
+
<replace-with
class="com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapperIE">
<when-type-is
diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
index e5006f4a9c..330e4cf5de 100644
--- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
+++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
@@ -64,13 +64,23 @@ public class BrowserInfo {
browserDetails.setIEMode(documentMode);
}
}
- touchDevice = detectTouchDevice();
+
+ if (browserDetails.isChrome()) {
+ touchDevice = detectChromeTouchDevice();
+ } else {
+ touchDevice = detectTouchDevice();
+ }
}
private native boolean detectTouchDevice()
/*-{
try { document.createEvent("TouchEvent");return true;} catch(e){return false;};
}-*/;
+
+ private native boolean detectChromeTouchDevice()
+ /*-{
+ return ("ontouchstart" in window);
+ }-*/;
private native int getIEDocumentMode()
/*-{
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index 3f587358d9..a3604b6b63 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -1087,7 +1087,6 @@ public class Util {
* button, false otherwise
*/
public static boolean isTouchEventOrLeftMouseButton(Event event) {
- int eventType = event.getTypeInt();
boolean touchEvent = Util.isTouchEvent(event);
return touchEvent || event.getButton() == Event.BUTTON_LEFT;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java
index 320520cb39..c439163595 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java
@@ -71,7 +71,10 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements
public void onBrowserEvent(Event event) {
if (icon != null && (event.getTypeInt() == Event.ONCLICK)
&& (DOM.eventGetTarget(event) == icon.getElement())) {
- setValue(!getValue());
+ // Click on icon should do nothing if widget is disabled
+ if (isEnabled()) {
+ setValue(!getValue());
+ }
}
super.onBrowserEvent(event);
if (event.getTypeInt() == Event.ONLOAD) {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java
index b54c3dd943..0083cc83c2 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java
@@ -1616,14 +1616,6 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
*/
int tbWidth = Util.getRequiredWidth(tb);
- if (popupWidth < 0) {
- /*
- * Only use the first page popup width so the textbox will not
- * get resized whenever the popup is resized.
- */
- popupWidth = Util.getRequiredWidth(popupOpener);
- }
-
/*
* Note: iconWidth is here calculated as a negative pixel value so
* you should consider this in further calculations.
@@ -1632,7 +1624,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
.measureMarginLeft(tb.getElement())
- Util.measureMarginLeft(selectedItemIcon.getElement()) : 0;
- int w = tbWidth + popupWidth + iconWidth;
+ int w = tbWidth + getPopUpOpenerWidth() + iconWidth;
/*
* When the select has a undefined with we need to check that we are
@@ -1669,6 +1661,20 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
}
/**
+ * Only use the first page popup width so the textbox will not get resized
+ * whenever the popup is resized. This also resolves issue where toggling
+ * combo box between read only and normal state makes it grow larger.
+ *
+ * @return Width of popup opener
+ */
+ private int getPopUpOpenerWidth() {
+ if (popupWidth < 0) {
+ popupWidth = Util.getRequiredWidth(popupOpener);
+ }
+ return popupWidth;
+ }
+
+ /**
* Get the width of the select in pixels where the text area and icon has
* been included.
*
@@ -1686,10 +1692,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
*/
private void setTextboxWidth(int componentWidth) {
int padding = getTextboxPadding();
- int popupOpenerWidth = Util.getRequiredWidth(popupOpener);
int iconWidth = selectedItemIcon.isAttached() ? Util
.getRequiredWidth(selectedItemIcon) : 0;
- int textboxWidth = componentWidth - padding - popupOpenerWidth
+
+ int textboxWidth = componentWidth - padding - getPopUpOpenerWidth()
- iconWidth;
if (textboxWidth < 0) {
textboxWidth = 0;
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index c15aade66e..07d9de5f20 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -272,9 +272,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
int endOfFirstRange = row.getIndex() - 1;
if (!(endOfFirstRange - startRow.getIndex() < 0)) {
// create range of first part unless its length is < 1
- VScrollTableRow endOfRange = scrollBody
- .getRowByRowIndex(endOfFirstRange);
- ranges.add(new SelectionRange(startRow, endOfRange));
+ ranges.add(new SelectionRange(startRow, endOfFirstRange
+ - startRow.getIndex() + 1));
}
int startOfSecondRange = row.getIndex() + 1;
if (!(getEndIndex() - startOfSecondRange < 0)) {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
index 61fd389200..85b6e1b2e8 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
@@ -314,13 +314,16 @@ public class VTabsheet extends VTabsheetBase {
}
public Tab addTab() {
+ // Must check this before insert as insert updates the tab count
+ boolean firstTab = (getTabCount() == 0);
+
Tab t = new Tab(this);
// Logical attach
int spacerIndex = getTabCount();
insert(t, tr, spacerIndex, true);
- if (getTabCount() == 0) {
+ if (firstTab) {
// Set the "first" style
t.setStyleNames(false, true);
}
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 86f2c7a2de..705bf13346 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -1234,12 +1234,16 @@ public abstract class AbstractCommunicationManager implements
try {
changeVariables(source, owner, m);
} catch (Exception e) {
+ Component errorComponent = null;
if (owner instanceof Component) {
- handleChangeVariablesError(app, (Component) owner, e, m);
- } else {
- // TODO DragDropService error handling
- throw new RuntimeException(e);
+ errorComponent = (Component) owner;
+ } else if (owner instanceof DragAndDropService) {
+ if (m.get("dhowner") instanceof Component) {
+ errorComponent = (Component) m.get("dhowner");
+ }
}
+
+ handleChangeVariablesError(app, errorComponent, e, m);
}
} else {