]> source.dussan.org Git - vaadin-framework.git/commitdiff
#5613 Converted our own client side code to use VConsole instead of ApplicationConnec...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 17 Sep 2010 11:07:59 +0000 (11:07 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 17 Sep 2010 11:07:59 +0000 (11:07 +0000)
svn changeset:14989/svn branch:6.4

20 files changed:
src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java
src/com/vaadin/terminal/gwt/client/DateTimeService.java
src/com/vaadin/terminal/gwt/client/Util.java
src/com/vaadin/terminal/gwt/client/VCaption.java
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java
src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java
src/com/vaadin/terminal/gwt/client/ui/VDateField.java
src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
src/com/vaadin/terminal/gwt/client/ui/VForm.java
src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/terminal/gwt/client/ui/VSlider.java
src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java
src/com/vaadin/terminal/gwt/client/ui/VUpload.java
src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/terminal/gwt/client/ui/VWindow.java
src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java
src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java

index c71ebb78e934ba21dca6e1fe61625d38ad08ae1f..3f54d34e39fc183e76a8e51a43a1c6a36e3ce062 100644 (file)
@@ -379,10 +379,10 @@ public class ApplicationConfiguration implements EntryPoint {
         // display some sort of error of exceptions in web mode to debug console
         GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
             public void onUncaughtException(Throwable e) {
-                Console console = ApplicationConnection.getConsole();
+                Console console = VConsole.getImplementation();
                 if (console != null) {
                     console.error(e.getMessage());
-                }
+                } // else very early phase of init, alert ??
             }
         });
 
index b30ff1f843e9702bd1906ec1c33c2fa65a763355..e1078bf57a32edf966bea41c405ac613393932f1 100644 (file)
@@ -16,13 +16,8 @@ public class ClientExceptionHandler {
 
     @Deprecated
     public static void displayError(String msg) {
-
-        Console console = ApplicationConnection.getConsole();
-
-        if (console != null) {
-            console.error(msg);
-            GWT.log(msg);
-        }
+        VConsole.error(msg);
+        GWT.log(msg);
     }
 
     @Deprecated
index 449dae73db85e8b69b5ec589e61eeb49bb810b38..8c3f9cdfaad77992b46046219dcdfa873c58c871 100644 (file)
@@ -59,7 +59,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getMonthNames(currentLocale)[month];\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return null;\r
         }\r
     }\r
@@ -68,7 +68,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getShortMonthNames(currentLocale)[month];\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return null;\r
         }\r
     }\r
@@ -77,7 +77,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getDayNames(currentLocale)[day];\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return null;\r
         }\r
     }\r
@@ -86,7 +86,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getShortDayNames(currentLocale)[day];\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return null;\r
         }\r
     }\r
@@ -95,7 +95,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getFirstDayOfWeek(currentLocale);\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return 0;\r
         }\r
     }\r
@@ -104,7 +104,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.isTwelveHourClock(currentLocale);\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return false;\r
         }\r
     }\r
@@ -113,7 +113,7 @@ public class DateTimeService {
         try {\r
             return LocaleService.getClockDelimiter(currentLocale);\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error(e);\r
             return ":";\r
         }\r
     }\r
@@ -125,9 +125,8 @@ public class DateTimeService {
             return LocaleService.getAmPmStrings(currentLocale);\r
         } catch (final LocaleNotLoadedException e) {\r
             // TODO can this practically even happen? Should die instead?\r
-            ApplicationConnection.getConsole().error(\r
-                    "Locale not loaded, using fallback : AM/PM");\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error("Locale not loaded, using fallback : AM/PM");\r
+            VConsole.error(e);\r
             return DEFAULT_AMPM_STRINGS;\r
         }\r
     }\r
@@ -139,9 +138,8 @@ public class DateTimeService {
         try {\r
             firstDay = LocaleService.getFirstDayOfWeek(currentLocale);\r
         } catch (final LocaleNotLoadedException e) {\r
-            ApplicationConnection.getConsole().error(\r
-                    "Locale not loaded, using fallback 0");\r
-            ApplicationConnection.getConsole().error(e);\r
+            VConsole.error("Locale not loaded, using fallback 0");\r
+            VConsole.error(e);\r
             firstDay = 0;\r
         }\r
         int start = dateForFirstOfThisMonth.getDay() - firstDay;\r
index e94f9b4bcb8cc19259b8283bb4ee30767901b686..da1d9ce43eb11aa3e002264e29a7224a73746572 100644 (file)
@@ -158,8 +158,7 @@ public class Util {
         try {
             return Float.parseFloat(size.substring(0, size.length() - 1));
         } catch (Exception e) {
-            ApplicationConnection.getConsole().log(
-                    "Unable to parse relative size");
+            VConsole.log("Unable to parse relative size");
             return -1;
         }
     }
index a8a694b9eb7df2f8b62791882f4ddb65e605870e..4309c2c8f5360e249c79974eb3891408a416fc27 100644 (file)
@@ -274,9 +274,7 @@ public class VCaption extends HTML {
             if (owner != null) {
                 Util.notifyParentOfSizeChange(owner, true);
             } else {
-                ApplicationConnection
-                        .getConsole()
-                        .log("Warning: Icon load event was not propagated because VCaption owner is unknown.");
+                VConsole.log("Warning: Icon load event was not propagated because VCaption owner is unknown.");
             }
         }
     }
index 286704a0fed7dc3da1d627d5bd46f871890381df..af856d047c4e7509f6d66d6c1829a6b52ae0e111 100644 (file)
@@ -29,6 +29,7 @@ import com.vaadin.terminal.gwt.client.RenderSpace;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
+import com.vaadin.terminal.gwt.client.VConsole;
 
 public class VAbsoluteLayout extends ComplexPanel implements Container {
 
@@ -377,10 +378,10 @@ public class VAbsoluteLayout extends ComplexPanel implements Container {
             if (bottom != null && top != null) {
                 // define height for wrapper to simulate bottom property
                 int bottompixels = measureForIE6(bottom, true);
-                ApplicationConnection.getConsole().log("ALB" + bottompixels);
+                VConsole.log("ALB" + bottompixels);
                 int height = canvas.getOffsetHeight() - bottompixels
                         - getElement().getOffsetTop();
-                ApplicationConnection.getConsole().log("ALB" + height);
+                VConsole.log("ALB" + height);
                 if (height < 0) {
                     height = 0;
                 }
@@ -392,10 +393,10 @@ public class VAbsoluteLayout extends ComplexPanel implements Container {
             if (left != null && right != null) {
                 // define width for wrapper to simulate right property
                 int rightPixels = measureForIE6(right, false);
-                ApplicationConnection.getConsole().log("ALR" + rightPixels);
+                VConsole.log("ALR" + rightPixels);
                 int width = canvas.getOffsetWidth() - rightPixels
                         - getElement().getOffsetLeft();
-                ApplicationConnection.getConsole().log("ALR" + width);
+                VConsole.log("ALR" + width);
                 if (width < 0) {
                     width = 0;
                 }
index 6ffa66d6cda138d96969ddaee10d7dfb82d3445d..dd4411b60eb703ca200c9016ef1b3db9870fffe6 100644 (file)
@@ -36,9 +36,9 @@ import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.InlineHTML;\r
 import com.google.gwt.user.client.ui.ListBox;\r
 import com.google.gwt.user.client.ui.Widget;\r
-import com.vaadin.terminal.gwt.client.ApplicationConnection;\r
 import com.vaadin.terminal.gwt.client.BrowserInfo;\r
 import com.vaadin.terminal.gwt.client.DateTimeService;\r
+import com.vaadin.terminal.gwt.client.VConsole;\r
 \r
 @SuppressWarnings("deprecation")\r
 public class VCalendarPanel extends FocusableFlexTable implements\r
@@ -274,8 +274,7 @@ public class VCalendarPanel extends FocusableFlexTable implements
 \r
             selectDate(focusedDate.getDate());\r
         } else {\r
-            ApplicationConnection.getConsole().log(\r
-                    "Trying to select a the focused date which is NULL!");\r
+            VConsole.log("Trying to select a the focused date which is NULL!");\r
         }\r
     }\r
 \r
@@ -577,7 +576,6 @@ public class VCalendarPanel extends FocusableFlexTable implements
             focusChangeListener.focusChanged(new Date(focusedDate.getTime()));\r
         }\r
 \r
-        Date start = new Date();\r
         final boolean needsMonth = getResolution() > VDateField.RESOLUTION_YEAR;\r
         boolean needsBody = getResolution() >= VDateField.RESOLUTION_DAY;\r
         buildCalendarHeader(true, needsMonth);\r
@@ -598,11 +596,6 @@ public class VCalendarPanel extends FocusableFlexTable implements
             remove(time);\r
         }\r
 \r
-        Date end = new Date();\r
-        ApplicationConnection.getConsole().error(\r
-                "Rendering calendar panel for(ms) "\r
-                        + (end.getTime() - start.getTime()));\r
-\r
     }\r
 \r
     /**\r
@@ -720,9 +713,6 @@ public class VCalendarPanel extends FocusableFlexTable implements
                         (Node) event.getNativeEvent().getEventTarget().cast())) {\r
             int nativeKeyCode = event.getNativeEvent().getKeyCode();\r
             if (nativeKeyCode == getSelectKey()) {\r
-                ApplicationConnection.getConsole().log(\r
-                        "keydown on listselects"\r
-                                + event.getNativeEvent().getKeyCode());\r
                 onSubmit(); // submit happens if enter key hit down on listboxes\r
                 event.preventDefault();\r
                 event.stopPropagation();\r
index d5d8d3627dcc19a1d6bda678053358fd7dce8e35..4813dbcd2154a2b2302d3c7e15662d9cfff2049e 100644 (file)
@@ -27,6 +27,7 @@ import com.vaadin.terminal.gwt.client.StyleConstants;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
+import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.ValueMap;
 
 public class VCssLayout extends SimplePanel implements Paintable, Container {
@@ -189,9 +190,8 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
                             }
                         }
                     } catch (Exception e) {
-                        ApplicationConnection.getConsole().log(
-                                "CssLayout encounterd invalid css string: "
-                                        + css);
+                        VConsole.log("CssLayout encounterd invalid css string: "
+                                + css);
                     }
                 }
 
index bbd1da5080fe7a9cf665514d441a5a85c35fead7..0537026b731fb801202f21e0640d994d81d91c10 100644 (file)
@@ -13,6 +13,7 @@ import com.vaadin.terminal.gwt.client.DateTimeService;
 import com.vaadin.terminal.gwt.client.LocaleNotLoadedException;\r
 import com.vaadin.terminal.gwt.client.Paintable;\r
 import com.vaadin.terminal.gwt.client.UIDL;\r
+import com.vaadin.terminal.gwt.client.VConsole;\r
 import com.vaadin.terminal.gwt.client.VTooltip;\r
 \r
 public class VDateField extends FlowPanel implements Paintable, Field {\r
@@ -101,11 +102,9 @@ public class VDateField extends FlowPanel implements Paintable, Field {
                 currentLocale = locale;\r
             } catch (final LocaleNotLoadedException e) {\r
                 currentLocale = dts.getLocale();\r
-                ApplicationConnection.getConsole().error(\r
-                        "Tried to use an unloaded locale \"" + locale\r
-                                + "\". Using default locale (" + currentLocale\r
-                                + ").");\r
-                ApplicationConnection.getConsole().error(e);\r
+                VConsole.error("Tried to use an unloaded locale \"" + locale\r
+                        + "\". Using default locale (" + currentLocale + ").");\r
+                VConsole.error(e);\r
             }\r
         }\r
 \r
index 0735f0049f4b7a78ba260cd9507afb1def62ce19..6fe8c60e31258e0241ca9e92c3c9446856b932b0 100644 (file)
@@ -25,6 +25,7 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.VTooltip;
 
 public class VEmbedded extends HTML implements Paintable {
@@ -126,8 +127,7 @@ public class VEmbedded extends HTML implements Paintable {
                 }
                 clearBrowserElement = false;
             } else {
-                ApplicationConnection.getConsole().log(
-                        "Unknown Embedded type '" + type + "'");
+                VConsole.log("Unknown Embedded type '" + type + "'");
             }
         } else if (uidl.hasAttribute("mimetype")) {
             final String mime = uidl.getStringAttribute("mimetype");
@@ -179,12 +179,10 @@ public class VEmbedded extends HTML implements Paintable {
                 getElement().appendChild(obj);
 
             } else {
-                ApplicationConnection.getConsole().log(
-                        "Unknown Embedded mimetype '" + mime + "'");
+                VConsole.log("Unknown Embedded mimetype '" + mime + "'");
             }
         } else {
-            ApplicationConnection.getConsole().log(
-                    "Unknown Embedded; no type or mimetype attribute");
+            VConsole.log("Unknown Embedded; no type or mimetype attribute");
         }
 
         if (clearBrowserElement) {
index 9872dd0c1b55540afc45af8640ed39819ad73614..7d98604d40f9f49c0261c30b2ae7ff30652a5451 100644 (file)
@@ -22,6 +22,7 @@ import com.vaadin.terminal.gwt.client.RenderInformation;
 import com.vaadin.terminal.gwt.client.RenderSpace;\r
 import com.vaadin.terminal.gwt.client.UIDL;\r
 import com.vaadin.terminal.gwt.client.Util;\r
+import com.vaadin.terminal.gwt.client.VConsole;\r
 import com.vaadin.terminal.gwt.client.VErrorMessage;\r
 \r
 public class VForm extends ComplexPanel implements Container, KeyDownHandler {\r
@@ -214,8 +215,7 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler {
             return new RenderSpace(renderInformation.getContentAreaSize()\r
                     .getWidth(), 0);\r
         } else {\r
-            ApplicationConnection.getConsole().error(\r
-                    "Invalid child requested RenderSpace information");\r
+            VConsole.error("Invalid child requested RenderSpace information");\r
             return null;\r
         }\r
     }\r
index 281b5a8df40650103ce09cb22391728c214d4fbb..b0c852375373b56642cea116a96386beecc4a0e2 100644 (file)
@@ -24,6 +24,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.DateTimeService;\r
 import com.vaadin.terminal.gwt.client.Paintable;\r
 import com.vaadin.terminal.gwt.client.UIDL;\r
+import com.vaadin.terminal.gwt.client.VConsole;\r
 import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;\r
 import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusOutListener;\r
 import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.SubmitListener;\r
@@ -63,9 +64,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
         calendar = GWT.create(VCalendarPanel.class);\r
         calendar.setFocusOutListener(new FocusOutListener() {\r
             public boolean onFocusOut(DomEvent event) {\r
-                ApplicationConnection.getConsole().log(\r
-                        "Focus out event, due to "\r
-                                + event.getNativeEvent().getType());\r
                 event.preventDefault();\r
                 closeCalendarPanel();\r
                 return true;\r
@@ -233,7 +231,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
 \r
         if (!open && !readonly) {\r
             open = true;\r
-            final Date start = new Date();\r
 \r
             if (getCurrentDate() != null) {\r
                 calendar.setDate((Date) getCurrentDate().clone());\r
@@ -287,12 +284,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
                     popup.setPopupPosition(l,\r
                             t + calendarToggle.getOffsetHeight() + 2);\r
 \r
-                    Date end = new Date();\r
-\r
-                    ApplicationConnection.getConsole().log(\r
-                            "Rendering VCalendar took "\r
-                                    + (end.getTime() - start.getTime() + "ms"));\r
-\r
                     /*\r
                      * We have to wait a while before focusing since the popup\r
                      * needs to be opened before we can focus\r
@@ -308,8 +299,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
                 }\r
             });\r
         } else {\r
-            ApplicationConnection.getConsole().error(\r
-                    "Cannot reopen popup, it is already open!");\r
+            VConsole.error("Cannot reopen popup, it is already open!");\r
         }\r
     }\r
 \r
index ff7328c004430500b697e1dd779ffbb1f26d13e8..38f5f63738c08029789983fb574c6cf1e732966a 100644 (file)
@@ -59,6 +59,7 @@ import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.RenderSpace;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
 import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
 import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
@@ -422,8 +423,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
                 if (prev != null) {
                     return setRowFocus(prev);
                 } else {
-                    ApplicationConnection.getConsole().log(
-                            "no previous available");
+                    VConsole.log("no previous available");
                 }
             }
         }
@@ -1614,7 +1614,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
         public void run() {
             if (client.hasActiveRequest() || navKeyDown) {
                 // if client connection is busy, don't bother loading it more
-                ApplicationConnection.getConsole().log("Postponed rowfetch");
+                VConsole.log("Postponed rowfetch");
                 schedule(250);
             } else {
 
index 5715e0bb7bb88db167ba729f114727566c363e1a..9b7103d39fa475c79eab91d90f274427b5fa3ee3 100644 (file)
@@ -362,7 +362,6 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
             feedbackPopup.show();\r
         } else if (targ.equals(getElement())\r
                 && DOM.eventGetType(event) == Event.ONBLUR) {\r
-            ApplicationConnection.getConsole().error(targ.getClassName());\r
             feedbackPopup.hide();\r
         } else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {\r
             feedbackPopup.show();\r
index 134678e8648e71abe7a2327e7c1012e501f70855..854d2ce4ac62a4a3256c217f8a87ba1510299b56 100644 (file)
@@ -23,6 +23,7 @@ import com.vaadin.terminal.gwt.client.LocaleNotLoadedException;
 import com.vaadin.terminal.gwt.client.LocaleService;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
 
 public class VTextualDate extends VDateField implements Paintable, Field,
         ChangeHandler, ContainerResizedListener, Focusable {
@@ -161,7 +162,7 @@ public class VTextualDate extends VDateField implements Paintable, Field,
                 } catch (LocaleNotLoadedException e) {
                     // TODO should die instead? Can the component survive
                     // without format string?
-                    ApplicationConnection.getConsole().error(e);
+                    VConsole.error(e);
                 }
             }
         }
@@ -230,7 +231,7 @@ public class VTextualDate extends VDateField implements Paintable, Field,
                 // remove possibly added invalid value indication
                 removeStyleName(PARSE_ERROR_CLASSNAME);
             } catch (final Exception e) {
-                ApplicationConnection.getConsole().log(e);
+                VConsole.log(e);
 
                 addStyleName(PARSE_ERROR_CLASSNAME);
                 // this is a hack that may eventually be removed
index 62d7a454770d004f535d7f7bf83b31b7c5d80675..b175a50619982e441d5014dfa8f3f536a240534c 100644 (file)
@@ -24,6 +24,7 @@ import com.google.gwt.user.client.ui.SimplePanel;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
 
 /**
  * 
@@ -225,7 +226,7 @@ public class VUpload extends SimplePanel implements Paintable {
                     if (t != null) {
                         t.cancel();
                     }
-                    ApplicationConnection.getConsole().log("Submit complete");
+                    VConsole.log("VUpload:Submit complete");
                     client.sendPendingVariableChanges();
                 }
 
@@ -245,9 +246,7 @@ public class VUpload extends SimplePanel implements Paintable {
 
     private void submit() {
         if (fu.getFilename().length() == 0 || submitted || !enabled) {
-            ApplicationConnection
-                    .getConsole()
-                    .log("Submit cancelled (disabled, no file or already submitted)");
+            VConsole.log("Submit cancelled (disabled, no file or already submitted)");
             return;
         }
         // flush possibly pending variable changes, so they will be handled
@@ -256,7 +255,7 @@ public class VUpload extends SimplePanel implements Paintable {
 
         element.submit();
         submitted = true;
-        ApplicationConnection.getConsole().log("Submitted form");
+        VConsole.log("Submitted form");
 
         disableUpload();
 
@@ -267,9 +266,7 @@ public class VUpload extends SimplePanel implements Paintable {
         t = new Timer() {
             @Override
             public void run() {
-                ApplicationConnection
-                        .getConsole()
-                        .log("Visiting server to see if upload started event changed UI.");
+                VConsole.log("Visiting server to see if upload started event changed UI.");
                 client.updateVariable(paintableId, "pollForStart",
                         nextUploadId, true);
             }
index 31e8d6ebd4d69b0e6968cbebce8939121dfcdd9e..a0af7f90d5ae8ea924a7b69dd61adb702f154b50 100644 (file)
@@ -35,6 +35,7 @@ import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.RenderSpace;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
 
 /**
@@ -337,8 +338,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
                     } else if (toBeFocused instanceof Focusable) {
                         ((Focusable) toBeFocused).focus();
                     } else {
-                        ApplicationConnection.getConsole().log(
-                                "Could not focus component");
+                        VConsole.log("Could not focus component");
                     }
                 }
             });
@@ -442,19 +442,15 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
                         if (width != getOffsetWidth()) {
                             width = getOffsetWidth();
                             changed = true;
-                            ApplicationConnection.getConsole().log(
-                                    "window w" + width);
+                            VConsole.log("window w" + width);
                         }
                         if (height != getOffsetHeight()) {
                             height = getOffsetHeight();
                             changed = true;
-                            ApplicationConnection.getConsole().log(
-                                    "window h" + height);
+                            VConsole.log("window h" + height);
                         }
                         if (changed) {
-                            ApplicationConnection
-                                    .getConsole()
-                                    .log("Running layout functions due window resize");
+                            VConsole.log("Running layout functions due window resize");
                             connection.runDescendentsLayout(VView.this);
 
                             sendClientResized();
@@ -475,8 +471,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
             width = Window.getClientWidth();
             height = Window.getClientHeight();
 
-            ApplicationConnection.getConsole().log(
-                    "Running layout functions due window resize");
+            VConsole.log("Running layout functions due window resize");
 
             connection.runDescendentsLayout(this);
             Util.runWebkitOverflowAutoFix(getElement());
index c398db048bcd1b68fa471a9f8af839c043fa8188..ec26626015cb7df0ac2fea7f586594aea6890691 100644 (file)
@@ -25,7 +25,6 @@ import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.BrowserInfo;
-import com.vaadin.terminal.gwt.client.Console;
 import com.vaadin.terminal.gwt.client.Container;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.RenderSpace;
@@ -1130,11 +1129,14 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
             if (!DOM.isOrHasChild(getElement(), target)) {
                 // not within the modal window, but let's see if it's in the
                 // debug window
-                Console console = ApplicationConnection.getConsole();
-                if (console instanceof VDebugConsole
-                        && DOM.isOrHasChild(
-                                ((VDebugConsole) console).getElement(), target)) {
-                    return true; // allow debug-window clicks
+                Widget w = Util.findWidget(target, null);
+                while (w != null) {
+                    if (w instanceof VDebugConsole) {
+                        return true; // allow debug-window clicks
+                    } else if (w instanceof Paintable) {
+                        return false;
+                    }
+                    w = w.getParent();
                 }
                 return false;
             }
index da9c01dae3028f4bd3bc443a44b384f9f4c1d885..77dbff9ab0867e7d65aa5f919c3edf5a3872ad3d 100644 (file)
@@ -6,8 +6,8 @@
  */
 package com.vaadin.terminal.gwt.client.ui.dd;
 
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
 
 /**
  * TODO implementation could now be simplified/optimized
@@ -23,8 +23,7 @@ final public class VNot extends VAcceptCriterion {
         if (crit1 == null) {
             crit1 = getCriteria(drag, configuration, 0);
             if (crit1 == null) {
-                ApplicationConnection.getConsole().log(
-                        "Not criteria didn't found a child criteria");
+                VConsole.log("Not criteria didn't found a child criteria");
                 return;
             }
         }
index 8770fabdb52e5f4e5361d1a7e6c5d9bfee78e0ca..babb00c61b515ad25f626c09b594d6a7e7186acc 100644 (file)
@@ -21,6 +21,7 @@ import com.vaadin.terminal.gwt.client.RenderInformation.Size;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
 import com.vaadin.terminal.gwt.client.VCaption;
+import com.vaadin.terminal.gwt.client.VConsole;
 import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
 
 public class ChildComponentContainer extends Panel {
@@ -715,15 +716,13 @@ public class ChildComponentContainer extends Panel {
         // + " to " + containerWidth + "," + containerHeight);
 
         if (containerWidth < 0) {
-            ApplicationConnection.getConsole().log(
-                    "containerWidth should never be negative: "
-                            + containerWidth);
+            VConsole.log("containerWidth should never be negative: "
+                    + containerWidth);
             containerWidth = 0;
         }
         if (containerHeight < 0) {
-            ApplicationConnection.getConsole().log(
-                    "containerHeight should never be negative: "
-                            + containerHeight);
+            VConsole.log("containerHeight should never be negative: "
+                    + containerHeight);
             containerHeight = 0;
         }