]> source.dussan.org Git - vaadin-framework.git/commitdiff
debug console now does not send invalid variable changes
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 14 Mar 2008 10:11:25 +0000 (10:11 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 14 Mar 2008 10:11:25 +0000 (10:11 +0000)
svn changeset:4048/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/DebugConsole.java

index 34a0452a677db2f7f2c526d8b071cccc71a365d2..8d7d3e49dd2ede273eb0b9a46444d0cf711bb370 100755 (executable)
@@ -4,6 +4,8 @@
 
 package com.itmill.toolkit.terminal.gwt.client;
 
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.FlowPanel;
@@ -11,6 +13,7 @@ import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.Panel;
 import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.Widget;
 import com.itmill.toolkit.terminal.gwt.client.ui.IWindow;
 
 public final class DebugConsole extends IWindow implements Console {
@@ -80,4 +83,32 @@ public final class DebugConsole extends IWindow implements Console {
         super.setSize(event, false);
     }
 
+    public void onScroll(Widget widget, int scrollLeft, int scrollTop) {
+
+    }
+
+    public void setPopupPosition(int left, int top) {
+        // Keep the popup within the browser's client area, so that they can't
+        // get
+        // 'lost' and become impossible to interact with. Note that we don't
+        // attempt
+        // to keep popups pegged to the bottom and right edges, as they will
+        // then
+        // cause scrollbars to appear, so the user can't lose them.
+        if (left < 0) {
+            left = 0;
+        }
+        if (top < 0) {
+            top = 0;
+        }
+
+        // Set the popup's position manually, allowing setPopupPosition() to be
+        // called before show() is called (so a popup can be positioned without
+        // it
+        // 'jumping' on the screen).
+        Element elem = getElement();
+        DOM.setStyleAttribute(elem, "left", left + "px");
+        DOM.setStyleAttribute(elem, "top", top + "px");
+    }
+
 }