summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-07-26 09:57:12 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-07-26 09:57:12 +0000
commitca9fab0922d9db510c51f2d363b46577f7f6c0c4 (patch)
treee170796830327b56bc236076211b99c820c626a5
parent07ec6a6db41fb5059b1c2ad556de8b7b59f08b10 (diff)
downloadvaadin-framework-ca9fab0922d9db510c51f2d363b46577f7f6c0c4.tar.gz
vaadin-framework-ca9fab0922d9db510c51f2d363b46577f7f6c0c4.zip
A better patch and test for #7036
svn changeset:24027/svn branch:6.8
-rw-r--r--WebContent/VAADIN/themes/base/textfield/richtext.css4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.html27
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java57
4 files changed, 89 insertions, 1 deletions
diff --git a/WebContent/VAADIN/themes/base/textfield/richtext.css b/WebContent/VAADIN/themes/base/textfield/richtext.css
index a304fa2a57..6a236886cc 100644
--- a/WebContent/VAADIN/themes/base/textfield/richtext.css
+++ b/WebContent/VAADIN/themes/base/textfield/richtext.css
@@ -6,7 +6,9 @@
background: #fff;
border: none;
}
-
+.v-richtextarea .gwt-HTML {
+ height: 100%;
+}
.v-richtextarea .gwt-RichTextToolbar {
white-space: nowrap;
background: #959595 url(img/richtext-toolbar-bg.png) repeat-x 0 -42px;
diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
index bf0a423474..08df928194 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
@@ -34,6 +34,7 @@ import com.vaadin.terminal.gwt.client.ui.Field;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
+import com.vaadin.terminal.gwt.client.ui.TouchScrollDelegate;
/**
* This class implements a basic client side rich text editor component.
@@ -89,6 +90,7 @@ public class VRichTextArea extends Composite implements Paintable, Field,
initWidget(fp);
setStyleName(CLASSNAME);
+ TouchScrollDelegate.enableTouchScrolling(html, html.getElement());
}
private void createRTAComponents() {
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.html b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.html
new file mode 100644
index 0000000000..be1c5a2cde
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>RichTextAreaScrolling</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">RichTextAreaScrolling</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.richtextarea.RichTextAreaScrolling?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java
new file mode 100644
index 0000000000..f88ed0c67c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaScrolling.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.components.richtextarea;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.VerticalLayout;
+
+public class RichTextAreaScrolling extends TestBase {
+
+ @Override
+ protected String getDescription() {
+ return "A read-only RichTextArea should be (touch) scrollable";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 7036;
+ }
+
+ @Override
+ protected void setup() {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < 50; ++i) {
+ sb.append("A long string with several lines<br/>");
+ }
+
+ HorizontalLayout main = new HorizontalLayout();
+ main.setSpacing(true);
+ addComponent(main);
+
+ RichTextArea first = new RichTextArea("Defined height");
+ RichTextArea second = new RichTextArea("Full height");
+ RichTextArea third = new RichTextArea("Undefined height");
+
+ first.setValue(sb);
+ second.setValue(sb);
+ third.setValue(sb);
+
+ first.setReadOnly(true);
+ second.setReadOnly(true);
+ third.setReadOnly(true);
+
+ first.setWidth("200px");
+ first.setHeight("400px");
+ second.setSizeFull();
+ third.setSizeUndefined();
+
+ VerticalLayout secondLayout = new VerticalLayout();
+ secondLayout.setWidth("200px");
+ secondLayout.setHeight("200px");
+ secondLayout.addComponent(second);
+
+ main.addComponent(first);
+ main.addComponent(secondLayout);
+ main.addComponent(third);
+ }
+}