diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-07-25 11:08:36 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-07-25 11:08:36 +0000 |
commit | 7edff2dad305481601cdd6c876d24fd7a4f3f9a3 (patch) | |
tree | efc10fa2472d17af64f77c4420ef1fbbf9a1d5b9 /src | |
parent | 6a04a73a812000c8d1f5f9a994475c571b88c498 (diff) | |
download | vaadin-framework-7edff2dad305481601cdd6c876d24fd7a4f3f9a3.tar.gz vaadin-framework-7edff2dad305481601cdd6c876d24fd7a4f3f9a3.zip |
Make a read-only RichTextArea scrollable (#7036)
svn changeset:24024/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java | 13 |
1 files changed, 12 insertions, 1 deletions
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..54a8ff6ad6 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,8 @@ 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; +import com.vaadin.terminal.gwt.client.ui.TouchScrollDelegate.TouchScrollHandler; /** * This class implements a basic client side rich text editor component. @@ -81,6 +83,8 @@ public class VRichTextArea extends Composite implements Paintable, Field, private boolean readOnly = false; + private TouchScrollHandler touchScrollHandler = null; + public VRichTextArea() { createRTAComponents(); fp.add(formatter); @@ -88,7 +92,6 @@ public class VRichTextArea extends Composite implements Paintable, Field, initWidget(fp); setStyleName(CLASSNAME); - } private void createRTAComponents() { @@ -120,10 +123,18 @@ public class VRichTextArea extends Composite implements Paintable, Field, } rta.setHTML(currentValue); fp.add(rta); + if (touchScrollHandler != null) { + touchScrollHandler.removeElement(fp.getElement()); + } } else { html.setHTML(currentValue); fp.remove(rta); fp.add(html); + if (touchScrollHandler == null) { + touchScrollHandler = TouchScrollDelegate + .enableTouchScrolling(this); + } + touchScrollHandler.addElement(fp.getElement()); } } |