From b86663e461c97fb09b70e22495bc5bb78197257e Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Wed, 1 Aug 2012 10:28:17 +0000 Subject: [PATCH] Remove unused debug info in VConsole --- .../gwt/client/ui/VMaskedPopupCalendar.java | 10 ++++++--- .../gwt/client/ui/VMaskedTextField.java | 22 ++++++++----------- .../vaadin/terminal/gwt/client/WidgetMap.java | 2 -- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedPopupCalendar.java b/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedPopupCalendar.java index 324bb97521..86098f711a 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedPopupCalendar.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedPopupCalendar.java @@ -11,6 +11,7 @@ import com.google.gwt.user.client.ui.TextBox; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.UIDL; +import com.vaadin.terminal.gwt.client.VConsole; import com.vaadin.terminal.gwt.client.ui.VPopupCalendar; import java.util.ArrayList; @@ -25,6 +26,8 @@ public class VMaskedPopupCalendar extends VPopupCalendar { private static final String MASKED_FIELD_CLASS = "v-maskedfield-onlymask"; + private static final boolean isDebug = false; + private char placeholder = '_'; private StringBuilder string; @@ -40,7 +43,8 @@ public class VMaskedPopupCalendar extends VPopupCalendar { private TextBox textBox; private void debug(String msg) { - ApplicationConnection.getConsole().log(msg); + if (isDebug) + VConsole.log(msg); } private KeyPressHandler keyPressHandler = new KeyPressHandler() { @@ -144,7 +148,7 @@ public class VMaskedPopupCalendar extends VPopupCalendar { public void onBlur(BlurEvent event) { if (isReadonly()) return; - if (!string.toString().equals(nullRepresentation)){ + if (!string.toString().equals(nullRepresentation)) { textBox.getElement().removeClassName(MASKED_FIELD_CLASS); } debug("blurHandler.onBlur"); @@ -186,7 +190,7 @@ public class VMaskedPopupCalendar extends VPopupCalendar { public void setText(String value) { debug("setText: " + value); - if (value.equals(nullRepresentation)||value.equals("")) { + if (value.equals(nullRepresentation) || value.equals("")) { textBox.getElement().addClassName(MASKED_FIELD_CLASS); } else { textBox.getElement().removeClassName(MASKED_FIELD_CLASS); diff --git a/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedTextField.java b/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedTextField.java index dc69bb28c9..435b8a9e72 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedTextField.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/toolkit/gwt/client/ui/VMaskedTextField.java @@ -1,28 +1,23 @@ package com.haulmont.cuba.toolkit.gwt.client.ui; -import java.util.ArrayList; -import java.util.List; - -import com.google.gwt.event.dom.client.BlurEvent; -import com.google.gwt.event.dom.client.BlurHandler; -import com.google.gwt.event.dom.client.FocusEvent; -import com.google.gwt.event.dom.client.FocusHandler; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.event.dom.client.KeyDownEvent; -import com.google.gwt.event.dom.client.KeyDownHandler; -import com.google.gwt.event.dom.client.KeyPressEvent; -import com.google.gwt.event.dom.client.KeyPressHandler; +import com.google.gwt.event.dom.client.*; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.UIDL; +import com.vaadin.terminal.gwt.client.VConsole; import com.vaadin.terminal.gwt.client.ui.VTextField; +import java.util.ArrayList; +import java.util.List; + public class VMaskedTextField extends VTextField { public static final String CLASSNAME = "v-maskedfield"; private static final String MASKED_FIELD_CLASS = "v-maskedfield-onlymask"; + private static final boolean isDebug = false; + private char placeholder = '_'; private StringBuilder string; @@ -34,7 +29,8 @@ public class VMaskedTextField extends VTextField { private List maskTest; private void debug(String msg) { - ApplicationConnection.getConsole().log(msg); + if (isDebug) + VConsole.log(msg); } private KeyPressHandler keyPressHandler = new KeyPressHandler() { diff --git a/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/WidgetMap.java b/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/WidgetMap.java index 93268f7ec0..f2ba28748d 100644 --- a/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/WidgetMap.java +++ b/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/WidgetMap.java @@ -60,8 +60,6 @@ public abstract class WidgetMap { String fullyqualifiedName); private Paintable instantiateInternal(Class classType) { - VConsole.log(String.valueOf(classType)); - VConsole.log(String.valueOf(instmap.get(classType))); return instmap.get(classType).get(); }