// 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 ??
}
});
@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
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
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
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
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
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
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
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
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
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
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;
}
}
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.");
}
}
}
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 {
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;
}
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;
}
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
\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
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
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
(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
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 {
}
}
} catch (Exception e) {
- ApplicationConnection.getConsole().log(
- "CssLayout encounterd invalid css string: "
- + css);
+ VConsole.log("CssLayout encounterd invalid css string: "
+ + css);
}
}
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
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
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 {
}
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");
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) {
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
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
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
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
\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
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
}\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
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;
if (prev != null) {
return setRowFocus(prev);
} else {
- ApplicationConnection.getConsole().log(
- "no previous available");
+ VConsole.log("no previous available");
}
}
}
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 {
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
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 {
} catch (LocaleNotLoadedException e) {
// TODO should die instead? Can the component survive
// without format string?
- ApplicationConnection.getConsole().error(e);
+ VConsole.error(e);
}
}
}
// 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
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;
/**
*
if (t != null) {
t.cancel();
}
- ApplicationConnection.getConsole().log("Submit complete");
+ VConsole.log("VUpload:Submit complete");
client.sendPendingVariableChanges();
}
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
element.submit();
submitted = true;
- ApplicationConnection.getConsole().log("Submitted form");
+ VConsole.log("Submitted form");
disableUpload();
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);
}
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;
/**
} else if (toBeFocused instanceof Focusable) {
((Focusable) toBeFocused).focus();
} else {
- ApplicationConnection.getConsole().log(
- "Could not focus component");
+ VConsole.log("Could not focus component");
}
}
});
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();
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());
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;
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;
}
*/
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
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;
}
}
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 {
// + " 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;
}