diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-09-17 11:07:59 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-09-17 11:07:59 +0000 |
commit | 899b7f7762120be55d3203269b86ae67f2d140bd (patch) | |
tree | 47942d00f64b93f795b3d2ce8dd86a242e146dbf /src | |
parent | c5b7f93cc884e12823f0e4d8e761c306d114cfad (diff) | |
download | vaadin-framework-899b7f7762120be55d3203269b86ae67f2d140bd.tar.gz vaadin-framework-899b7f7762120be55d3203269b86ae67f2d140bd.zip |
#5613 Converted our own client side code to use VConsole instead of ApplicationConnection.getConsole
svn changeset:14989/svn branch:6.4
Diffstat (limited to 'src')
20 files changed, 71 insertions, 111 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index c71ebb78e9..3f54d34e39 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -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 ?? } }); diff --git a/src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java b/src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java index b30ff1f843..e1078bf57a 100644 --- a/src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java +++ b/src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java @@ -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 diff --git a/src/com/vaadin/terminal/gwt/client/DateTimeService.java b/src/com/vaadin/terminal/gwt/client/DateTimeService.java index 449dae73db..8c3f9cdfaa 100644 --- a/src/com/vaadin/terminal/gwt/client/DateTimeService.java +++ b/src/com/vaadin/terminal/gwt/client/DateTimeService.java @@ -59,7 +59,7 @@ public class DateTimeService { try {
return LocaleService.getMonthNames(currentLocale)[month];
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return null;
}
}
@@ -68,7 +68,7 @@ public class DateTimeService { try {
return LocaleService.getShortMonthNames(currentLocale)[month];
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return null;
}
}
@@ -77,7 +77,7 @@ public class DateTimeService { try {
return LocaleService.getDayNames(currentLocale)[day];
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return null;
}
}
@@ -86,7 +86,7 @@ public class DateTimeService { try {
return LocaleService.getShortDayNames(currentLocale)[day];
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return null;
}
}
@@ -95,7 +95,7 @@ public class DateTimeService { try {
return LocaleService.getFirstDayOfWeek(currentLocale);
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return 0;
}
}
@@ -104,7 +104,7 @@ public class DateTimeService { try {
return LocaleService.isTwelveHourClock(currentLocale);
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return false;
}
}
@@ -113,7 +113,7 @@ public class DateTimeService { try {
return LocaleService.getClockDelimiter(currentLocale);
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
return ":";
}
}
@@ -125,9 +125,8 @@ public class DateTimeService { return LocaleService.getAmPmStrings(currentLocale);
} catch (final LocaleNotLoadedException e) {
// TODO can this practically even happen? Should die instead?
- ApplicationConnection.getConsole().error(
- "Locale not loaded, using fallback : AM/PM");
- ApplicationConnection.getConsole().error(e);
+ VConsole.error("Locale not loaded, using fallback : AM/PM");
+ VConsole.error(e);
return DEFAULT_AMPM_STRINGS;
}
}
@@ -139,9 +138,8 @@ public class DateTimeService { try {
firstDay = LocaleService.getFirstDayOfWeek(currentLocale);
} catch (final LocaleNotLoadedException e) {
- ApplicationConnection.getConsole().error(
- "Locale not loaded, using fallback 0");
- ApplicationConnection.getConsole().error(e);
+ VConsole.error("Locale not loaded, using fallback 0");
+ VConsole.error(e);
firstDay = 0;
}
int start = dateForFirstOfThisMonth.getDay() - firstDay;
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index e94f9b4bcb..da1d9ce43e 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -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; } } diff --git a/src/com/vaadin/terminal/gwt/client/VCaption.java b/src/com/vaadin/terminal/gwt/client/VCaption.java index a8a694b9eb..4309c2c8f5 100644 --- a/src/com/vaadin/terminal/gwt/client/VCaption.java +++ b/src/com/vaadin/terminal/gwt/client/VCaption.java @@ -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."); } } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java index 286704a0fe..af856d047c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java @@ -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; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index 6ffa66d6cd..dd4411b60e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -36,9 +36,9 @@ import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.ListBox;
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.DateTimeService;
+import com.vaadin.terminal.gwt.client.VConsole;
@SuppressWarnings("deprecation")
public class VCalendarPanel extends FocusableFlexTable implements
@@ -274,8 +274,7 @@ public class VCalendarPanel extends FocusableFlexTable implements selectDate(focusedDate.getDate());
} else {
- ApplicationConnection.getConsole().log(
- "Trying to select a the focused date which is NULL!");
+ VConsole.log("Trying to select a the focused date which is NULL!");
}
}
@@ -577,7 +576,6 @@ public class VCalendarPanel extends FocusableFlexTable implements focusChangeListener.focusChanged(new Date(focusedDate.getTime()));
}
- Date start = new Date();
final boolean needsMonth = getResolution() > VDateField.RESOLUTION_YEAR;
boolean needsBody = getResolution() >= VDateField.RESOLUTION_DAY;
buildCalendarHeader(true, needsMonth);
@@ -598,11 +596,6 @@ public class VCalendarPanel extends FocusableFlexTable implements remove(time);
}
- Date end = new Date();
- ApplicationConnection.getConsole().error(
- "Rendering calendar panel for(ms) "
- + (end.getTime() - start.getTime()));
-
}
/**
@@ -720,9 +713,6 @@ public class VCalendarPanel extends FocusableFlexTable implements (Node) event.getNativeEvent().getEventTarget().cast())) {
int nativeKeyCode = event.getNativeEvent().getKeyCode();
if (nativeKeyCode == getSelectKey()) {
- ApplicationConnection.getConsole().log(
- "keydown on listselects"
- + event.getNativeEvent().getKeyCode());
onSubmit(); // submit happens if enter key hit down on listboxes
event.preventDefault();
event.stopPropagation();
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java index d5d8d3627d..4813dbcd21 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java @@ -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); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VDateField.java b/src/com/vaadin/terminal/gwt/client/ui/VDateField.java index bbd1da5080..0537026b73 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VDateField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VDateField.java @@ -13,6 +13,7 @@ import com.vaadin.terminal.gwt.client.DateTimeService; import com.vaadin.terminal.gwt.client.LocaleNotLoadedException;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.VTooltip;
public class VDateField extends FlowPanel implements Paintable, Field {
@@ -101,11 +102,9 @@ public class VDateField extends FlowPanel implements Paintable, Field { currentLocale = locale;
} catch (final LocaleNotLoadedException e) {
currentLocale = dts.getLocale();
- ApplicationConnection.getConsole().error(
- "Tried to use an unloaded locale \"" + locale
- + "\". Using default locale (" + currentLocale
- + ").");
- ApplicationConnection.getConsole().error(e);
+ VConsole.error("Tried to use an unloaded locale \"" + locale
+ + "\". Using default locale (" + currentLocale + ").");
+ VConsole.error(e);
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java index 0735f0049f..6fe8c60e31 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java @@ -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) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VForm.java b/src/com/vaadin/terminal/gwt/client/ui/VForm.java index 9872dd0c1b..7d98604d40 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VForm.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VForm.java @@ -22,6 +22,7 @@ import com.vaadin.terminal.gwt.client.RenderInformation; 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.VErrorMessage;
public class VForm extends ComplexPanel implements Container, KeyDownHandler {
@@ -214,8 +215,7 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler { return new RenderSpace(renderInformation.getContentAreaSize()
.getWidth(), 0);
} else {
- ApplicationConnection.getConsole().error(
- "Invalid child requested RenderSpace information");
+ VConsole.error("Invalid child requested RenderSpace information");
return null;
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java index 281b5a8df4..b0c8523753 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java @@ -24,6 +24,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.DateTimeService;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusOutListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.SubmitListener;
@@ -63,9 +64,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, calendar = GWT.create(VCalendarPanel.class);
calendar.setFocusOutListener(new FocusOutListener() {
public boolean onFocusOut(DomEvent event) {
- ApplicationConnection.getConsole().log(
- "Focus out event, due to "
- + event.getNativeEvent().getType());
event.preventDefault();
closeCalendarPanel();
return true;
@@ -233,7 +231,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, if (!open && !readonly) {
open = true;
- final Date start = new Date();
if (getCurrentDate() != null) {
calendar.setDate((Date) getCurrentDate().clone());
@@ -287,12 +284,6 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, popup.setPopupPosition(l,
t + calendarToggle.getOffsetHeight() + 2);
- Date end = new Date();
-
- ApplicationConnection.getConsole().log(
- "Rendering VCalendar took "
- + (end.getTime() - start.getTime() + "ms"));
-
/*
* We have to wait a while before focusing since the popup
* needs to be opened before we can focus
@@ -308,8 +299,7 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field, }
});
} else {
- ApplicationConnection.getConsole().error(
- "Cannot reopen popup, it is already open!");
+ VConsole.error("Cannot reopen popup, it is already open!");
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index ff7328c004..38f5f63738 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -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 { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java index 5715e0bb7b..9b7103d39f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VSlider.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VSlider.java @@ -362,7 +362,6 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field, feedbackPopup.show();
} else if (targ.equals(getElement())
&& DOM.eventGetType(event) == Event.ONBLUR) {
- ApplicationConnection.getConsole().error(targ.getClassName());
feedbackPopup.hide();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
feedbackPopup.show();
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java index 134678e864..854d2ce4ac 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java @@ -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 diff --git a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java index 62d7a45477..b175a50619 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VUpload.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VUpload.java @@ -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); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 31e8d6ebd4..a0af7f90d5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -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()); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index c398db048b..ec26626015 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -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; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java index da9c01dae3..77dbff9ab0 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java @@ -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; } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java index 8770fabdb5..babb00c61b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java +++ b/src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java @@ -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; } |