} catch (NoDataException e) {
throw new RuntimeException(
"Missing data needed to invoke @DelegateToWidget for "
- + WidgetUtil.getSimpleName(component), e);
+ + component.getClass().getSimpleName(), e);
}
}
String key = null;
if (Profiler.isEnabled()) {
key = "updateFromUIDL for "
- + WidgetUtil
- .getSimpleName(legacyConnector);
+ + legacyConnector.getClass()
+ .getSimpleName();
Profiler.enter(key);
}
Profiler.enter("updateConnectorState inner loop");
if (Profiler.isEnabled()) {
Profiler.enter("Decode connector state "
- + WidgetUtil.getSimpleName(connector));
+ + connector.getClass().getSimpleName());
}
JavaScriptObject jso = states
if (Profiler.isEnabled()) {
Profiler.leave("Decode connector state "
- + WidgetUtil.getSimpleName(connector));
+ + connector.getClass().getSimpleName());
}
Profiler.enter("updateConnectorState create event");
if (Profiler.isEnabled()) {
Profiler.enter("ElementResizeListener.onElementResize construct profiler key");
key = "ElementResizeListener.onElementResize for "
- + WidgetUtil
- .getSimpleName(listener);
+ + listener.getClass()
+ .getSimpleName();
Profiler.leave("ElementResizeListener.onElementResize construct profiler key");
Profiler.enter(key);
}
String key = null;
if (Profiler.isEnabled()) {
key = "layoutHorizontally() for "
- + WidgetUtil.getSimpleName(cl);
+ + cl.getClass().getSimpleName();
Profiler.enter(key);
}
String key = null;
if (Profiler.isEnabled()) {
key = "layout() for "
- + WidgetUtil.getSimpleName(rr);
+ + rr.getClass().getSimpleName();
Profiler.enter(key);
}
String key = null;
if (Profiler.isEnabled()) {
key = "layoutVertically() for "
- + WidgetUtil.getSimpleName(cl);
+ + cl.getClass().getSimpleName();
Profiler.enter(key);
}
String key = null;
if (Profiler.isEnabled()) {
key = "layout() for "
- + WidgetUtil.getSimpleName(rr);
+ + rr.getClass().getSimpleName();
Profiler.enter(key);
}
String key = null;
if (Profiler.isEnabled()) {
key = "layout PostLayoutListener for "
- + WidgetUtil.getSimpleName(connector);
+ + connector.getClass().getSimpleName();
Profiler.enter(key);
}
VConsole.error("JSONP compile call failed");
// Don't log exception as they are shown as
// notifications
- VConsole.error(WidgetUtil.getSimpleName(caught) + ": "
+ VConsole.error(caught.getClass().getSimpleName() + ": "
+ caught.getMessage());
failed();
@Deprecated
public static String getSimpleName(Object widget) {
- return WidgetUtil.getSimpleName(widget);
+ if (widget == null) {
+ return "(null)";
+ }
+
+ String name = widget.getClass().getName();
+ return name.substring(name.lastIndexOf('.') + 1);
}
@Deprecated
}
- public static String getSimpleName(Object widget) {
- if (widget == null) {
- return "(null)";
- }
-
- String name = widget.getClass().getName();
- return name.substring(name.lastIndexOf('.') + 1);
- }
-
public static void setFloat(Element element, String value) {
if (BrowserInfo.get().isIE()) {
element.getStyle().setProperty("styleFloat", value);
if (basePath == null) {
return null;
}
- String simpleName = WidgetUtil.getSimpleName(w);
+ String simpleName = w.getClass().getSimpleName();
/*
* Check if the parent implements Iterable. At least VPopupView does not
return basePath + PARENTCHILD_SEPARATOR + simpleName + "["
+ pos + "]";
}
- String simpleName2 = WidgetUtil.getSimpleName(child);
+ String simpleName2 = child.getClass().getSimpleName();
if (simpleName.equals(simpleName2)) {
pos++;
}
// the same type before it
int nextIndex = 0;
for (Widget child : layout) {
- boolean matchingType = nextWidgetClassName
- .equals(WidgetUtil.getSimpleName(child));
+ boolean matchingType = nextWidgetClassName.equals(child
+ .getClass().getSimpleName());
if (matchingType && widgetPosition == 0) {
// This is the n:th child that we looked for
break;
while (iterator.hasNext()) {
Widget child = iterator.next();
- String simpleName2 = WidgetUtil.getSimpleName(child);
+ String simpleName2 = child.getClass().getSimpleName();
if (!widgetClassName.equals(simpleName2)
&& child instanceof Slot) {
* directly checking the stuff inside the slot
*/
child = ((Slot) child).getWidget();
- simpleName2 = WidgetUtil.getSimpleName(child);
+ simpleName2 = child.getClass().getSimpleName();
}
if (widgetClassName.equals(simpleName2)) {
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.Util;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.metadata.Property;
import com.vaadin.client.metadata.TypeDataStore;
import com.vaadin.client.ui.AbstractConnector;
// If the server-side class name didn't match, fall back to testing for
// the explicit widget name
- String widget = WidgetUtil.getSimpleName(connector.getWidget());
+ String widget = connector.getWidget().getClass().getSimpleName();
return widgetName.equals(widget)
|| widgetName.equals(widget + ".class");
package com.vaadin.client.connectors;
import com.vaadin.client.ServerConnector;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.communication.JsonDecoder;
import com.vaadin.client.extensions.AbstractExtensionConnector;
import com.vaadin.client.metadata.NoDataException;
if (presentationType == null) {
throw new IllegalStateException(
"No presentation type found for "
- + WidgetUtil.getSimpleName(this)
+ + getClass().getSimpleName()
+ ". This may be caused by some unspecified problem in widgetset compilation.");
}
}
} catch (NoDataException e) {
throw new IllegalStateException(
"Default implementation of createRenderer() does not work for "
- + WidgetUtil.getSimpleName(this)
+ + getClass().getSimpleName()
+ ". This might be caused by explicitely using "
+ "super.createRenderer() or some unspecified "
+ "problem with the widgetset compilation.", e);
import com.vaadin.client.ConnectorMap;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.SimpleTree;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ValueMap;
/**
final ServerConnector parent = connector.getParent();
final String parentId = parent.getConnectorId();
- final Label errorDetails = new Label(
- WidgetUtil.getSimpleName(connector) + "["
- + connector.getConnectorId() + "]" + " inside "
- + WidgetUtil.getSimpleName(parent));
+ final Label errorDetails = new Label(connector.getClass()
+ .getSimpleName()
+ + "["
+ + connector.getConnectorId()
+ + "]"
+ + " inside " + parent.getClass().getSimpleName());
if (parent instanceof ComponentConnector) {
final ComponentConnector parentConnector = (ComponentConnector) parent;
Highlight.show(connector);
- final SimpleTree errorNode = new SimpleTree(
- WidgetUtil.getSimpleName(connector) + " id: " + pid);
+ final SimpleTree errorNode = new SimpleTree(connector.getClass()
+ .getSimpleName() + " id: " + pid);
errorNode.addDomHandler(new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.JsArrayObject;
import com.vaadin.client.ServerConnector;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.VConsole;
+import com.vaadin.client.WidgetUtil;
import com.vaadin.client.metadata.NoDataException;
import com.vaadin.client.metadata.Property;
import com.vaadin.client.ui.AbstractConnector;
ignoreProperties.add("id");
String html = getRowHTML("Id", connector.getConnectorId());
- html += getRowHTML("Connector", WidgetUtil.getSimpleName(connector));
+ html += getRowHTML("Connector", connector.getClass().getSimpleName());
if (connector instanceof ComponentConnector) {
ComponentConnector component = (ComponentConnector) connector;
AbstractComponentState componentState = component.getState();
- html += getRowHTML("Widget",
- WidgetUtil.getSimpleName(component.getWidget()));
+ html += getRowHTML("Widget", component.getWidget().getClass()
+ .getSimpleName());
html += getRowHTML("Caption", componentState.caption);
html += getRowHTML("Description", componentState.description);
html += getRowHTML("Width", componentState.width + " (actual: "
import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.metadata.NoDataException;
import com.vaadin.client.metadata.Type;
} catch (NoDataException e) {
throw new IllegalStateException(
"Default implementation of createWidget() does not work for "
- + WidgetUtil.getSimpleName(this)
+ + getClass().getSimpleName()
+ ". This might be caused by explicitely using "
+ "super.createWidget() or some unspecified "
+ "problem with the widgetset compilation.", e);
public Widget getWidget() {
if (widget == null) {
Profiler.enter("AbstractComponentConnector.createWidget for "
- + WidgetUtil.getSimpleName(this));
+ + getClass().getSimpleName());
widget = createWidget();
Profiler.leave("AbstractComponentConnector.createWidget for "
- + WidgetUtil.getSimpleName(this));
+ + getClass().getSimpleName());
}
return widget;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.communication.RpcProxy;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler;
addStateChangeHandler(this);
if (Profiler.isEnabled()) {
Profiler.enter("AbstractConnector.init "
- + WidgetUtil.getSimpleName(this));
+ + getClass().getSimpleName());
}
init();
if (Profiler.isEnabled()) {
Profiler.leave("AbstractConnector.init "
- + WidgetUtil.getSimpleName(this));
+ + getClass().getSimpleName());
}
Profiler.leave("AbstractConnector.doInit");
}
public void fireEvent(GwtEvent<?> event) {
String profilerKey = null;
if (Profiler.isEnabled()) {
- profilerKey = "Fire " + WidgetUtil.getSimpleName(event) + " for "
- + WidgetUtil.getSimpleName(this);
+ profilerKey = "Fire " + event.getClass().getSimpleName() + " for "
+ + getClass().getSimpleName();
Profiler.enter(profilerKey);
}
if (handlerManager != null) {
} catch (NoDataException e) {
throw new IllegalStateException(
"There is no information about the state for "
- + WidgetUtil.getSimpleName(this)
+ + getClass().getSimpleName()
+ ". Did you remember to compile the right widgetset?",
e);
}
} catch (NoDataException e) {
throw new IllegalStateException(
"There is no information about the state for "
- + WidgetUtil.getSimpleName(connector)
+ + connector.getClass().getSimpleName()
+ ". Did you remember to compile the right widgetset?",
e);
}
import com.vaadin.client.ServerConnector;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.ManagedLayout;
import com.vaadin.shared.AbstractComponentState;
}
private static String getCompactConnectorString(ServerConnector connector) {
- return WidgetUtil.getSimpleName(connector) + " ("
+ return connector.getClass().getSimpleName() + " ("
+ connector.getConnectorId() + ")";
}
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
import com.vaadin.client.ServerConnector;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.extensions.AbstractExtensionConnector;
import com.vaadin.shared.ui.Connect;
import com.vaadin.tests.extensions.BasicExtension;
}
private void appendMessage(String action) {
- String message = WidgetUtil.getSimpleName(this) + action
- + WidgetUtil.getSimpleName(target);
+ String message = getClass().getSimpleName() + action
+ + target.getClass().getSimpleName();
DivElement element = Document.get().createDivElement();
element.setInnerText(message);
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.SpanElement;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.ui.UIConnector;
import com.vaadin.shared.ui.Connect;
import com.vaadin.ui.UI;
public void test() {
SpanElement span = Document.get().createSpanElement();
span.setInnerText("This is the "
- + WidgetUtil.getSimpleName(CustomUIConnector.this));
+ + CustomUIConnector.this.getClass().getSimpleName());
Document.get().getBody().insertFirst(span);
}
});