* Deprecated old methods in Util for backwards compatibility Change-Id: I9de5e6b930d9f2c0268967dc7b1cf465e6310280tags/7.4.0.beta2
@@ -411,14 +411,14 @@ public class ApplicationConfiguration implements EntryPoint { | |||
* desired locations even if the base URL of the page changes later | |||
* (e.g. with pushState) | |||
*/ | |||
serviceUrl = Util.getAbsoluteUrl(serviceUrl); | |||
serviceUrl = WidgetUtil.getAbsoluteUrl(serviceUrl); | |||
} | |||
// Ensure there's an ending slash (to make appending e.g. UIDL work) | |||
if (!useServiceUrlPathParam() && !serviceUrl.endsWith("/")) { | |||
serviceUrl += '/'; | |||
} | |||
vaadinDirUrl = Util.getAbsoluteUrl(jsoConfiguration | |||
vaadinDirUrl = WidgetUtil.getAbsoluteUrl(jsoConfiguration | |||
.getConfigString(ApplicationConstants.VAADIN_DIR_URL)); | |||
uiId = jsoConfiguration.getConfigInteger(UIConstants.UI_ID_PARAMETER) | |||
.intValue(); |
@@ -62,6 +62,7 @@ import com.google.gwt.user.client.Window.ClosingHandler; | |||
import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConfiguration.ErrorMessage; | |||
import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; | |||
import com.vaadin.client.ResourceLoader.ResourceLoadEvent; | |||
import com.vaadin.client.ResourceLoader.ResourceLoadListener; | |||
import com.vaadin.client.communication.HasJavaScriptConnectorHelper; | |||
@@ -1865,7 +1866,7 @@ public class ApplicationConnection implements HasHandlers { | |||
} catch (NoDataException e) { | |||
throw new RuntimeException( | |||
"Missing data needed to invoke @DelegateToWidget for " | |||
+ Util.getSimpleName(component), e); | |||
+ WidgetUtil.getSimpleName(component), e); | |||
} | |||
} | |||
@@ -2046,7 +2047,8 @@ public class ApplicationConnection implements HasHandlers { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "updateFromUIDL for " | |||
+ Util.getSimpleName(legacyConnector); | |||
+ WidgetUtil | |||
.getSimpleName(legacyConnector); | |||
Profiler.enter(key); | |||
} | |||
@@ -2146,12 +2148,12 @@ public class ApplicationConnection implements HasHandlers { | |||
Profiler.enter("updateConnectorState inner loop"); | |||
if (Profiler.isEnabled()) { | |||
Profiler.enter("Decode connector state " | |||
+ Util.getSimpleName(connector)); | |||
+ WidgetUtil.getSimpleName(connector)); | |||
} | |||
JavaScriptObject jso = states | |||
.getJavaScriptObject(connectorId); | |||
JsonObject stateJson = Util.jso2json(jso); | |||
JsonObject stateJson = WidgetUtil.jso2json(jso); | |||
if (connector instanceof HasJavaScriptConnectorHelper) { | |||
((HasJavaScriptConnectorHelper) connector) | |||
@@ -2183,7 +2185,7 @@ public class ApplicationConnection implements HasHandlers { | |||
if (Profiler.isEnabled()) { | |||
Profiler.leave("Decode connector state " | |||
+ Util.getSimpleName(connector)); | |||
+ WidgetUtil.getSimpleName(connector)); | |||
} | |||
Profiler.enter("updateConnectorState create event"); | |||
@@ -2523,7 +2525,7 @@ public class ApplicationConnection implements HasHandlers { | |||
VConsole.log(" * Performing server to client RPC calls"); | |||
JsonArray rpcCalls = Util.jso2json(json | |||
JsonArray rpcCalls = WidgetUtil.jso2json(json | |||
.getJavaScriptObject("rpc")); | |||
int rpcLength = rpcCalls.length(); | |||
@@ -3648,7 +3650,7 @@ public class ApplicationConnection implements HasHandlers { | |||
* @return Connector for focused element or null. | |||
*/ | |||
private ComponentConnector getActiveConnector() { | |||
Element focusedElement = Util.getFocusedElement(); | |||
Element focusedElement = WidgetUtil.getFocusedElement(); | |||
if (focusedElement == null) { | |||
return null; | |||
} |
@@ -343,7 +343,7 @@ public class BrowserInfo { | |||
public boolean requiresOverflowAutoFix() { | |||
return (getWebkitVersion() > 0 || getOperaVersion() >= 11 | |||
|| getIEVersion() >= 10 || isFirefox()) | |||
&& Util.getNativeScrollbarSize() > 0; | |||
&& WidgetUtil.getNativeScrollbarSize() > 0; | |||
} | |||
/** | |||
@@ -359,7 +359,8 @@ public class BrowserInfo { | |||
* otherwise <code>false</code> | |||
*/ | |||
public boolean requiresPositionAbsoluteOverflowAutoFix() { | |||
return (getWebkitVersion() > 0) && Util.getNativeScrollbarSize() > 0; | |||
return (getWebkitVersion() > 0) | |||
&& WidgetUtil.getNativeScrollbarSize() > 0; | |||
} | |||
/** |
@@ -319,7 +319,7 @@ public class JavaScriptConnectorHelper { | |||
iface = findWildcardInterface(method); | |||
} | |||
JsonArray argumentsArray = Util.jso2json(arguments); | |||
JsonArray argumentsArray = WidgetUtil.jso2json(arguments); | |||
Object[] parameters = new Object[arguments.length()]; | |||
for (int i = 0; i < parameters.length; i++) { | |||
parameters[i] = argumentsArray.get(i); | |||
@@ -383,7 +383,7 @@ public class JavaScriptConnectorHelper { | |||
}-*/; | |||
public Object[] decodeRpcParameters(JsonArray parametersJson) { | |||
return new Object[] { Util.json2jso(parametersJson) }; | |||
return new Object[] { WidgetUtil.json2jso(parametersJson) }; | |||
} | |||
public void setTag(int tag) { | |||
@@ -397,10 +397,11 @@ public class JavaScriptConnectorHelper { | |||
if ("com.vaadin.ui.JavaScript$JavaScriptCallbackRpc".equals(iface) | |||
&& "call".equals(method)) { | |||
String callbackName = parametersJson.getString(0); | |||
JavaScriptObject arguments = Util.json2jso(parametersJson.get(1)); | |||
JavaScriptObject arguments = WidgetUtil.json2jso(parametersJson | |||
.get(1)); | |||
invokeCallback(getConnectorWrapper(), callbackName, arguments); | |||
} else { | |||
JavaScriptObject arguments = Util.json2jso(parametersJson); | |||
JavaScriptObject arguments = WidgetUtil.json2jso(parametersJson); | |||
invokeJsRpc(rpcMap, iface, method, arguments); | |||
// Also invoke wildcard interface | |||
invokeJsRpc(rpcMap, "", method, arguments); |
@@ -346,7 +346,8 @@ public class LayoutManager { | |||
if (Profiler.isEnabled()) { | |||
Profiler.enter("ElementResizeListener.onElementResize construct profiler key"); | |||
key = "ElementResizeListener.onElementResize for " | |||
+ Util.getSimpleName(listener); | |||
+ WidgetUtil | |||
.getSimpleName(listener); | |||
Profiler.leave("ElementResizeListener.onElementResize construct profiler key"); | |||
Profiler.enter(key); | |||
} | |||
@@ -389,7 +390,7 @@ public class LayoutManager { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "layoutHorizontally() for " | |||
+ Util.getSimpleName(cl); | |||
+ WidgetUtil.getSimpleName(cl); | |||
Profiler.enter(key); | |||
} | |||
@@ -411,7 +412,8 @@ public class LayoutManager { | |||
try { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "layout() for " + Util.getSimpleName(rr); | |||
key = "layout() for " | |||
+ WidgetUtil.getSimpleName(rr); | |||
Profiler.enter(key); | |||
} | |||
@@ -444,7 +446,7 @@ public class LayoutManager { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "layoutVertically() for " | |||
+ Util.getSimpleName(cl); | |||
+ WidgetUtil.getSimpleName(cl); | |||
Profiler.enter(key); | |||
} | |||
@@ -466,7 +468,8 @@ public class LayoutManager { | |||
try { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "layout() for " + Util.getSimpleName(rr); | |||
key = "layout() for " | |||
+ WidgetUtil.getSimpleName(rr); | |||
Profiler.enter(key); | |||
} | |||
@@ -545,7 +548,7 @@ public class LayoutManager { | |||
String key = null; | |||
if (Profiler.isEnabled()) { | |||
key = "layout PostLayoutListener for " | |||
+ Util.getSimpleName(connector); | |||
+ WidgetUtil.getSimpleName(connector); | |||
Profiler.enter(key); | |||
} | |||
@@ -94,7 +94,7 @@ public class LayoutManagerIE8 extends LayoutManager { | |||
* the containing element. To force a reflow by modifying the magical | |||
* zoom property. | |||
*/ | |||
Util.forceIE8Redraw(RootPanel.get().getElement()); | |||
WidgetUtil.forceIE8Redraw(RootPanel.get().getElement()); | |||
Profiler.leave("LayoutManagerIE8.performBrowserLayoutHacks"); | |||
} | |||
} |
@@ -236,7 +236,7 @@ public class MeasuredSize { | |||
Profiler.leave("Measure borders"); | |||
Profiler.enter("Measure height"); | |||
int requiredHeight = Util.getRequiredHeight(element); | |||
int requiredHeight = WidgetUtil.getRequiredHeight(element); | |||
int marginHeight = sumHeights(margins); | |||
int oldHeight = height; | |||
int oldWidth = width; | |||
@@ -247,7 +247,7 @@ public class MeasuredSize { | |||
Profiler.leave("Measure height"); | |||
Profiler.enter("Measure width"); | |||
int requiredWidth = Util.getRequiredWidth(element); | |||
int requiredWidth = WidgetUtil.getRequiredWidth(element); | |||
int marginWidth = sumWidths(margins); | |||
if (setOuterWidth(requiredWidth + marginWidth)) { | |||
debugSizeChange(element, "Width (outer)", oldWidth, width); |
@@ -57,8 +57,8 @@ public class MouseEventDetailsBuilder { | |||
Element relativeToElement) { | |||
MouseEventDetails mouseEventDetails = new MouseEventDetails(); | |||
mouseEventDetails.setType(Event.getTypeInt(evt.getType())); | |||
mouseEventDetails.setClientX(Util.getTouchOrMouseClientX(evt)); | |||
mouseEventDetails.setClientY(Util.getTouchOrMouseClientY(evt)); | |||
mouseEventDetails.setClientX(WidgetUtil.getTouchOrMouseClientX(evt)); | |||
mouseEventDetails.setClientY(WidgetUtil.getTouchOrMouseClientY(evt)); | |||
if (evt.getButton() == NativeEvent.BUTTON_LEFT) { | |||
mouseEventDetails.setButton(MouseButton.LEFT); | |||
} else if (evt.getButton() == NativeEvent.BUTTON_RIGHT) { |
@@ -34,7 +34,7 @@ public class RenderSpace extends Size { | |||
public RenderSpace(int width, int height, boolean useNativeScrollbarSize) { | |||
super(width, height); | |||
if (useNativeScrollbarSize) { | |||
scrollBarSize = Util.getNativeScrollbarSize(); | |||
scrollBarSize = WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
} | |||
@@ -225,7 +225,7 @@ public class ResourceLoader { | |||
*/ | |||
public void loadScript(final String scriptUrl, | |||
final ResourceLoadListener resourceLoadListener, boolean async) { | |||
final String url = Util.getAbsoluteUrl(scriptUrl); | |||
final String url = WidgetUtil.getAbsoluteUrl(scriptUrl); | |||
ResourceLoadEvent event = new ResourceLoadEvent(this, url, false); | |||
if (loadedResources.contains(url)) { | |||
if (resourceLoadListener != null) { | |||
@@ -307,7 +307,7 @@ public class ResourceLoader { | |||
*/ | |||
public void preloadResource(String url, | |||
ResourceLoadListener resourceLoadListener) { | |||
url = Util.getAbsoluteUrl(url); | |||
url = WidgetUtil.getAbsoluteUrl(url); | |||
ResourceLoadEvent event = new ResourceLoadEvent(this, url, true); | |||
if (loadedResources.contains(url) || preloadedResources.contains(url)) { | |||
// Already loaded or preloaded -> just fire listener | |||
@@ -424,7 +424,7 @@ public class ResourceLoader { | |||
*/ | |||
public void loadStylesheet(final String stylesheetUrl, | |||
final ResourceLoadListener resourceLoadListener) { | |||
final String url = Util.getAbsoluteUrl(stylesheetUrl); | |||
final String url = WidgetUtil.getAbsoluteUrl(stylesheetUrl); | |||
final ResourceLoadEvent event = new ResourceLoadEvent(this, url, false); | |||
if (loadedResources.contains(url)) { | |||
if (resourceLoadListener != null) { |
@@ -89,7 +89,7 @@ public class SuperDevMode { | |||
VConsole.error("JSONP compile call failed"); | |||
// Don't log exception as they are shown as | |||
// notifications | |||
VConsole.error(Util.getSimpleName(caught) + ": " | |||
VConsole.error(WidgetUtil.getSimpleName(caught) + ": " | |||
+ caught.getMessage()); | |||
failed(); | |||
@@ -510,17 +510,17 @@ public class VCaption extends HTML { | |||
int width = 0; | |||
if (icon != null) { | |||
width += Util.getRequiredWidth(icon.getElement()); | |||
width += WidgetUtil.getRequiredWidth(icon.getElement()); | |||
} | |||
if (captionText != null) { | |||
width += Util.getRequiredWidth(captionText); | |||
width += WidgetUtil.getRequiredWidth(captionText); | |||
} | |||
if (requiredFieldIndicator != null) { | |||
width += Util.getRequiredWidth(requiredFieldIndicator); | |||
width += WidgetUtil.getRequiredWidth(requiredFieldIndicator); | |||
} | |||
if (errorIndicatorElement != null) { | |||
width += Util.getRequiredWidth(errorIndicatorElement); | |||
width += WidgetUtil.getRequiredWidth(errorIndicatorElement); | |||
} | |||
return width; | |||
@@ -531,7 +531,7 @@ public class VCaption extends HTML { | |||
int width = 0; | |||
if (icon != null) { | |||
width += Util.getRequiredWidth(icon.getElement()); | |||
width += WidgetUtil.getRequiredWidth(icon.getElement()); | |||
} | |||
if (captionText != null) { | |||
int textWidth = captionText.getScrollWidth(); | |||
@@ -540,7 +540,7 @@ public class VCaption extends HTML { | |||
* In Firefox3 the caption might require more space than the | |||
* scrollWidth returns as scrollWidth is rounded down. | |||
*/ | |||
int requiredWidth = Util.getRequiredWidth(captionText); | |||
int requiredWidth = WidgetUtil.getRequiredWidth(captionText); | |||
if (requiredWidth > textWidth) { | |||
textWidth = requiredWidth; | |||
} | |||
@@ -549,10 +549,10 @@ public class VCaption extends HTML { | |||
width += textWidth; | |||
} | |||
if (requiredFieldIndicator != null) { | |||
width += Util.getRequiredWidth(requiredFieldIndicator); | |||
width += WidgetUtil.getRequiredWidth(requiredFieldIndicator); | |||
} | |||
if (errorIndicatorElement != null) { | |||
width += Util.getRequiredWidth(errorIndicatorElement); | |||
width += WidgetUtil.getRequiredWidth(errorIndicatorElement); | |||
} | |||
return width; | |||
@@ -564,26 +564,26 @@ public class VCaption extends HTML { | |||
int h; | |||
if (icon != null) { | |||
h = Util.getRequiredHeight(icon.getElement()); | |||
h = WidgetUtil.getRequiredHeight(icon.getElement()); | |||
if (h > height) { | |||
height = h; | |||
} | |||
} | |||
if (captionText != null) { | |||
h = Util.getRequiredHeight(captionText); | |||
h = WidgetUtil.getRequiredHeight(captionText); | |||
if (h > height) { | |||
height = h; | |||
} | |||
} | |||
if (requiredFieldIndicator != null) { | |||
h = Util.getRequiredHeight(requiredFieldIndicator); | |||
h = WidgetUtil.getRequiredHeight(requiredFieldIndicator); | |||
if (h > height) { | |||
height = h; | |||
} | |||
} | |||
if (errorIndicatorElement != null) { | |||
h = Util.getRequiredHeight(errorIndicatorElement); | |||
h = WidgetUtil.getRequiredHeight(errorIndicatorElement); | |||
if (h > height) { | |||
height = h; | |||
} | |||
@@ -619,11 +619,13 @@ public class VCaption extends HTML { | |||
// DOM.setStyleAttribute(getElement(), "width", maxWidth + "px"); | |||
if (requiredFieldIndicator != null) { | |||
availableWidth -= Util.getRequiredWidth(requiredFieldIndicator); | |||
availableWidth -= WidgetUtil | |||
.getRequiredWidth(requiredFieldIndicator); | |||
} | |||
if (errorIndicatorElement != null) { | |||
availableWidth -= Util.getRequiredWidth(errorIndicatorElement); | |||
availableWidth -= WidgetUtil | |||
.getRequiredWidth(errorIndicatorElement); | |||
} | |||
if (availableWidth < 0) { | |||
@@ -631,8 +633,8 @@ public class VCaption extends HTML { | |||
} | |||
if (icon != null) { | |||
int iconRequiredWidth = Util | |||
.getRequiredWidth(icon.getElement()); | |||
int iconRequiredWidth = WidgetUtil.getRequiredWidth(icon | |||
.getElement()); | |||
if (availableWidth > iconRequiredWidth) { | |||
availableWidth -= iconRequiredWidth; | |||
} else { | |||
@@ -642,7 +644,7 @@ public class VCaption extends HTML { | |||
} | |||
} | |||
if (captionText != null) { | |||
int captionWidth = Util.getRequiredWidth(captionText); | |||
int captionWidth = WidgetUtil.getRequiredWidth(captionText); | |||
if (availableWidth > captionWidth) { | |||
availableWidth -= captionWidth; | |||
@@ -161,7 +161,7 @@ public class VUIDLBrowser extends SimpleTree { | |||
} else { | |||
setText("Unknown connector (" + connectorId + ")"); | |||
} | |||
dir((JsonObject) Util.jso2json(stateChanges), this); | |||
dir((JsonObject) WidgetUtil.jso2json(stateChanges), this); | |||
} | |||
@Override |
@@ -25,7 +25,7 @@ import com.vaadin.client.FastStringSet; | |||
import com.vaadin.client.JsArrayObject; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler; | |||
import com.vaadin.client.metadata.NoDataException; | |||
import com.vaadin.client.metadata.Property; | |||
@@ -204,7 +204,7 @@ public class StateChangeEvent extends | |||
return true; | |||
} else if (stateJson != null) { | |||
// Check whether it's in the json object | |||
return isInJson(property, Util.json2jso(stateJson)); | |||
return isInJson(property, WidgetUtil.json2jso(stateJson)); | |||
} else { | |||
// Legacy cases | |||
if (changedProperties != null) { |
@@ -32,6 +32,7 @@ import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VCaption; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.SubPartAware; | |||
import com.vaadin.client.ui.VCssLayout; | |||
import com.vaadin.client.ui.VGridLayout; | |||
@@ -211,10 +212,10 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
// widget to which the path is relative. Otherwise, the current | |||
// implementation simply interprets the path as if baseElement was | |||
// null. | |||
Widget baseWidget = Util.findWidget(baseElement, null); | |||
Widget baseWidget = WidgetUtil.findWidget(baseElement, null); | |||
Widget w = getWidgetFromPath(widgetPath, baseWidget); | |||
if (w == null || !Util.isAttachedAndDisplayed(w)) { | |||
if (w == null || !WidgetUtil.isAttachedAndDisplayed(w)) { | |||
return null; | |||
} | |||
if (parts.length == 1) { | |||
@@ -333,7 +334,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
String childIndexString = part.substring("domChild[".length(), | |||
part.length() - 1); | |||
if (Util.findWidget(baseElement, null) instanceof VAbstractOrderedLayout) { | |||
if (WidgetUtil.findWidget(baseElement, null) instanceof VAbstractOrderedLayout) { | |||
if (element.hasChildNodes()) { | |||
Element e = element.getFirstChildElement().cast(); | |||
String cn = e.getClassName(); | |||
@@ -454,7 +455,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
if (basePath == null) { | |||
return null; | |||
} | |||
String simpleName = Util.getSimpleName(w); | |||
String simpleName = WidgetUtil.getSimpleName(w); | |||
/* | |||
* Check if the parent implements Iterable. At least VPopupView does not | |||
@@ -474,7 +475,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
return basePath + PARENTCHILD_SEPARATOR + simpleName + "[" | |||
+ pos + "]"; | |||
} | |||
String simpleName2 = Util.getSimpleName(child); | |||
String simpleName2 = WidgetUtil.getSimpleName(child); | |||
if (simpleName.equals(simpleName2)) { | |||
pos++; | |||
} | |||
@@ -605,8 +606,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
// the same type before it | |||
int nextIndex = 0; | |||
for (Widget child : layout) { | |||
boolean matchingType = nextWidgetClassName.equals(Util | |||
.getSimpleName(child)); | |||
boolean matchingType = nextWidgetClassName | |||
.equals(WidgetUtil.getSimpleName(child)); | |||
if (matchingType && widgetPosition == 0) { | |||
// This is the n:th child that we looked for | |||
break; | |||
@@ -660,7 +661,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
while (iterator.hasNext()) { | |||
Widget child = iterator.next(); | |||
String simpleName2 = Util.getSimpleName(child); | |||
String simpleName2 = WidgetUtil.getSimpleName(child); | |||
if (!widgetClassName.equals(simpleName2) | |||
&& child instanceof Slot) { | |||
@@ -670,7 +671,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* directly checking the stuff inside the slot | |||
*/ | |||
child = ((Slot) child).getWidget(); | |||
simpleName2 = Util.getSimpleName(child); | |||
simpleName2 = WidgetUtil.getSimpleName(child); | |||
} | |||
if (widgetClassName.equals(simpleName2)) { |
@@ -29,6 +29,7 @@ import com.vaadin.client.ApplicationConnection; | |||
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; | |||
@@ -644,7 +645,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
// If the server-side class name didn't match, fall back to testing for | |||
// the explicit widget name | |||
String widget = Util.getSimpleName(connector.getWidget()); | |||
String widget = WidgetUtil.getSimpleName(connector.getWidget()); | |||
return widgetName.equals(widget) | |||
|| widgetName.equals(widget + ".class"); | |||
@@ -16,7 +16,7 @@ | |||
package com.vaadin.client.connectors; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.JsonDecoder; | |||
import com.vaadin.client.extensions.AbstractExtensionConnector; | |||
import com.vaadin.client.metadata.NoDataException; | |||
@@ -57,7 +57,7 @@ public abstract class AbstractRendererConnector<T> extends | |||
if (presentationType == null) { | |||
throw new IllegalStateException( | |||
"No presentation type found for " | |||
+ Util.getSimpleName(this) | |||
+ WidgetUtil.getSimpleName(this) | |||
+ ". This may be caused by some unspecified problem in widgetset compilation."); | |||
} | |||
} | |||
@@ -110,7 +110,7 @@ public abstract class AbstractRendererConnector<T> extends | |||
} catch (NoDataException e) { | |||
throw new IllegalStateException( | |||
"Default implementation of createRenderer() does not work for " | |||
+ Util.getSimpleName(this) | |||
+ WidgetUtil.getSimpleName(this) | |||
+ ". This might be caused by explicitely using " | |||
+ "super.createRenderer() or some unspecified " | |||
+ "problem with the widgetset compilation.", e); |
@@ -40,7 +40,7 @@ import com.vaadin.client.ComputedStyle; | |||
import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.SimpleTree; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ValueMap; | |||
/** | |||
@@ -112,9 +112,10 @@ public class AnalyzeLayoutsPanel extends FlowPanel { | |||
final ServerConnector parent = connector.getParent(); | |||
final String parentId = parent.getConnectorId(); | |||
final Label errorDetails = new Label(Util.getSimpleName(connector) | |||
+ "[" + connector.getConnectorId() + "]" + " inside " | |||
+ Util.getSimpleName(parent)); | |||
final Label errorDetails = new Label( | |||
WidgetUtil.getSimpleName(connector) + "[" | |||
+ connector.getConnectorId() + "]" + " inside " | |||
+ WidgetUtil.getSimpleName(parent)); | |||
if (parent instanceof ComponentConnector) { | |||
final ComponentConnector parentConnector = (ComponentConnector) parent; | |||
@@ -172,7 +173,7 @@ public class AnalyzeLayoutsPanel extends FlowPanel { | |||
Highlight.show(connector); | |||
final SimpleTree errorNode = new SimpleTree( | |||
Util.getSimpleName(connector) + " id: " + pid); | |||
WidgetUtil.getSimpleName(connector) + " id: " + pid); | |||
errorNode.addDomHandler(new MouseOverHandler() { | |||
@Override | |||
public void onMouseOver(MouseOverEvent event) { |
@@ -24,7 +24,7 @@ import com.google.gwt.user.client.ui.HTML; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.JsArrayObject; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.metadata.NoDataException; | |||
import com.vaadin.client.metadata.Property; | |||
@@ -51,7 +51,7 @@ public class ConnectorInfoPanel extends FlowPanel { | |||
ignoreProperties.add("id"); | |||
String html = getRowHTML("Id", connector.getConnectorId()); | |||
html += getRowHTML("Connector", Util.getSimpleName(connector)); | |||
html += getRowHTML("Connector", WidgetUtil.getSimpleName(connector)); | |||
if (connector instanceof ComponentConnector) { | |||
ComponentConnector component = (ComponentConnector) connector; | |||
@@ -62,7 +62,7 @@ public class ConnectorInfoPanel extends FlowPanel { | |||
AbstractComponentState componentState = component.getState(); | |||
html += getRowHTML("Widget", | |||
Util.getSimpleName(component.getWidget())); | |||
WidgetUtil.getSimpleName(component.getWidget())); | |||
html += getRowHTML("Caption", componentState.caption); | |||
html += getRowHTML("Description", componentState.description); | |||
html += getRowHTML("Width", componentState.width + " (actual: " | |||
@@ -95,7 +95,8 @@ public class ConnectorInfoPanel extends FlowPanel { | |||
return "<div class=\"" + VDebugWindow.STYLENAME | |||
+ "-row\"><span class=\"caption\">" + caption | |||
+ "</span><span class=\"value\">" | |||
+ Util.escapeHTML(String.valueOf(value)) + "</span></div>"; | |||
+ WidgetUtil.escapeHTML(String.valueOf(value)) | |||
+ "</span></div>"; | |||
} | |||
/** |
@@ -35,6 +35,7 @@ import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.ValueMap; | |||
import com.vaadin.client.WidgetUtil; | |||
/** | |||
* Provides functionality for examining the UI component hierarchy. | |||
@@ -240,7 +241,7 @@ public class HierarchySection implements Section { | |||
} | |||
if (event.getTypeInt() == Event.ONMOUSEMOVE) { | |||
Highlight.hideAll(); | |||
Element eventTarget = Util.getElementFromPoint(event | |||
Element eventTarget = WidgetUtil.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { | |||
@@ -272,7 +273,7 @@ public class HierarchySection implements Section { | |||
event.consume(); | |||
event.getNativeEvent().stopPropagation(); | |||
stopFind(); | |||
Element eventTarget = Util.getElementFromPoint(event | |||
Element eventTarget = WidgetUtil.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
for (ApplicationConnection a : ApplicationConfiguration |
@@ -41,6 +41,7 @@ import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.ValueMap; | |||
import com.vaadin.client.WidgetUtil; | |||
/** | |||
* Provides functionality for picking selectors for Vaadin TestBench. | |||
@@ -62,7 +63,8 @@ public class TestBenchSection implements Section { | |||
String html = "<div class=\"" + VDebugWindow.STYLENAME | |||
+ "-selector\"><span class=\"tb-selector\">" | |||
+ Util.escapeHTML(path.getElementQuery()) + "</span></div>"; | |||
+ WidgetUtil.escapeHTML(path.getElementQuery()) | |||
+ "</span></div>"; | |||
setHTML(html); | |||
addMouseOverHandler(this); | |||
@@ -216,7 +218,7 @@ public class TestBenchSection implements Section { | |||
} | |||
if (event.getTypeInt() == Event.ONMOUSEMOVE | |||
|| event.getTypeInt() == Event.ONCLICK) { | |||
Element eventTarget = Util.getElementFromPoint(event | |||
Element eventTarget = WidgetUtil.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { | |||
@@ -230,8 +232,9 @@ public class TestBenchSection implements Section { | |||
// make sure that not finding the highlight element only | |||
Highlight.hideAll(); | |||
eventTarget = Util.getElementFromPoint(event.getNativeEvent() | |||
.getClientX(), event.getNativeEvent().getClientY()); | |||
eventTarget = WidgetUtil.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
ComponentConnector connector = findConnector(eventTarget); | |||
if (event.getTypeInt() == Event.ONMOUSEMOVE) { |
@@ -357,7 +357,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements | |||
/** | |||
* Forces IE8 to reinterpret CSS rules. | |||
* {@link com.vaadin.client.Util#forceIE8Redraw(com.google.gwt.dom.client.Element)} | |||
* {@link com.vaadin.client.WidgetUtil#forceIE8Redraw(com.google.gwt.dom.client.Element)} | |||
* doesn't work in this case. | |||
* | |||
* @param element |
@@ -22,7 +22,7 @@ import java.util.Set; | |||
import com.google.gwt.core.client.JavaScriptObject; | |||
import com.google.gwt.core.client.JsArray; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.JavaScriptMethodInvocation; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.extensions.AbstractExtensionConnector; | |||
@@ -116,7 +116,8 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { | |||
}-*/; | |||
public void sendRpc(String name, JsArray<JavaScriptObject> arguments) { | |||
Object[] parameters = new Object[] { name, Util.jso2json(arguments) }; | |||
Object[] parameters = new Object[] { name, | |||
WidgetUtil.jso2json(arguments) }; | |||
/* | |||
* Must invoke manually as the RPC interface can't be used in GWT |
@@ -26,7 +26,7 @@ import com.google.gwt.event.shared.EventHandler; | |||
import com.google.gwt.event.shared.HandlerManager; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.google.web.bindery.event.shared.HandlerRegistration; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.widget.escalator.Cell; | |||
import com.vaadin.client.widget.escalator.RowContainer; | |||
import com.vaadin.client.widget.grid.CellReference; | |||
@@ -167,15 +167,16 @@ public abstract class ClickableRenderer<T, W extends Widget> extends | |||
* <strong>Note:</strong> This method may not work reliably if the grid | |||
* in question is wrapped in a {@link Composite} <em>unless</em> the | |||
* element is inside another widget that is a child of the wrapped grid; | |||
* please refer to the note in {@link Util#findWidget(Element, Class) | |||
* Util.findWidget} for details. | |||
* please refer to the note in | |||
* {@link WidgetUtil#findWidget(Element, Class) Util.findWidget} for | |||
* details. | |||
* | |||
* @param e | |||
* the element whose parent grid to find | |||
* @return the parent grid or null if none found. | |||
*/ | |||
private static Grid<?> findClosestParentGrid(Element e) { | |||
Widget w = Util.findWidget(e, null); | |||
Widget w = WidgetUtil.findWidget(e, null); | |||
while (w != null && !(w instanceof Grid)) { | |||
w = w.getParent(); |
@@ -17,7 +17,7 @@ package com.vaadin.client.renderers; | |||
import com.google.gwt.dom.client.TableCellElement; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.widget.grid.RendererCellReference; | |||
/** | |||
@@ -97,7 +97,7 @@ public abstract class WidgetRenderer<T, W extends Widget> extends | |||
*/ | |||
protected static <W extends Widget> W getWidget(TableCellElement e, | |||
Class<W> klass) { | |||
W w = Util.findWidget(e.getFirstChildElement(), klass); | |||
W w = WidgetUtil.findWidget(e.getFirstChildElement(), klass); | |||
assert w == null || w.getElement() == e.getFirstChildElement() : "Widget not found inside cell"; | |||
return w; | |||
} |
@@ -32,7 +32,7 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
@@ -72,8 +72,8 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
// Event's reported target not always correct if event | |||
// capture is in use | |||
Element elementUnderMouse = Util.getElementUnderMouse(event | |||
.getNativeEvent()); | |||
Element elementUnderMouse = WidgetUtil | |||
.getElementUnderMouse(event.getNativeEvent()); | |||
if (lastMouseDownTarget != null | |||
&& elementUnderMouse == lastMouseDownTarget) { | |||
mouseUpPreviewMatched = true; | |||
@@ -171,7 +171,8 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
* When getting a mousedown event, we must detect where the | |||
* corresponding mouseup event if it's on a different part of the page. | |||
*/ | |||
lastMouseDownTarget = Util.getElementUnderMouse(event.getNativeEvent()); | |||
lastMouseDownTarget = WidgetUtil.getElementUnderMouse(event | |||
.getNativeEvent()); | |||
mouseUpPreviewMatched = false; | |||
mouseUpEventPreviewRegistration = Event | |||
.addNativePreviewHandler(mouseUpPreviewHandler); | |||
@@ -188,7 +189,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
if (hasEventListener() | |||
&& mouseUpPreviewMatched | |||
&& lastMouseDownTarget != null | |||
&& Util.getElementUnderMouse(event.getNativeEvent()) == lastMouseDownTarget | |||
&& WidgetUtil.getElementUnderMouse(event.getNativeEvent()) == lastMouseDownTarget | |||
&& shouldFireEvent(event)) { | |||
// "Click" with left, right or middle button | |||
fireClick(event.getNativeEvent()); |
@@ -32,6 +32,7 @@ import com.vaadin.client.TooltipInfo; | |||
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; | |||
@@ -89,7 +90,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector | |||
} catch (NoDataException e) { | |||
throw new IllegalStateException( | |||
"Default implementation of createWidget() does not work for " | |||
+ Util.getSimpleName(this) | |||
+ WidgetUtil.getSimpleName(this) | |||
+ ". This might be caused by explicitely using " | |||
+ "super.createWidget() or some unspecified " | |||
+ "problem with the widgetset compilation.", e); | |||
@@ -106,10 +107,10 @@ public abstract class AbstractComponentConnector extends AbstractConnector | |||
public Widget getWidget() { | |||
if (widget == null) { | |||
Profiler.enter("AbstractComponentConnector.createWidget for " | |||
+ Util.getSimpleName(this)); | |||
+ WidgetUtil.getSimpleName(this)); | |||
widget = createWidget(); | |||
Profiler.leave("AbstractComponentConnector.createWidget for " | |||
+ Util.getSimpleName(this)); | |||
+ WidgetUtil.getSimpleName(this)); | |||
} | |||
return widget; |
@@ -34,6 +34,7 @@ import com.vaadin.client.Profiler; | |||
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; | |||
@@ -120,11 +121,13 @@ public abstract class AbstractConnector implements ServerConnector, | |||
addStateChangeHandler(this); | |||
if (Profiler.isEnabled()) { | |||
Profiler.enter("AbstractConnector.init " + Util.getSimpleName(this)); | |||
Profiler.enter("AbstractConnector.init " | |||
+ WidgetUtil.getSimpleName(this)); | |||
} | |||
init(); | |||
if (Profiler.isEnabled()) { | |||
Profiler.leave("AbstractConnector.init " + Util.getSimpleName(this)); | |||
Profiler.leave("AbstractConnector.init " | |||
+ WidgetUtil.getSimpleName(this)); | |||
} | |||
Profiler.leave("AbstractConnector.doInit"); | |||
} | |||
@@ -214,8 +217,8 @@ public abstract class AbstractConnector implements ServerConnector, | |||
public void fireEvent(GwtEvent<?> event) { | |||
String profilerKey = null; | |||
if (Profiler.isEnabled()) { | |||
profilerKey = "Fire " + Util.getSimpleName(event) + " for " | |||
+ Util.getSimpleName(this); | |||
profilerKey = "Fire " + WidgetUtil.getSimpleName(event) + " for " | |||
+ WidgetUtil.getSimpleName(this); | |||
Profiler.enter(profilerKey); | |||
} | |||
if (handlerManager != null) { | |||
@@ -377,7 +380,7 @@ public abstract class AbstractConnector implements ServerConnector, | |||
} catch (NoDataException e) { | |||
throw new IllegalStateException( | |||
"There is no information about the state for " | |||
+ Util.getSimpleName(this) | |||
+ WidgetUtil.getSimpleName(this) | |||
+ ". Did you remember to compile the right widgetset?", | |||
e); | |||
} | |||
@@ -391,7 +394,7 @@ public abstract class AbstractConnector implements ServerConnector, | |||
} catch (NoDataException e) { | |||
throw new IllegalStateException( | |||
"There is no information about the state for " | |||
+ Util.getSimpleName(connector) | |||
+ WidgetUtil.getSimpleName(connector) | |||
+ ". Did you remember to compile the right widgetset?", | |||
e); | |||
} |
@@ -15,7 +15,7 @@ | |||
*/ | |||
package com.vaadin.client.ui; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.shared.communication.URLReference; | |||
import com.vaadin.shared.ui.AbstractMediaState; | |||
@@ -78,7 +78,7 @@ public abstract class MediaBaseConnector extends AbstractComponentConnector { | |||
if (altText == null || "".equals(altText)) { | |||
altText = getDefaultAltHtml(); | |||
} else if (!getState().htmlContentAllowed) { | |||
altText = Util.escapeHTML(altText); | |||
altText = WidgetUtil.escapeHTML(altText); | |||
} | |||
getWidget().setAltText(altText); | |||
} |
@@ -44,7 +44,7 @@ import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.StyleConstants; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; | |||
import com.vaadin.client.ui.VAbstractSplitPanel.SplitterMoveHandler.SplitterMoveEvent; | |||
@@ -577,7 +577,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
break; | |||
} | |||
// Only fire click event listeners if the splitter isn't moved | |||
if (Util.isTouchEvent(event) || !resized) { | |||
if (WidgetUtil.isTouchEvent(event) || !resized) { | |||
super.onBrowserEvent(event); | |||
} else if (DOM.eventGetType(event) == Event.ONMOUSEUP) { | |||
// Reset the resized flag after a mouseup has occured so the next | |||
@@ -596,8 +596,8 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
DOM.setCapture(getElement()); | |||
origX = DOM.getElementPropertyInt(splitter, "offsetLeft"); | |||
origY = DOM.getElementPropertyInt(splitter, "offsetTop"); | |||
origMouseX = Util.getTouchOrMouseClientX(event); | |||
origMouseY = Util.getTouchOrMouseClientY(event); | |||
origMouseX = WidgetUtil.getTouchOrMouseClientX(event); | |||
origMouseY = WidgetUtil.getTouchOrMouseClientY(event); | |||
event.stopPropagation(); | |||
event.preventDefault(); | |||
} | |||
@@ -606,12 +606,12 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
public void onMouseMove(Event event) { | |||
switch (orientation) { | |||
case HORIZONTAL: | |||
final int x = Util.getTouchOrMouseClientX(event); | |||
final int x = WidgetUtil.getTouchOrMouseClientX(event); | |||
onHorizontalMouseMove(x); | |||
break; | |||
case VERTICAL: | |||
default: | |||
final int y = Util.getTouchOrMouseClientY(event); | |||
final int y = WidgetUtil.getTouchOrMouseClientY(event); | |||
onVerticalMouseMove(y); | |||
break; | |||
} | |||
@@ -688,7 +688,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
DOM.releaseCapture(getElement()); | |||
hideDraggingCurtain(); | |||
resizing = false; | |||
if (!Util.isTouchEvent(event)) { | |||
if (!WidgetUtil.isTouchEvent(event)) { | |||
onMouseMove(event); | |||
} | |||
fireEvent(new SplitterMoveEvent(this)); |
@@ -29,7 +29,7 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VCaption; | |||
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; | |||
import com.vaadin.shared.ComponentConstants; | |||
@@ -203,7 +203,7 @@ public class VAccordion extends VTabsheetBase { | |||
} | |||
int captionWidth = caption.getRequiredWidth(); | |||
int padding = Util.measureHorizontalPaddingAndBorder( | |||
int padding = WidgetUtil.measureHorizontalPaddingAndBorder( | |||
caption.getElement(), 18); | |||
return captionWidth + padding; | |||
} |
@@ -30,6 +30,7 @@ import com.google.gwt.user.client.ui.FocusWidget; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
public class VButton extends FocusWidget implements ClickHandler { | |||
@@ -373,10 +374,10 @@ public class VButton extends FocusWidget implements ClickHandler { | |||
// Set (x,y) client coordinates to the middle of the button | |||
int x = getElement().getAbsoluteLeft() - getElement().getScrollLeft() | |||
- getElement().getOwnerDocument().getScrollLeft() | |||
+ Util.getRequiredWidth(getElement()) / 2; | |||
+ WidgetUtil.getRequiredWidth(getElement()) / 2; | |||
int y = getElement().getAbsoluteTop() - getElement().getScrollTop() | |||
- getElement().getOwnerDocument().getScrollTop() | |||
+ Util.getRequiredHeight(getElement()) / 2; | |||
+ WidgetUtil.getRequiredHeight(getElement()) / 2; | |||
NativeEvent evt = Document.get().createClickEvent(1, 0, 0, x, y, false, | |||
false, false, false); | |||
getElement().dispatchEvent(evt); |
@@ -54,7 +54,7 @@ import com.google.gwt.user.client.ui.ListBox; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.DateTimeService; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.shared.ui.datefield.Resolution; | |||
import com.vaadin.shared.util.SharedUtil; | |||
@@ -2065,7 +2065,7 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
return SUBPART_PREV_YEAR; | |||
} else if (contains(days, subElement)) { | |||
// Day, find out which dayOfMonth and use that as the identifier | |||
Day day = Util.findWidget(subElement, Day.class); | |||
Day day = WidgetUtil.findWidget(subElement, Day.class); | |||
if (day != null) { | |||
Date date = day.getDate(); | |||
int id = date.getDate(); |
@@ -51,7 +51,7 @@ import com.google.gwt.user.client.ui.PopupPanel; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.impl.FocusImpl; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
public class VContextMenu extends VOverlay implements SubPartAware { | |||
@@ -89,7 +89,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
addCloseHandler(new CloseHandler<PopupPanel>() { | |||
@Override | |||
public void onClose(CloseEvent<PopupPanel> event) { | |||
Element currentFocus = Util.getFocusedElement(); | |||
Element currentFocus = WidgetUtil.getFocusedElement(); | |||
if (focusedElement != null | |||
&& (currentFocus == null | |||
|| menu.getElement().isOrHasChild(currentFocus) || RootPanel | |||
@@ -137,11 +137,11 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
} | |||
// Attach onload listeners to all images | |||
Util.sinkOnloadForImages(menu.getElement()); | |||
WidgetUtil.sinkOnloadForImages(menu.getElement()); | |||
// Store the currently focused element, which will be re-focused when | |||
// context menu is closed | |||
focusedElement = Util.getFocusedElement(); | |||
focusedElement = WidgetUtil.getFocusedElement(); | |||
// reset height (if it has been previously set explicitly) | |||
setHeight(""); |
@@ -37,6 +37,7 @@ import com.vaadin.client.StyleConstants; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VCaption; | |||
import com.vaadin.client.VCaptionWrapper; | |||
import com.vaadin.client.WidgetUtil; | |||
/** | |||
* Custom Layout implements complex layout defined with HTML template. | |||
@@ -158,7 +159,8 @@ public class VCustomLayout extends ComplexPanel { | |||
// TODO prefix img src:s here with a regeps, cannot work further with IE | |||
String relImgPrefix = Util.escapeAttribute(themeUri + "/layouts/"); | |||
String relImgPrefix = WidgetUtil | |||
.escapeAttribute(themeUri + "/layouts/"); | |||
// prefix all relative image elements to point to theme dir with a | |||
// regexp search |
@@ -31,6 +31,7 @@ import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.embedded.EmbeddedConstants; | |||
public class VEmbedded extends HTML { | |||
@@ -83,8 +84,8 @@ public class VEmbedded extends HTML { | |||
*/ | |||
if (uidl.hasAttribute("classid")) { | |||
html.append("classid=\"" | |||
+ Util.escapeAttribute(uidl.getStringAttribute("classid")) | |||
+ "\" "); | |||
+ WidgetUtil.escapeAttribute(uidl | |||
.getStringAttribute("classid")) + "\" "); | |||
} else { | |||
html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); | |||
} | |||
@@ -99,8 +100,8 @@ public class VEmbedded extends HTML { | |||
*/ | |||
if (uidl.hasAttribute("codebase")) { | |||
html.append("codebase=\"" | |||
+ Util.escapeAttribute(uidl.getStringAttribute("codebase")) | |||
+ "\" "); | |||
+ WidgetUtil.escapeAttribute(uidl | |||
.getStringAttribute("codebase")) + "\" "); | |||
} else { | |||
html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); | |||
} | |||
@@ -111,29 +112,29 @@ public class VEmbedded extends HTML { | |||
String width = paintable.getState().width; | |||
// Add width and height | |||
html.append("width=\"" + Util.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + Util.escapeAttribute(height) + "\" "); | |||
html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + WidgetUtil.escapeAttribute(height) + "\" "); | |||
html.append("type=\"application/x-shockwave-flash\" "); | |||
// Codetype | |||
if (uidl.hasAttribute("codetype")) { | |||
html.append("codetype=\"" | |||
+ Util.escapeAttribute(uidl.getStringAttribute("codetype")) | |||
+ "\" "); | |||
+ WidgetUtil.escapeAttribute(uidl | |||
.getStringAttribute("codetype")) + "\" "); | |||
} | |||
// Standby | |||
if (uidl.hasAttribute("standby")) { | |||
html.append("standby=\"" | |||
+ Util.escapeAttribute(uidl.getStringAttribute("standby")) | |||
+ "\" "); | |||
+ WidgetUtil.escapeAttribute(uidl | |||
.getStringAttribute("standby")) + "\" "); | |||
} | |||
// Archive | |||
if (uidl.hasAttribute("archive")) { | |||
html.append("archive=\"" | |||
+ Util.escapeAttribute(uidl.getStringAttribute("archive")) | |||
+ "\" "); | |||
+ WidgetUtil.escapeAttribute(uidl | |||
.getStringAttribute("archive")) + "\" "); | |||
} | |||
// End object tag | |||
@@ -148,25 +149,25 @@ public class VEmbedded extends HTML { | |||
// Add parameters to OBJECT | |||
for (String name : parameters.keySet()) { | |||
html.append("<param "); | |||
html.append("name=\"" + Util.escapeAttribute(name) + "\" "); | |||
html.append("value=\"" + Util.escapeAttribute(parameters.get(name)) | |||
+ "\" "); | |||
html.append("name=\"" + WidgetUtil.escapeAttribute(name) + "\" "); | |||
html.append("value=\"" | |||
+ WidgetUtil.escapeAttribute(parameters.get(name)) + "\" "); | |||
html.append("/>"); | |||
} | |||
// Build inner EMBED tag | |||
html.append("<embed "); | |||
html.append("src=\"" + Util.escapeAttribute(getSrc(uidl, client)) | |||
html.append("src=\"" + WidgetUtil.escapeAttribute(getSrc(uidl, client)) | |||
+ "\" "); | |||
html.append("width=\"" + Util.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + Util.escapeAttribute(height) + "\" "); | |||
html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + WidgetUtil.escapeAttribute(height) + "\" "); | |||
html.append("type=\"application/x-shockwave-flash\" "); | |||
// Add the parameters to the Embed | |||
for (String name : parameters.keySet()) { | |||
html.append(Util.escapeAttribute(name)); | |||
html.append(WidgetUtil.escapeAttribute(name)); | |||
html.append("="); | |||
html.append("\"" + Util.escapeAttribute(parameters.get(name)) | |||
html.append("\"" + WidgetUtil.escapeAttribute(parameters.get(name)) | |||
+ "\""); | |||
} | |||
@@ -67,8 +67,8 @@ import com.vaadin.client.ComputedStyle; | |||
import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.aria.AriaHelper; | |||
import com.vaadin.client.ui.aria.HandlesAriaCaption; | |||
import com.vaadin.client.ui.aria.HandlesAriaInvalid; | |||
@@ -134,7 +134,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
// options and are not collapsed (#7506) | |||
content = " "; | |||
} else { | |||
content = Util.escapeHTML(caption); | |||
content = WidgetUtil.escapeHTML(caption); | |||
} | |||
sb.append("<span>" + content + "</span>"); | |||
return sb.toString(); | |||
@@ -599,8 +599,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
final int naturalMenuWidth = menuFirstChild.getOffsetWidth(); | |||
if (popupOuterPadding == -1) { | |||
popupOuterPadding = Util.measureHorizontalPaddingAndBorder( | |||
getElement(), 2); | |||
popupOuterPadding = WidgetUtil | |||
.measureHorizontalPaddingAndBorder(getElement(), 2); | |||
} | |||
if (naturalMenuWidth < desiredWidth) { | |||
@@ -657,7 +657,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
menu.setHeight(menuHeight + "px"); | |||
final int naturalMenuWidthPlusScrollBar = naturalMenuWidth | |||
+ Util.getNativeScrollbarSize(); | |||
+ WidgetUtil.getNativeScrollbarSize(); | |||
if (offsetWidth < naturalMenuWidthPlusScrollBar) { | |||
menu.setWidth(naturalMenuWidthPlusScrollBar + "px"); | |||
} | |||
@@ -818,7 +818,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
final MenuItem mi = new MenuItem(s.getDisplayString(), true, s); | |||
Roles.getListitemRole().set(mi.getElement()); | |||
Util.sinkOnloadForImages(mi.getElement()); | |||
WidgetUtil.sinkOnloadForImages(mi.getElement()); | |||
this.addItem(mi); | |||
if (s == currentSuggestion) { | |||
@@ -1069,7 +1069,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
* the end and the focus to the start. This makes Firefox work | |||
* the same way as other browsers (#13477) | |||
*/ | |||
Util.setSelectionRange(getElement(), pos, length, "backward"); | |||
WidgetUtil.setSelectionRange(getElement(), pos, length, | |||
"backward"); | |||
} else { | |||
/* | |||
@@ -1609,7 +1610,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
} | |||
private void forceReflow() { | |||
Util.setStyleTemporarily(tb.getElement(), "zoom", "1"); | |||
WidgetUtil.setStyleTemporarily(tb.getElement(), "zoom", "1"); | |||
} | |||
/** | |||
@@ -1621,7 +1622,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
int availableHeight = 0; | |||
availableHeight = getOffsetHeight(); | |||
int iconHeight = Util.getRequiredHeight(selectedItemIcon); | |||
int iconHeight = WidgetUtil.getRequiredHeight(selectedItemIcon); | |||
int marginTop = (availableHeight - iconHeight) / 2; | |||
selectedItemIcon.getElement().getStyle() | |||
.setMarginTop(marginTop, Unit.PX); | |||
@@ -1936,7 +1937,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
*/ | |||
public void updateSuggestionPopupMinWidth() { | |||
// used only to calculate minimum width | |||
String captions = Util.escapeHTML(inputPrompt); | |||
String captions = WidgetUtil.escapeHTML(inputPrompt); | |||
for (FilterSelectSuggestion suggestion : currentSuggestions) { | |||
// Collect captions so we can calculate minimum width for | |||
@@ -1944,7 +1945,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
if (captions.length() > 0) { | |||
captions += "|"; | |||
} | |||
captions += Util.escapeHTML(suggestion.getReplacementString()); | |||
captions += WidgetUtil | |||
.escapeHTML(suggestion.getReplacementString()); | |||
} | |||
// Calculate minimum textarea width | |||
@@ -2051,7 +2053,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
*/ | |||
preventNextBlurEventInIE = false; | |||
Element focusedElement = Util.getIEFocusedElement(); | |||
Element focusedElement = WidgetUtil.getFocusedElement(); | |||
if (getElement().isOrHasChild(focusedElement) | |||
|| suggestionPopup.getElement() | |||
.isOrHasChild(focusedElement)) { | |||
@@ -2129,7 +2131,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
* when the popup is used to view longer items than the text box is | |||
* wide. | |||
*/ | |||
int w = Util.getRequiredWidth(this); | |||
int w = WidgetUtil.getRequiredWidth(this); | |||
if ((!initDone || currentPage + 1 < 0) | |||
&& suggestionPopupMinWidth > w) { | |||
@@ -2150,9 +2152,9 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
// Use util.getRequiredWidth instead of getOffsetWidth here | |||
int iconWidth = selectedItemIcon == null ? 0 : Util | |||
int iconWidth = selectedItemIcon == null ? 0 : WidgetUtil | |||
.getRequiredWidth(selectedItemIcon); | |||
int buttonWidth = popupOpener == null ? 0 : Util | |||
int buttonWidth = popupOpener == null ? 0 : WidgetUtil | |||
.getRequiredWidth(popupOpener); | |||
/* |
@@ -19,7 +19,7 @@ import java.util.HashMap; | |||
import java.util.Map; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
public class VFlash extends HTML { | |||
@@ -156,7 +156,8 @@ public class VFlash extends HTML { | |||
* this by setting his own classid. | |||
*/ | |||
if (classId != null) { | |||
html.append("classid=\"" + Util.escapeAttribute(classId) + "\" "); | |||
html.append("classid=\"" + WidgetUtil.escapeAttribute(classId) | |||
+ "\" "); | |||
} else { | |||
html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "); | |||
} | |||
@@ -170,29 +171,33 @@ public class VFlash extends HTML { | |||
* codebase | |||
*/ | |||
if (codebase != null) { | |||
html.append("codebase=\"" + Util.escapeAttribute(codebase) + "\" "); | |||
html.append("codebase=\"" + WidgetUtil.escapeAttribute(codebase) | |||
+ "\" "); | |||
} else { | |||
html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "); | |||
} | |||
// Add width and height | |||
html.append("width=\"" + Util.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + Util.escapeAttribute(height) + "\" "); | |||
html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + WidgetUtil.escapeAttribute(height) + "\" "); | |||
html.append("type=\"application/x-shockwave-flash\" "); | |||
// Codetype | |||
if (codetype != null) { | |||
html.append("codetype=\"" + Util.escapeAttribute(codetype) + "\" "); | |||
html.append("codetype=\"" + WidgetUtil.escapeAttribute(codetype) | |||
+ "\" "); | |||
} | |||
// Standby | |||
if (standby != null) { | |||
html.append("standby=\"" + Util.escapeAttribute(standby) + "\" "); | |||
html.append("standby=\"" + WidgetUtil.escapeAttribute(standby) | |||
+ "\" "); | |||
} | |||
// Archive | |||
if (archive != null) { | |||
html.append("archive=\"" + Util.escapeAttribute(archive) + "\" "); | |||
html.append("archive=\"" + WidgetUtil.escapeAttribute(archive) | |||
+ "\" "); | |||
} | |||
// End object tag | |||
@@ -206,25 +211,25 @@ public class VFlash extends HTML { | |||
// Add parameters to OBJECT | |||
for (String name : embedParams.keySet()) { | |||
html.append("<param "); | |||
html.append("name=\"" + Util.escapeAttribute(name) + "\" "); | |||
html.append("name=\"" + WidgetUtil.escapeAttribute(name) + "\" "); | |||
html.append("value=\"" | |||
+ Util.escapeAttribute(embedParams.get(name)) + "\" "); | |||
+ WidgetUtil.escapeAttribute(embedParams.get(name)) + "\" "); | |||
html.append("/>"); | |||
} | |||
// Build inner EMBED tag | |||
html.append("<embed "); | |||
html.append("src=\"" + Util.escapeAttribute(source) + "\" "); | |||
html.append("width=\"" + Util.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + Util.escapeAttribute(height) + "\" "); | |||
html.append("src=\"" + WidgetUtil.escapeAttribute(source) + "\" "); | |||
html.append("width=\"" + WidgetUtil.escapeAttribute(width) + "\" "); | |||
html.append("height=\"" + WidgetUtil.escapeAttribute(height) + "\" "); | |||
html.append("type=\"application/x-shockwave-flash\" "); | |||
// Add the parameters to the Embed | |||
for (String name : embedParams.keySet()) { | |||
html.append(Util.escapeAttribute(name)); | |||
html.append(WidgetUtil.escapeAttribute(name)); | |||
html.append("="); | |||
html.append("\"" + Util.escapeAttribute(embedParams.get(name)) | |||
+ "\""); | |||
html.append("\"" | |||
+ WidgetUtil.escapeAttribute(embedParams.get(name)) + "\""); | |||
} | |||
// End embed tag |
@@ -21,6 +21,7 @@ import com.google.gwt.user.client.ui.HTML; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VTooltip; | |||
import com.vaadin.client.WidgetUtil; | |||
public class VLabel extends HTML { | |||
@@ -63,7 +64,7 @@ public class VLabel extends HTML { | |||
if (BrowserInfo.get().isIE8()) { | |||
// #3983 - IE8 incorrectly replaces \n with <br> so we do the | |||
// escaping manually and set as HTML | |||
super.setHTML(Util.escapeHTML(text)); | |||
super.setHTML(WidgetUtil.escapeHTML(text)); | |||
} else { | |||
super.setText(text); | |||
} |
@@ -50,6 +50,7 @@ import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.menubar.MenuBarConstants; | |||
public class VMenuBar extends SimpleFocusablePanel implements | |||
@@ -234,7 +235,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
} | |||
String itemText = item.getStringAttribute("text"); | |||
if (!htmlContentAllowed) { | |||
itemText = Util.escapeHTML(itemText); | |||
itemText = WidgetUtil.escapeHTML(itemText); | |||
} | |||
itemHTML.append(itemText); | |||
itemHTML.append("</span>"); | |||
@@ -658,7 +659,8 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
// Make room for the scroll bar by adjusting the width of the | |||
// popup | |||
style.setWidth(contentWidth + Util.getNativeScrollbarSize(), | |||
style.setWidth( | |||
contentWidth + WidgetUtil.getNativeScrollbarSize(), | |||
Unit.PX); | |||
popup.positionOrSizeUpdated(); | |||
} | |||
@@ -983,7 +985,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
// Sink the onload event for any icons. The onload | |||
// events are handled by the parent VMenuBar. | |||
Util.sinkOnloadForImages(getElement()); | |||
WidgetUtil.sinkOnloadForImages(getElement()); | |||
} | |||
@Override | |||
@@ -993,7 +995,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
@Override | |||
public void setText(String text) { | |||
setHTML(Util.escapeHTML(text)); | |||
setHTML(WidgetUtil.escapeHTML(text)); | |||
} | |||
public void setEnabled(boolean enabled) { |
@@ -37,7 +37,7 @@ import com.vaadin.client.AnimationUtil.AnimationEndListener; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.aria.AriaHelper; | |||
import com.vaadin.shared.Position; | |||
import com.vaadin.shared.ui.ui.NotificationRole; | |||
@@ -258,7 +258,7 @@ public class VNotification extends VOverlay { | |||
* nudge (#8551) | |||
*/ | |||
if (BrowserInfo.get().isAndroid()) { | |||
Util.setStyleTemporarily(getElement(), "display", "none"); | |||
WidgetUtil.setStyleTemporarily(getElement(), "display", "none"); | |||
} | |||
} | |||
@@ -476,7 +476,7 @@ public class VNotification extends VOverlay { | |||
String caption = notification | |||
.getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION); | |||
if (onlyPlainText) { | |||
caption = Util.escapeHTML(caption); | |||
caption = WidgetUtil.escapeHTML(caption); | |||
caption = caption.replaceAll("\\n", "<br />"); | |||
} | |||
html += "<h1>" + caption + "</h1>"; | |||
@@ -486,7 +486,7 @@ public class VNotification extends VOverlay { | |||
String message = notification | |||
.getStringAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE); | |||
if (onlyPlainText) { | |||
message = Util.escapeHTML(message); | |||
message = WidgetUtil.escapeHTML(message); | |||
message = message.replaceAll("\\n", "<br />"); | |||
} | |||
html += "<p>" + message + "</p>"; |
@@ -44,6 +44,7 @@ import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.EventId; | |||
import com.vaadin.shared.ui.optiongroup.OptionGroupConstants; | |||
@@ -136,7 +137,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, | |||
String itemHtml = opUidl.getStringAttribute("caption"); | |||
if (!htmlContentAllowed) { | |||
itemHtml = Util.escapeHTML(itemHtml); | |||
itemHtml = WidgetUtil.escapeHTML(itemHtml); | |||
} | |||
String iconUrl = opUidl.getStringAttribute("icon"); | |||
@@ -160,7 +161,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, | |||
op.setStyleName("v-radiobutton"); | |||
} | |||
if (iconUrl != null && iconUrl.length() != 0) { | |||
Util.sinkOnloadForImages(op.getElement()); | |||
WidgetUtil.sinkOnloadForImages(op.getElement()); | |||
op.addHandler(iconLoadHandler, LoadEvent.getType()); | |||
} | |||
@@ -44,6 +44,7 @@ import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ComputedStyle; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
/** | |||
* <p> | |||
@@ -672,7 +673,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
// IE9 and IE10 have a bug, when resize an a element with box-shadow. | |||
// IE9 and IE10 need explicit update to remove extra box-shadows | |||
if (BrowserInfo.get().isIE9() || BrowserInfo.get().isIE10()) { | |||
Util.forceIERedraw(getElement()); | |||
WidgetUtil.forceIERedraw(getElement()); | |||
} | |||
} | |||
@@ -33,7 +33,14 @@ import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.*; | |||
import com.google.gwt.user.client.ui.Focusable; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.HasEnabled; | |||
import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.Label; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.DeferredWorker; |
@@ -91,6 +91,7 @@ import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.VTooltip; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow; | |||
import com.vaadin.client.ui.dd.DDUtil; | |||
import com.vaadin.client.ui.dd.VAbstractDropHandler; | |||
@@ -510,8 +511,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
@Override | |||
public void showContextMenu(Event event) { | |||
int left = Util.getTouchOrMouseClientX(event); | |||
int top = Util.getTouchOrMouseClientY(event); | |||
int left = WidgetUtil.getTouchOrMouseClientX(event); | |||
int top = WidgetUtil.getTouchOrMouseClientY(event); | |||
boolean menuShown = handleBodyContextMenu(left, top); | |||
if (menuShown) { | |||
event.stopPropagation(); | |||
@@ -796,8 +797,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
// Event's reported target not always correct if event | |||
// capture is in use | |||
Element elementUnderMouse = Util.getElementUnderMouse(event | |||
.getNativeEvent()); | |||
Element elementUnderMouse = WidgetUtil | |||
.getElementUnderMouse(event.getNativeEvent()); | |||
if (lastMouseDownTarget != null | |||
&& lastMouseDownTarget.isOrHasChild(elementUnderMouse)) { | |||
mouseUpPreviewMatched = true; | |||
@@ -2244,7 +2245,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
int w = total; | |||
w += scrollBody.getCellExtraWidth() * visibleColOrder.length; | |||
if (willHaveScrollbarz) { | |||
w += Util.getNativeScrollbarSize(); | |||
w += WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
setContentWidth(w); | |||
} | |||
@@ -2257,7 +2258,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
availW -= scrollBody.getCellExtraWidth() * visibleColOrder.length; | |||
if (willHaveScrollbarz) { | |||
availW -= Util.getNativeScrollbarSize(); | |||
availW -= WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
// TODO refactor this code to be the same as in resize timer | |||
@@ -2429,10 +2430,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
} | |||
boolean needsSpaceForHorizontalSrollbar = (total > availW); | |||
if (needsSpaceForHorizontalSrollbar) { | |||
bodyHeight += Util.getNativeScrollbarSize(); | |||
bodyHeight += WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
scrollBodyPanel.setHeight(bodyHeight + "px"); | |||
Util.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); | |||
WidgetUtil.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); | |||
} | |||
isNewBody = false; | |||
@@ -2463,7 +2464,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* Ensures the column alignments are correct at initial loading. <br/> | |||
* (child components widths are correct) | |||
*/ | |||
Util.runWebkitOverflowAutoFixDeferred(scrollBodyPanel.getElement()); | |||
WidgetUtil.runWebkitOverflowAutoFixDeferred(scrollBodyPanel | |||
.getElement()); | |||
hadScrollBars = willHaveScrollbarz; | |||
} | |||
@@ -3118,7 +3120,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
case Event.ONTOUCHSTART: | |||
case Event.ONMOUSEDOWN: | |||
if (columnReordering | |||
&& Util.isTouchEventOrLeftMouseButton(event)) { | |||
&& WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
if (event.getTypeInt() == Event.ONTOUCHSTART) { | |||
/* | |||
* prevent using this event in e.g. scrolling | |||
@@ -3138,11 +3140,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
case Event.ONTOUCHEND: | |||
case Event.ONTOUCHCANCEL: | |||
if (columnReordering | |||
&& Util.isTouchEventOrLeftMouseButton(event)) { | |||
&& WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
dragging = false; | |||
DOM.releaseCapture(getElement()); | |||
if (Util.isTouchEvent(event)) { | |||
if (WidgetUtil.isTouchEvent(event)) { | |||
/* | |||
* Prevent using in e.g. scrolling and prevent generated | |||
* events. | |||
@@ -3168,7 +3170,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
if (!moved) { | |||
// mouse event was a click to header -> sort column | |||
if (sortable && Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (sortable | |||
&& WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
if (sortColumn.equals(cid)) { | |||
// just toggle order | |||
client.updateVariable(paintableId, "sortascending", | |||
@@ -3190,7 +3193,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
rowRequestHandler.run(); // run immediately | |||
} | |||
fireHeaderClickedEvent(event); | |||
if (Util.isTouchEvent(event)) { | |||
if (WidgetUtil.isTouchEvent(event)) { | |||
/* | |||
* Prevent using in e.g. scrolling and prevent generated | |||
* events. | |||
@@ -3206,7 +3209,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
break; | |||
case Event.ONTOUCHMOVE: | |||
case Event.ONMOUSEMOVE: | |||
if (dragging && Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (dragging && WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
if (event.getTypeInt() == Event.ONTOUCHMOVE) { | |||
/* | |||
* prevent using this event in e.g. scrolling | |||
@@ -3218,7 +3221,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
moved = true; | |||
} | |||
final int clientX = Util.getTouchOrMouseClientX(event); | |||
final int clientX = WidgetUtil | |||
.getTouchOrMouseClientX(event); | |||
final int x = clientX + tHead.hTableWrapper.getScrollLeft(); | |||
int slotX = headerX; | |||
closestSlot = colIndex; | |||
@@ -3256,7 +3260,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
private void onResizeEvent(Event event) { | |||
switch (DOM.eventGetType(event)) { | |||
case Event.ONMOUSEDOWN: | |||
if (!Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
return; | |||
} | |||
isResizing = true; | |||
@@ -3267,7 +3271,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
DOM.eventPreventDefault(event); | |||
break; | |||
case Event.ONMOUSEUP: | |||
if (!Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
return; | |||
} | |||
isResizing = false; | |||
@@ -3284,7 +3288,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
fireColumnResizeEvent(cid, originalWidth, getColWidth(cid)); | |||
break; | |||
case Event.ONMOUSEMOVE: | |||
if (!Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
return; | |||
} | |||
if (isResizing) { | |||
@@ -4722,7 +4726,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
*/ | |||
public int getRequiredHeight() { | |||
return preSpacer.getOffsetHeight() + postSpacer.getOffsetHeight() | |||
+ Util.getRequiredHeight(table); | |||
+ WidgetUtil.getRequiredHeight(table); | |||
} | |||
private void constructDOM() { | |||
@@ -5936,8 +5940,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
if (!BrowserInfo.get().isAndroid()) { | |||
event.preventDefault(); | |||
event.stopPropagation(); | |||
Util.simulateClickFromTouchEvent(touchStart, | |||
this); | |||
WidgetUtil.simulateClickFromTouchEvent( | |||
touchStart, this); | |||
} | |||
touchStart = null; | |||
} | |||
@@ -5996,7 +6000,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
*/ | |||
if (mouseUpPreviewMatched | |||
&& lastMouseDownTarget != null | |||
&& lastMouseDownTarget == getElementTdOrTr(Util | |||
&& lastMouseDownTarget == getElementTdOrTr(WidgetUtil | |||
.getElementUnderMouse(event))) { | |||
// "Click" with left, right or middle button | |||
@@ -6123,7 +6127,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* Touch has not been handled as neither context or | |||
* drag start, handle it as a click. | |||
*/ | |||
Util.simulateClickFromTouchEvent(touchStart, this); | |||
WidgetUtil.simulateClickFromTouchEvent(touchStart, | |||
this); | |||
touchStart = null; | |||
} | |||
touchContextProvider.cancel(); | |||
@@ -6225,7 +6230,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* the corresponding mouseup event if it's on a | |||
* different part of the page. | |||
*/ | |||
lastMouseDownTarget = getElementTdOrTr(Util | |||
lastMouseDownTarget = getElementTdOrTr(WidgetUtil | |||
.getElementUnderMouse(event)); | |||
mouseUpPreviewMatched = false; | |||
mouseUpEventPreviewRegistration = Event | |||
@@ -6370,7 +6375,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
private Element getElementTdOrTr(Element element) { | |||
Widget widget = Util.findWidget(element, null); | |||
Widget widget = WidgetUtil.findWidget(element, null); | |||
if (widget != this) { | |||
/* | |||
@@ -6397,9 +6402,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
public void showContextMenu(Event event) { | |||
if (enabled && actionKeys != null) { | |||
// Show context menu if there are registered action handlers | |||
int left = Util.getTouchOrMouseClientX(event) | |||
int left = WidgetUtil.getTouchOrMouseClientX(event) | |||
+ Window.getScrollLeft(); | |||
int top = Util.getTouchOrMouseClientY(event) | |||
int top = WidgetUtil.getTouchOrMouseClientY(event) | |||
+ Window.getScrollTop(); | |||
showContextMenu(left, top); | |||
} | |||
@@ -6678,8 +6683,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
.getVisibleCellCount(); ix++) { | |||
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth(); | |||
} | |||
Util.setWidthExcludingPaddingAndBorder((Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
WidgetUtil.setWidthExcludingPaddingAndBorder( | |||
(Element) getElement().getChild(cellIx), spanWidth, 13, | |||
false); | |||
} | |||
} | |||
@@ -6869,7 +6875,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
int totalExtraWidth = scrollBody.getCellExtraWidth() | |||
* visibleCellCount; | |||
if (willHaveScrollbars()) { | |||
totalExtraWidth += Util.getNativeScrollbarSize(); | |||
totalExtraWidth += WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
availW -= totalExtraWidth; | |||
int forceScrollBodyWidth = -1; | |||
@@ -6999,7 +7005,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
int bodyHeight = scrollBody.getRequiredHeight(); | |||
boolean needsSpaceForHorizontalScrollbar = (availW < usedMinimumWidth); | |||
if (needsSpaceForHorizontalScrollbar) { | |||
bodyHeight += Util.getNativeScrollbarSize(); | |||
bodyHeight += WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
int heightBefore = getOffsetHeight(); | |||
scrollBodyPanel.setHeight(bodyHeight + "px"); | |||
@@ -7044,7 +7050,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
*/ | |||
private int getBorderWidth() { | |||
if (borderWidth < 0) { | |||
borderWidth = Util.measureHorizontalPaddingAndBorder( | |||
borderWidth = WidgetUtil.measureHorizontalPaddingAndBorder( | |||
scrollBodyPanel.getElement(), 2); | |||
if (borderWidth < 0) { | |||
borderWidth = 0; | |||
@@ -7373,7 +7379,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
Class<? extends Widget> clazz = getRowClass(); | |||
VScrollTableRow row = null; | |||
if (clazz != null) { | |||
row = Util.findWidget(elementOver, clazz); | |||
row = WidgetUtil.findWidget(elementOver, clazz); | |||
} | |||
if (row != null) { | |||
dropDetails.overkey = row.rowKey; | |||
@@ -7565,7 +7571,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* FIXME The next line doesn't always do what expected, because if the | |||
* row is not in the DOM it won't scroll to it. | |||
*/ | |||
Util.scrollIntoViewVertically(row.getElement()); | |||
WidgetUtil.scrollIntoViewVertically(row.getElement()); | |||
} | |||
/** | |||
@@ -7866,7 +7872,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* ...and sometimes it sends blur events even though the focus | |||
* handler is still active. (#10464) | |||
*/ | |||
Element focusedElement = Util.getIEFocusedElement(); | |||
Element focusedElement = WidgetUtil.getFocusedElement(); | |||
if (Util.getConnectorForElement(client, getParent(), focusedElement) == this | |||
&& focusedElement != null | |||
&& focusedElement != scrollBodyPanel.getFocusElement()) { | |||
@@ -8175,7 +8181,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
@Override | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
Widget widget = Util.findWidget(subElement, null); | |||
Widget widget = WidgetUtil.findWidget(subElement, null); | |||
if (widget instanceof HeaderCell) { | |||
return SUBPART_HEADER + "[" + tHead.visibleCells.indexOf(widget) | |||
+ "]"; |
@@ -34,7 +34,7 @@ import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.HasValue; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.slider.SliderOrientation; | |||
public class VSlider extends SimpleFocusablePanel implements Field, | |||
@@ -299,7 +299,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) { | |||
feedbackPopup.show(); | |||
} | |||
if (Util.isTouchEvent(event)) { | |||
if (WidgetUtil.isTouchEvent(event)) { | |||
event.preventDefault(); // avoid simulated events | |||
event.stopPropagation(); | |||
} | |||
@@ -423,9 +423,9 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
*/ | |||
protected int getEventPosition(Event event) { | |||
if (isVertical()) { | |||
return Util.getTouchOrMouseClientY(event); | |||
return WidgetUtil.getTouchOrMouseClientY(event); | |||
} else { | |||
return Util.getTouchOrMouseClientX(event); | |||
return WidgetUtil.getTouchOrMouseClientX(event); | |||
} | |||
} | |||
@@ -63,7 +63,7 @@ import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VCaption; | |||
import com.vaadin.client.VTooltip; | |||
import com.vaadin.client.ui.aria.AriaHelper; | |||
@@ -415,7 +415,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware | |||
public int getRequiredWidth() { | |||
int width = super.getRequiredWidth(); | |||
if (closeButton != null) { | |||
width += Util.getRequiredWidth(closeButton); | |||
width += WidgetUtil.getRequiredWidth(closeButton); | |||
} | |||
return width; | |||
} | |||
@@ -1330,7 +1330,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public int getContentAreaBorderWidth() { | |||
return Util.measureHorizontalBorder(contentNode); | |||
return WidgetUtil.measureHorizontalBorder(contentNode); | |||
} | |||
@Override |
@@ -32,7 +32,7 @@ import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.dd.DragImageModifier; | |||
/** | |||
@@ -310,7 +310,7 @@ public class VTextArea extends VTextField implements DragImageModifier { | |||
// and reattach the whole TextArea. | |||
// Webkit fails to properly reflow the text when enabling wrapping, | |||
// same workaround | |||
Util.detachAttach(getElement()); | |||
WidgetUtil.detachAttach(getElement()); | |||
} | |||
this.wordwrap = wordwrap; | |||
} |
@@ -34,7 +34,7 @@ import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.TextBoxBase; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.EventId; | |||
import com.vaadin.shared.ui.textfield.TextFieldConstants; | |||
@@ -422,7 +422,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
* @return true iff the value was updated | |||
*/ | |||
protected boolean updateCursorPosition() { | |||
if (Util.isAttachedAndDisplayed(this)) { | |||
if (WidgetUtil.isAttachedAndDisplayed(this)) { | |||
int cursorPos = getCursorPos(); | |||
if (lastCursorPos != cursorPos) { | |||
client.updateVariable(paintableId, |
@@ -60,6 +60,7 @@ import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.MouseEventDetailsBuilder; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.aria.AriaHelper; | |||
import com.vaadin.client.ui.aria.HandlesAriaCaption; | |||
import com.vaadin.client.ui.dd.DDUtil; | |||
@@ -346,7 +347,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
} | |||
private String findCurrentMouseOverKey(Element elementOver) { | |||
TreeNode treeNode = Util.findWidget(elementOver, TreeNode.class); | |||
TreeNode treeNode = WidgetUtil.findWidget(elementOver, TreeNode.class); | |||
return treeNode == null ? null : treeNode.key; | |||
} | |||
@@ -1132,7 +1133,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
* Scrolls the caption into view | |||
*/ | |||
public void scrollIntoView() { | |||
Util.scrollIntoViewVertically(nodeCaptionDiv); | |||
WidgetUtil.scrollIntoViewVertically(nodeCaptionDiv); | |||
} | |||
public void setIcon(String iconUrl, String altText) { | |||
@@ -2143,7 +2144,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
return "fe"; | |||
} | |||
TreeNode treeNode = Util.findWidget(subElement, TreeNode.class); | |||
TreeNode treeNode = WidgetUtil.findWidget(subElement, TreeNode.class); | |||
if (treeNode == null) { | |||
// Did not click on a node, let somebody else take care of the | |||
// locator string |
@@ -37,7 +37,7 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ComputedStyle; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.VTreeTable.VTreeTableScrollBody.VTreeTableRow; | |||
public class VTreeTable extends VScrollTable { | |||
@@ -418,8 +418,9 @@ public class VTreeTable extends VScrollTable { | |||
.getVisibleCellCount(); ix++) { | |||
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth(); | |||
} | |||
Util.setWidthExcludingPaddingAndBorder((Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
WidgetUtil.setWidthExcludingPaddingAndBorder( | |||
(Element) getElement().getChild(cellIx), spanWidth, 13, | |||
false); | |||
} | |||
} | |||
@@ -39,7 +39,7 @@ import com.google.gwt.user.client.ui.ListBox; | |||
import com.google.gwt.user.client.ui.Panel; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants; | |||
public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
@@ -352,7 +352,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public void setInternalHeights() { | |||
int captionHeight = Util.getRequiredHeight(captionWrapper); | |||
int captionHeight = WidgetUtil.getRequiredHeight(captionWrapper); | |||
int totalHeight = getOffsetHeight(); | |||
String selectHeight = (totalHeight - captionHeight) + "px"; | |||
@@ -394,10 +394,10 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public void setInternalWidths() { | |||
getElement().getStyle().setPosition(Position.RELATIVE); | |||
int bordersAndPaddings = Util.measureHorizontalPaddingAndBorder( | |||
int bordersAndPaddings = WidgetUtil.measureHorizontalPaddingAndBorder( | |||
buttons.getElement(), 0); | |||
int buttonWidth = Util.getRequiredWidth(buttons); | |||
int buttonWidth = WidgetUtil.getRequiredWidth(buttons); | |||
int totalWidth = getOffsetWidth(); | |||
int spaceForSelect = (totalWidth - buttonWidth - bordersAndPaddings) / 2; | |||
@@ -609,14 +609,14 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
if (options.getElement() == subElement) { | |||
return SUBPART_OPTION_SELECT; | |||
} else { | |||
int idx = Util.getChildElementIndex(subElement); | |||
int idx = WidgetUtil.getChildElementIndex(subElement); | |||
return SUBPART_OPTION_SELECT_ITEM + idx; | |||
} | |||
} else if (selections.getElement().isOrHasChild(subElement)) { | |||
if (selections.getElement() == subElement) { | |||
return SUBPART_SELECTION_SELECT; | |||
} else { | |||
int idx = Util.getChildElementIndex(subElement); | |||
int idx = WidgetUtil.getChildElementIndex(subElement); | |||
return SUBPART_SELECTION_SELECT_ITEM + idx; | |||
} | |||
} else if (add.getElement().isOrHasChild(subElement)) { |
@@ -44,7 +44,7 @@ import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; | |||
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; | |||
@@ -501,7 +501,7 @@ public class VUI extends SimplePanel implements ResizeHandler, | |||
* @param focusedElement | |||
*/ | |||
public void storeFocus() { | |||
storedFocus = Util.getFocusedElement(); | |||
storedFocus = WidgetUtil.getFocusedElement(); | |||
} | |||
/** |
@@ -16,7 +16,7 @@ | |||
package com.vaadin.client.ui; | |||
import static com.vaadin.client.Util.isFocusedElementEditable; | |||
import static com.vaadin.client.WidgetUtil.isFocusedElementEditable; | |||
import java.util.ArrayList; | |||
import java.util.Arrays; | |||
@@ -62,7 +62,7 @@ import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorMap; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.debug.internal.VDebugWindow; | |||
import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; | |||
import com.vaadin.client.ui.aria.AriaHelper; | |||
@@ -581,7 +581,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
* ticket #11994 which was changing the size to 110% was replaced | |||
* with this due to ticket #12943 | |||
*/ | |||
Util.runWebkitOverflowAutoFix(contents.getFirstChildElement()); | |||
WidgetUtil | |||
.runWebkitOverflowAutoFix(contents.getFirstChildElement()); | |||
} | |||
} | |||
@@ -878,7 +879,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
public void setCaption(String c, String iconURL, boolean asHtml) { | |||
String html = c; | |||
if (!asHtml) { | |||
c = Util.escapeHTML(c); | |||
c = WidgetUtil.escapeHTML(c); | |||
} | |||
// Provide information to assistive device users that a sub window was | |||
@@ -1038,7 +1039,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
} | |||
private void onResizeEvent(Event event) { | |||
if (resizable && Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (resizable && WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
switch (event.getTypeInt()) { | |||
case Event.ONMOUSEDOWN: | |||
case Event.ONTOUCHSTART: | |||
@@ -1050,8 +1051,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
resizeBox.getStyle().setVisibility(Visibility.HIDDEN); | |||
} | |||
resizing = true; | |||
startX = Util.getTouchOrMouseClientX(event); | |||
startY = Util.getTouchOrMouseClientY(event); | |||
startX = WidgetUtil.getTouchOrMouseClientX(event); | |||
startY = WidgetUtil.getTouchOrMouseClientY(event); | |||
origW = getElement().getOffsetWidth(); | |||
origH = getElement().getOffsetHeight(); | |||
DOM.setCapture(getElement()); | |||
@@ -1117,8 +1118,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
return; | |||
} | |||
int w = Util.getTouchOrMouseClientX(event) - startX + origW; | |||
int h = Util.getTouchOrMouseClientY(event) - startY + origH; | |||
int w = WidgetUtil.getTouchOrMouseClientX(event) - startX + origW; | |||
int h = WidgetUtil.getTouchOrMouseClientY(event) - startY + origH; | |||
w = Math.max(w, getMinWidth()); | |||
h = Math.max(h, getMinHeight()); | |||
@@ -1181,7 +1182,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
} | |||
private void onDragEvent(Event event) { | |||
if (!Util.isTouchEventOrLeftMouseButton(event)) { | |||
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) { | |||
return; | |||
} | |||
@@ -1216,9 +1217,9 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
centered = false; | |||
if (cursorInsideBrowserContentArea(event)) { | |||
// Only drag while cursor is inside the browser client area | |||
final int x = Util.getTouchOrMouseClientX(event) - startX | |||
final int x = WidgetUtil.getTouchOrMouseClientX(event) - startX | |||
+ origX; | |||
final int y = Util.getTouchOrMouseClientY(event) - startY | |||
final int y = WidgetUtil.getTouchOrMouseClientY(event) - startY | |||
+ origY; | |||
setPopupPosition(x, y); | |||
} | |||
@@ -1230,8 +1231,8 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
if (draggable) { | |||
showDraggingCurtain(); | |||
dragging = true; | |||
startX = Util.getTouchOrMouseClientX(event); | |||
startY = Util.getTouchOrMouseClientY(event); | |||
startX = WidgetUtil.getTouchOrMouseClientX(event); | |||
startY = WidgetUtil.getTouchOrMouseClientY(event); | |||
origX = DOM.getAbsoluteLeft(getElement()); | |||
origY = DOM.getAbsoluteTop(getElement()); | |||
DOM.setCapture(getElement()); | |||
@@ -1279,7 +1280,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, | |||
if (!DOM.isOrHasChild(getTopmostWindow().getElement(), target)) { | |||
// not within the modal window, but let's see if it's in the | |||
// debug window | |||
Widget w = Util.findWidget(target, null); | |||
Widget w = WidgetUtil.findWidget(target, null); | |||
while (w != null) { | |||
if (w instanceof VDebugWindow) { | |||
return true; // allow debug-window clicks |
@@ -17,7 +17,7 @@ package com.vaadin.client.ui.accordion; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorHierarchyChangeEvent; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.SimpleManagedLayout; | |||
import com.vaadin.client.ui.VAccordion; | |||
@@ -106,7 +106,8 @@ public class AccordionConnector extends TabsheetBaseConnector implements | |||
usedPixels += item.getCaptionHeight(); | |||
} else { | |||
// This includes the captionNode borders | |||
usedPixels += Util.getRequiredHeight(item.getElement()); | |||
usedPixels += WidgetUtil.getRequiredHeight(item | |||
.getElement()); | |||
} | |||
} | |||
int rootElementInnerHeight = getLayoutManager().getInnerHeight( |
@@ -35,7 +35,7 @@ import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.Paintable; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.communication.RpcProxy; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
@@ -420,7 +420,7 @@ public class CalendarConnector extends AbstractComponentConnector implements | |||
@Override | |||
public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { | |||
TooltipInfo tooltipInfo = null; | |||
Widget w = Util.findWidget(element, null); | |||
Widget w = WidgetUtil.findWidget(element, null); | |||
if (w instanceof HasTooltipKey) { | |||
tooltipInfo = GWT.create(TooltipInfo.class); | |||
String title = tooltips.get(((HasTooltipKey) w).getTooltipKey()); |
@@ -43,7 +43,7 @@ import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
public class DateCell extends FocusableComplexPanel implements | |||
MouseDownHandler, MouseMoveHandler, MouseUpHandler, KeyDownHandler, | |||
@@ -201,7 +201,7 @@ public class DateCell extends FocusableComplexPanel implements | |||
addStyleDependentName("Hsized"); | |||
width = getOffsetWidth() | |||
- Util.measureHorizontalBorder(getElement()); | |||
- WidgetUtil.measureHorizontalBorder(getElement()); | |||
// Update moveWidth for any DateCellDayEvent child | |||
updateEventCellsWidth(); | |||
recalculateEventWidths(); | |||
@@ -338,7 +338,7 @@ public class DateCell extends FocusableComplexPanel implements | |||
} | |||
public int getSlotBorder() { | |||
return Util.measureVerticalBorder(slotElements[0]); | |||
return WidgetUtil.measureVerticalBorder(slotElements[0]); | |||
} | |||
private void drawDayEvents(List<DateCellGroup> groups) { |
@@ -23,7 +23,7 @@ import com.google.gwt.event.dom.client.MouseUpEvent; | |||
import com.google.gwt.event.dom.client.MouseUpHandler; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.VCalendar; | |||
/** | |||
@@ -48,7 +48,7 @@ public class DateCellContainer extends FlowPanel implements MouseDownHandler, | |||
public static int measureBorderWidth(DateCellContainer dc) { | |||
if (borderWidth == -1) { | |||
borderWidth = Util.measureHorizontalBorder(dc.getElement()); | |||
borderWidth = WidgetUtil.measureHorizontalBorder(dc.getElement()); | |||
} | |||
return borderWidth; | |||
} |
@@ -41,7 +41,7 @@ import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.HorizontalPanel; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.calendar.DateConstants; | |||
/** | |||
@@ -184,7 +184,8 @@ public class DateCellDayEvent extends FocusableHTML implements | |||
*/ | |||
private void updateCaptions(boolean bigMode) { | |||
String innerHtml; | |||
String escapedCaption = Util.escapeHTML(calendarEvent.getCaption()); | |||
String escapedCaption = WidgetUtil.escapeHTML(calendarEvent | |||
.getCaption()); | |||
String timeAsText = calendarEvent.getTimeAsText(); | |||
if (bigMode) { | |||
innerHtml = "<span>" + timeAsText + "</span><br />" |
@@ -31,7 +31,7 @@ import com.google.gwt.user.client.ui.ScrollPanel; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.DateTimeService; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.VCalendar; | |||
import com.vaadin.shared.ui.calendar.DateConstants; | |||
@@ -160,7 +160,7 @@ public class WeekGrid extends SimplePanel { | |||
// Otherwise the scroll wrapper is somehow too narrow = horizontal | |||
// scroll | |||
wrapper.setWidth(content.getOffsetWidth() | |||
+ Util.getNativeScrollbarSize() + "px"); | |||
+ WidgetUtil.getNativeScrollbarSize() + "px"); | |||
this.width = content.getOffsetWidth() - timebar.getOffsetWidth(); | |||
@@ -169,7 +169,7 @@ public class WeekGrid extends SimplePanel { | |||
- timebar.getOffsetWidth(); | |||
if (isVerticalScrollable() && width != -1) { | |||
this.width = this.width - Util.getNativeScrollbarSize(); | |||
this.width = this.width - WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
updateCellWidths(); | |||
} |
@@ -17,7 +17,7 @@ package com.vaadin.client.ui.calendar.schedule.dd; | |||
import com.google.gwt.dom.client.Element; | |||
import com.google.gwt.user.client.DOM; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.calendar.CalendarConnector; | |||
import com.vaadin.client.ui.calendar.schedule.SimpleDayCell; | |||
import com.vaadin.client.ui.dd.VAcceptCallback; | |||
@@ -51,7 +51,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { | |||
protected void dragAccepted(VDragEvent drag) { | |||
deEmphasis(); | |||
currentTargetElement = drag.getElementOver(); | |||
currentTargetDay = Util.findWidget(currentTargetElement, | |||
currentTargetDay = WidgetUtil.findWidget(currentTargetElement, | |||
SimpleDayCell.class); | |||
emphasis(); | |||
} |
@@ -17,7 +17,7 @@ package com.vaadin.client.ui.calendar.schedule.dd; | |||
import com.google.gwt.dom.client.Element; | |||
import com.google.gwt.user.client.DOM; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.calendar.CalendarConnector; | |||
import com.vaadin.client.ui.calendar.schedule.DateCell; | |||
import com.vaadin.client.ui.calendar.schedule.DateCellDayEvent; | |||
@@ -52,8 +52,8 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { | |||
protected void dragAccepted(VDragEvent drag) { | |||
deEmphasis(); | |||
currentTargetElement = drag.getElementOver(); | |||
currentTargetDay = Util | |||
.findWidget(currentTargetElement, DateCell.class); | |||
currentTargetDay = WidgetUtil.findWidget(currentTargetElement, | |||
DateCell.class); | |||
emphasis(); | |||
} | |||
@@ -121,7 +121,7 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { | |||
return DOM.isOrHasChild(weekGridElement, elementOver) | |||
&& !DOM.isOrHasChild(timeBarElement, elementOver) | |||
&& todayBarElement != elementOver | |||
&& (Util.findWidget(elementOver, DateCellDayEvent.class) == null); | |||
&& (WidgetUtil.findWidget(elementOver, DateCellDayEvent.class) == null); | |||
} | |||
/* |
@@ -18,7 +18,7 @@ package com.vaadin.client.ui.dd; | |||
import com.google.gwt.dom.client.Element; | |||
import com.google.gwt.dom.client.NativeEvent; | |||
import com.google.gwt.user.client.Window; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.dd.HorizontalDropLocation; | |||
import com.vaadin.shared.ui.dd.VerticalDropLocation; | |||
@@ -33,7 +33,7 @@ public class DDUtil { | |||
public static VerticalDropLocation getVerticalDropLocation(Element element, | |||
int offsetHeight, NativeEvent event, double topBottomRatio) { | |||
int clientY = Util.getTouchOrMouseClientY(event); | |||
int clientY = WidgetUtil.getTouchOrMouseClientY(event); | |||
return getVerticalDropLocation(element, offsetHeight, clientY, | |||
topBottomRatio); | |||
} | |||
@@ -59,7 +59,7 @@ public class DDUtil { | |||
public static HorizontalDropLocation getHorizontalDropLocation( | |||
Element element, NativeEvent event, double leftRightRatio) { | |||
int clientX = Util.getTouchOrMouseClientX(event); | |||
int clientX = WidgetUtil.getTouchOrMouseClientX(event); | |||
// Event coordinates are relative to the viewport, element absolute | |||
// position is relative to the document. Make element position relative |
@@ -38,7 +38,7 @@ import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.MouseEventDetailsBuilder; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.ValueMap; | |||
import com.vaadin.client.ui.VOverlay; | |||
@@ -92,16 +92,16 @@ public class VDragAndDropManager { | |||
targetElement = targetNode.getParentElement(); | |||
} | |||
if (Util.isTouchEvent(nativeEvent) || dragElement != null) { | |||
if (WidgetUtil.isTouchEvent(nativeEvent) || dragElement != null) { | |||
// to detect the "real" target, hide dragelement temporary and | |||
// use elementFromPoint | |||
String display = dragElement.getStyle().getDisplay(); | |||
dragElement.getStyle().setDisplay(Display.NONE); | |||
try { | |||
int x = Util.getTouchOrMouseClientX(nativeEvent); | |||
int y = Util.getTouchOrMouseClientY(nativeEvent); | |||
int x = WidgetUtil.getTouchOrMouseClientX(nativeEvent); | |||
int y = WidgetUtil.getTouchOrMouseClientY(nativeEvent); | |||
// Util.browserDebugger(); | |||
targetElement = Util.getElementFromPoint(x, y); | |||
targetElement = WidgetUtil.getElementFromPoint(x, y); | |||
if (targetElement == null) { | |||
// ApplicationConnection.getConsole().log( | |||
// "Event on dragImage, ignored"); | |||
@@ -361,10 +361,10 @@ public class VDragAndDropManager { | |||
deferredStartRegistration = Event | |||
.addNativePreviewHandler(new NativePreviewHandler() { | |||
private int startX = Util | |||
private int startX = WidgetUtil | |||
.getTouchOrMouseClientX(currentDrag | |||
.getCurrentGwtEvent()); | |||
private int startY = Util | |||
private int startY = WidgetUtil | |||
.getTouchOrMouseClientY(currentDrag | |||
.getCurrentGwtEvent()); | |||
@@ -419,10 +419,10 @@ public class VDragAndDropManager { | |||
} | |||
case Event.ONMOUSEMOVE: | |||
case Event.ONTOUCHMOVE: | |||
int currentX = Util | |||
int currentX = WidgetUtil | |||
.getTouchOrMouseClientX(event | |||
.getNativeEvent()); | |||
int currentY = Util | |||
int currentY = WidgetUtil | |||
.getTouchOrMouseClientY(event | |||
.getNativeEvent()); | |||
if (Math.abs(startX - currentX) > 3 | |||
@@ -462,9 +462,9 @@ public class VDragAndDropManager { | |||
private void updateDragImagePosition() { | |||
if (currentDrag.getCurrentGwtEvent() != null && dragElement != null) { | |||
Style style = dragElement.getStyle(); | |||
int clientY = Util.getTouchOrMouseClientY(currentDrag | |||
int clientY = WidgetUtil.getTouchOrMouseClientY(currentDrag | |||
.getCurrentGwtEvent()); | |||
int clientX = Util.getTouchOrMouseClientX(currentDrag | |||
int clientX = WidgetUtil.getTouchOrMouseClientX(currentDrag | |||
.getCurrentGwtEvent()); | |||
style.setTop(clientY, Unit.PX); | |||
style.setLeft(clientX, Unit.PX); | |||
@@ -480,7 +480,7 @@ public class VDragAndDropManager { | |||
*/ | |||
private VDropHandler findDragTarget(Element element) { | |||
try { | |||
Widget w = Util.findWidget(element, null); | |||
Widget w = WidgetUtil.findWidget(element, null); | |||
if (w == null) { | |||
return null; | |||
} |
@@ -30,7 +30,7 @@ import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.EventListener; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
/** | |||
* DragEvent used by Vaadin client side engine. Supports components, items, | |||
@@ -262,8 +262,8 @@ public class VDragEvent { | |||
if (alignImageToEvent) { | |||
int absoluteTop = element.getAbsoluteTop(); | |||
int absoluteLeft = element.getAbsoluteLeft(); | |||
int clientX = Util.getTouchOrMouseClientX(startEvent); | |||
int clientY = Util.getTouchOrMouseClientY(startEvent); | |||
int clientX = WidgetUtil.getTouchOrMouseClientX(startEvent); | |||
int clientY = WidgetUtil.getTouchOrMouseClientY(startEvent); | |||
int offsetX = absoluteLeft - clientX; | |||
int offsetY = absoluteTop - clientY; | |||
setDragImage(cloneNode, offsetX, offsetY); |
@@ -20,7 +20,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorHierarchyChangeEvent; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.AbstractFieldConnector; | |||
import com.vaadin.client.ui.AbstractLayoutConnector; | |||
@@ -114,14 +114,16 @@ public class FormLayoutConnector extends AbstractLayoutConnector { | |||
TooltipInfo info = null; | |||
if (element != getWidget().getElement()) { | |||
Object node = Util.findWidget(element, VFormLayout.Caption.class); | |||
Object node = WidgetUtil.findWidget(element, | |||
VFormLayout.Caption.class); | |||
if (node != null) { | |||
VFormLayout.Caption caption = (VFormLayout.Caption) node; | |||
info = caption.getOwner().getTooltipInfo(element); | |||
} else { | |||
node = Util.findWidget(element, VFormLayout.ErrorFlag.class); | |||
node = WidgetUtil.findWidget(element, | |||
VFormLayout.ErrorFlag.class); | |||
if (node != null) { | |||
VFormLayout.ErrorFlag flag = (VFormLayout.ErrorFlag) node; |
@@ -18,7 +18,7 @@ package com.vaadin.client.ui.label; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.dom.client.PreElement; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.AbstractComponentConnector; | |||
import com.vaadin.client.ui.VLabel; | |||
@@ -69,7 +69,7 @@ public class LabelConnector extends AbstractComponentConnector { | |||
if (sinkOnloads) { | |||
Profiler.enter("LabelConnector.onStateChanged sinkOnloads"); | |||
Util.sinkOnloadForImages(getWidget().getElement()); | |||
WidgetUtil.sinkOnloadForImages(getWidget().getElement()); | |||
Profiler.leave("LabelConnector.onStateChanged sinkOnloads"); | |||
} | |||
} |
@@ -30,6 +30,7 @@ import com.vaadin.client.Profiler; | |||
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; | |||
@@ -586,7 +587,7 @@ public class LayoutDependencyTree { | |||
} | |||
private static String getCompactConnectorString(ServerConnector connector) { | |||
return Util.getSimpleName(connector) + " (" | |||
return WidgetUtil.getSimpleName(connector) + " (" | |||
+ connector.getConnectorId() + ")"; | |||
} | |||
@@ -25,7 +25,7 @@ import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.Paintable; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.AbstractComponentConnector; | |||
import com.vaadin.client.ui.ImageIcon; | |||
import com.vaadin.client.ui.SimpleManagedLayout; | |||
@@ -78,7 +78,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements | |||
if (moreItemUIDL.hasAttribute("icon")) { | |||
itemHTML.append("<img src=\"" | |||
+ Util.escapeAttribute(client | |||
+ WidgetUtil.escapeAttribute(client | |||
.translateVaadinUri(moreItemUIDL | |||
.getStringAttribute("icon"))) | |||
+ "\" class=\"" + ImageIcon.CLASSNAME |
@@ -30,6 +30,7 @@ import com.vaadin.client.Profiler; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler; | |||
import com.vaadin.client.ui.AbstractFieldConnector; | |||
@@ -387,7 +388,7 @@ public abstract class AbstractOrderedLayoutConnector extends | |||
@Override | |||
public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { | |||
if (element != getWidget().getElement()) { | |||
Slot slot = Util.findWidget(element, Slot.class); | |||
Slot slot = WidgetUtil.findWidget(element, Slot.class); | |||
if (slot != null && slot.getCaptionElement() != null | |||
&& slot.getParent() == getWidget() | |||
&& slot.getCaptionElement().isOrHasChild(element)) { |
@@ -30,7 +30,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.StyleConstants; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.FontIcon; | |||
import com.vaadin.client.ui.Icon; | |||
import com.vaadin.client.ui.ImageIcon; | |||
@@ -74,7 +74,7 @@ public final class Slot extends SimplePanel { | |||
public void onElementResize(ElementResizeEvent e) { | |||
Element caption = getCaptionElement(); | |||
if (caption != null) { | |||
Util.forceIE8Redraw(caption); | |||
WidgetUtil.forceIE8Redraw(caption); | |||
} | |||
} | |||
}; | |||
@@ -493,7 +493,7 @@ public final class Slot extends SimplePanel { | |||
// Caption wrappers | |||
Widget widget = getWidget(); | |||
final Element focusedElement = Util.getFocusedElement(); | |||
final Element focusedElement = WidgetUtil.getFocusedElement(); | |||
// By default focus will not be lost | |||
boolean focusLost = false; | |||
if (captionText != null || icon != null || error != null || required) { | |||
@@ -613,7 +613,7 @@ public final class Slot extends SimplePanel { | |||
if (focusLost) { | |||
// Find out what element is currently focused. | |||
Element currentFocus = Util.getFocusedElement(); | |||
Element currentFocus = WidgetUtil.getFocusedElement(); | |||
if (currentFocus != null | |||
&& currentFocus.equals(Document.get().getBody())) { | |||
// Focus has moved to BodyElement and should be moved back to | |||
@@ -627,12 +627,12 @@ public final class Slot extends SimplePanel { | |||
@Override | |||
public void run() { | |||
if (Util.getFocusedElement() == null) { | |||
if (WidgetUtil.getFocusedElement() == null) { | |||
// This should never become an infinite loop and | |||
// even if it does it will be stopped once something | |||
// is done with the browser. | |||
schedule(25); | |||
} else if (Util.getFocusedElement().equals( | |||
} else if (WidgetUtil.getFocusedElement().equals( | |||
Document.get().getBody())) { | |||
// Focus found it's way to BodyElement. Now it can | |||
// be restored |
@@ -33,6 +33,7 @@ import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.shared.ui.MarginInfo; | |||
/** | |||
@@ -674,7 +675,7 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
} | |||
} | |||
} | |||
Util.forceIE8Redraw(getElement()); | |||
WidgetUtil.forceIE8Redraw(getElement()); | |||
} | |||
/** |
@@ -31,7 +31,7 @@ import com.vaadin.client.Paintable; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.AbstractHasComponentsConnector; | |||
import com.vaadin.client.ui.PostLayoutListener; | |||
import com.vaadin.client.ui.VScrollTable; | |||
@@ -342,7 +342,7 @@ public class TableConnector extends AbstractHasComponentsConnector implements | |||
@Override | |||
public void execute() { | |||
// IE8 needs some hacks to measure sizes correctly | |||
Util.forceIE8Redraw(getWidget().getElement()); | |||
WidgetUtil.forceIE8Redraw(getWidget().getElement()); | |||
getLayoutManager().setNeedsMeasure(TableConnector.this); | |||
ServerConnector parent = getParent(); | |||
@@ -394,7 +394,7 @@ public class TableConnector extends AbstractHasComponentsConnector implements | |||
TooltipInfo info = null; | |||
if (element != getWidget().getElement()) { | |||
Object node = Util.findWidget(element, VScrollTableRow.class); | |||
Object node = WidgetUtil.findWidget(element, VScrollTableRow.class); | |||
if (node != null) { | |||
VScrollTableRow row = (VScrollTableRow) node; |
@@ -20,7 +20,7 @@ import com.google.gwt.dom.client.Style.Overflow; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorHierarchyChangeEvent; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.SimpleManagedLayout; | |||
import com.vaadin.client.ui.VTabsheet; | |||
@@ -139,7 +139,8 @@ public class TabsheetConnector extends TabsheetBaseConnector implements | |||
// Find a tooltip for the tab, if the element is a tab | |||
if (element != getWidget().getElement()) { | |||
Object node = Util.findWidget(element, VTabsheet.TabCaption.class); | |||
Object node = WidgetUtil.findWidget(element, | |||
VTabsheet.TabCaption.class); | |||
if (node != null) { | |||
VTabsheet.TabCaption caption = (VTabsheet.TabCaption) node; |
@@ -19,7 +19,7 @@ package com.vaadin.client.ui.textarea; | |||
import com.google.gwt.dom.client.Element; | |||
import com.google.gwt.event.dom.client.MouseUpEvent; | |||
import com.google.gwt.event.dom.client.MouseUpHandler; | |||
import com.vaadin.client.Util.CssSize; | |||
import com.vaadin.client.WidgetUtil.CssSize; | |||
import com.vaadin.client.ui.VTextArea; | |||
import com.vaadin.client.ui.textfield.TextFieldConnector; | |||
import com.vaadin.shared.ui.Connect; |
@@ -27,7 +27,7 @@ import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Paintable; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.VConsole; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.AbstractComponentConnector; | |||
@@ -172,7 +172,7 @@ public class TreeConnector extends AbstractComponentConnector implements | |||
} | |||
// IE8 needs a hack to measure the tree again after update | |||
Util.forceIE8Redraw(getWidget().getElement()); | |||
WidgetUtil.forceIE8Redraw(getWidget().getElement()); | |||
getWidget().rendering = false; | |||
@@ -333,7 +333,7 @@ public class TreeConnector extends AbstractComponentConnector implements | |||
// Try to find a tooltip for a node | |||
if (element != getWidget().getElement()) { | |||
Object node = Util.findWidget(element, TreeNode.class); | |||
Object node = WidgetUtil.findWidget(element, TreeNode.class); | |||
if (node != null) { | |||
TreeNode tnode = (TreeNode) node; |
@@ -19,7 +19,7 @@ import com.google.gwt.dom.client.Element; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.TooltipInfo; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.FocusableScrollPanel; | |||
import com.vaadin.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow; | |||
import com.vaadin.client.ui.VTreeTable; | |||
@@ -129,7 +129,7 @@ public class TreeTableConnector extends TableConnector { | |||
TooltipInfo info = null; | |||
if (element != getWidget().getElement()) { | |||
Object node = Util.findWidget(element, VTreeTableRow.class); | |||
Object node = WidgetUtil.findWidget(element, VTreeTableRow.class); | |||
if (node != null) { | |||
VTreeTableRow row = (VTreeTableRow) node; |
@@ -38,7 +38,7 @@ import com.vaadin.client.ConnectorHierarchyChangeEvent; | |||
import com.vaadin.client.LayoutManager; | |||
import com.vaadin.client.Paintable; | |||
import com.vaadin.client.UIDL; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.communication.RpcProxy; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
import com.vaadin.client.ui.AbstractSingleComponentContainerConnector; | |||
@@ -247,7 +247,7 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector | |||
Style childStyle = layoutElement.getStyle(); | |||
// IE8 needs some hackery to measure its content correctly | |||
Util.forceIE8Redraw(layoutElement); | |||
WidgetUtil.forceIE8Redraw(layoutElement); | |||
if (content.isRelativeHeight() && !BrowserInfo.get().isIE9()) { | |||
childStyle.setPosition(Position.ABSOLUTE); |
@@ -31,7 +31,7 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.EventListener; | |||
import com.google.gwt.user.client.Timer; | |||
import com.vaadin.client.DeferredWorker; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.widget.grid.events.ScrollEvent; | |||
import com.vaadin.client.widget.grid.events.ScrollHandler; | |||
@@ -490,7 +490,7 @@ public abstract class ScrollbarBundle implements DeferredWorker { | |||
double oldScrollPos = scrollPos; | |||
scrollPos = Math.max(0, Math.min(maxScrollPos, truncate(px))); | |||
if (!Util.pixelValuesEqual(oldScrollPos, scrollPos)) { | |||
if (!WidgetUtil.pixelValuesEqual(oldScrollPos, scrollPos)) { | |||
if (isInvisibleScrollbar) { | |||
invisibleScrollbarTemporaryResizer.show(); | |||
} |
@@ -32,7 +32,7 @@ import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.renderers.ComplexRenderer; | |||
import com.vaadin.client.widget.grid.CellReference; | |||
import com.vaadin.client.widget.grid.RendererCellReference; | |||
@@ -260,7 +260,7 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> { | |||
int constrainedPageY = Math.max(bodyAbsoluteTop, | |||
Math.min(bodyAbsoluteBottom, pageY)); | |||
int logicalRow = getLogicalRowIndex(Util.getElementFromPoint( | |||
int logicalRow = getLogicalRowIndex(WidgetUtil.getElementFromPoint( | |||
initialPageX, constrainedPageY)); | |||
int incrementOrDecrement = (logicalRow > lastModifiedLogicalRow) ? 1 | |||
@@ -434,8 +434,8 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> { | |||
switch (event.getTypeInt()) { | |||
case Event.ONMOUSEMOVE: | |||
case Event.ONTOUCHMOVE: | |||
pageY = Util.getTouchOrMouseClientY(nativeEvent); | |||
pageX = Util.getTouchOrMouseClientX(nativeEvent); | |||
pageY = WidgetUtil.getTouchOrMouseClientY(nativeEvent); | |||
pageX = WidgetUtil.getTouchOrMouseClientX(nativeEvent); | |||
autoScroller.updatePointerCoords(pageX, pageY); | |||
break; | |||
case Event.ONMOUSEUP: |
@@ -53,7 +53,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.DeferredWorker; | |||
import com.vaadin.client.Profiler; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.widget.escalator.Cell; | |||
import com.vaadin.client.widget.escalator.ColumnConfiguration; | |||
import com.vaadin.client.widget.escalator.EscalatorUpdater; | |||
@@ -1061,10 +1061,11 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
final double viewportStartPx = getScrollLeft(); | |||
double viewportEndPx = viewportStartPx | |||
+ Util.getRequiredWidthBoundingClientRectDouble(getElement()) | |||
+ WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(getElement()) | |||
- frozenPixels; | |||
if (verticalScrollbar.showsScrollHandle()) { | |||
viewportEndPx -= Util.getNativeScrollbarSize(); | |||
viewportEndPx -= WidgetUtil.getNativeScrollbarSize(); | |||
} | |||
final double scrollLeft = getScrollPos(destination, targetStartPx, | |||
@@ -1731,9 +1732,8 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
final boolean isVisible = !cell.getStyle().getDisplay() | |||
.equals(Display.NONE.getCssName()); | |||
if (isVisible) { | |||
maxWidth = Math | |||
.max(maxWidth, | |||
Util.getRequiredWidthBoundingClientRectDouble(cell)); | |||
maxWidth = Math.max(maxWidth, WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(cell)); | |||
} | |||
row = TableRowElement.as(row.getNextSiblingElement()); | |||
} | |||
@@ -2011,7 +2011,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
cellClone.getStyle().clearWidth(); | |||
rowElement.insertBefore(cellClone, cellOriginal); | |||
double requiredWidth = Util | |||
double requiredWidth = WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(cellClone); | |||
if (BrowserInfo.get().isIE9()) { | |||
@@ -3681,7 +3681,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
private TableRowElement getEscalatorRowWithFocus() { | |||
TableRowElement rowContainingFocus = null; | |||
final Element focusedElement = Util.getFocusedElement(); | |||
final Element focusedElement = WidgetUtil.getFocusedElement(); | |||
if (focusedElement != null && root.isOrHasChild(focusedElement)) { | |||
Element e = focusedElement; | |||
@@ -4307,12 +4307,13 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
root.appendChild(verticalScrollbar.getElement()); | |||
verticalScrollbar.addScrollHandler(scrollHandler); | |||
verticalScrollbar.setScrollbarThickness(Util.getNativeScrollbarSize()); | |||
verticalScrollbar.setScrollbarThickness(WidgetUtil | |||
.getNativeScrollbarSize()); | |||
root.appendChild(horizontalScrollbar.getElement()); | |||
horizontalScrollbar.addScrollHandler(scrollHandler); | |||
horizontalScrollbar | |||
.setScrollbarThickness(Util.getNativeScrollbarSize()); | |||
horizontalScrollbar.setScrollbarThickness(WidgetUtil | |||
.getNativeScrollbarSize()); | |||
horizontalScrollbar | |||
.addVisibilityHandler(new ScrollbarBundle.VisibilityHandler() { | |||
@Override | |||
@@ -4338,18 +4339,18 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
table.appendChild(footElem); | |||
Style hCornerStyle = headerDeco.getStyle(); | |||
hCornerStyle.setWidth(Util.getNativeScrollbarSize(), Unit.PX); | |||
hCornerStyle.setWidth(WidgetUtil.getNativeScrollbarSize(), Unit.PX); | |||
hCornerStyle.setDisplay(Display.NONE); | |||
root.appendChild(headerDeco); | |||
Style fCornerStyle = footerDeco.getStyle(); | |||
fCornerStyle.setWidth(Util.getNativeScrollbarSize(), Unit.PX); | |||
fCornerStyle.setWidth(WidgetUtil.getNativeScrollbarSize(), Unit.PX); | |||
fCornerStyle.setDisplay(Display.NONE); | |||
root.appendChild(footerDeco); | |||
Style hWrapperStyle = horizontalScrollbarDeco.getStyle(); | |||
hWrapperStyle.setDisplay(Display.NONE); | |||
hWrapperStyle.setHeight(Util.getNativeScrollbarSize(), Unit.PX); | |||
hWrapperStyle.setHeight(WidgetUtil.getNativeScrollbarSize(), Unit.PX); | |||
root.appendChild(horizontalScrollbarDeco); | |||
setStylePrimaryName("v-escalator"); | |||
@@ -4721,10 +4722,10 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
} | |||
Profiler.enter("Escalator.recalculateElementSizes"); | |||
widthOfEscalator = Math.max(0, | |||
Util.getRequiredWidthBoundingClientRectDouble(getElement())); | |||
heightOfEscalator = Math.max(0, | |||
Util.getRequiredHeightBoundingClientRectDouble(getElement())); | |||
widthOfEscalator = Math.max(0, WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(getElement())); | |||
heightOfEscalator = Math.max(0, WidgetUtil | |||
.getRequiredHeightBoundingClientRectDouble(getElement())); | |||
header.recalculateSectionHeight(); | |||
body.recalculateSectionHeight(); | |||
@@ -4828,7 +4829,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
@SuppressWarnings("deprecation") | |||
com.google.gwt.user.client.Element castElement = (com.google.gwt.user.client.Element) possibleWidgetNode | |||
.cast(); | |||
Widget w = Util.findWidget(castElement, null); | |||
Widget w = WidgetUtil.findWidget(castElement, null); | |||
// Ensure findWidget did not traverse past the cell element in the | |||
// DOM hierarchy | |||
@@ -5086,6 +5087,7 @@ public class Escalator extends Widget implements RequiresResize, DeferredWorker | |||
* @return escalator's inner width | |||
*/ | |||
public double getInnerWidth() { | |||
return Util.getRequiredWidthBoundingClientRectDouble(tableWrapper); | |||
return WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(tableWrapper); | |||
} | |||
} |
@@ -59,7 +59,7 @@ import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.ResizeComposite; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.DeferredWorker; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.data.DataChangeHandler; | |||
import com.vaadin.client.data.DataSource; | |||
import com.vaadin.client.renderers.ComplexRenderer; | |||
@@ -1186,8 +1186,10 @@ public class Grid<T> extends ResizeComposite implements | |||
int bodyTop = body.getElement().getAbsoluteTop(); | |||
int wrapperTop = tableWrapper.getAbsoluteTop(); | |||
double width = Util.getRequiredWidthBoundingClientRectDouble(tr); | |||
double height = Util.getRequiredHeightBoundingClientRectDouble(tr); | |||
double width = WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(tr); | |||
double height = WidgetUtil | |||
.getRequiredHeightBoundingClientRectDouble(tr); | |||
setBounds(editorOverlay, tr.getOffsetLeft(), rowTop + bodyTop | |||
- wrapperTop, width, height); | |||
@@ -1276,8 +1278,10 @@ public class Grid<T> extends ResizeComposite implements | |||
*/ | |||
protected Element createCell(TableCellElement td) { | |||
DivElement cell = DivElement.as(DOM.createDiv()); | |||
double width = Util.getRequiredWidthBoundingClientRectDouble(td); | |||
double height = Util.getRequiredHeightBoundingClientRectDouble(td); | |||
double width = WidgetUtil | |||
.getRequiredWidthBoundingClientRectDouble(td); | |||
double height = WidgetUtil | |||
.getRequiredHeightBoundingClientRectDouble(td); | |||
setBounds(cell, td.getOffsetLeft(), td.getOffsetTop(), width, | |||
height); | |||
return cell; | |||
@@ -3169,7 +3173,7 @@ public class Grid<T> extends ResizeComposite implements | |||
Renderer renderer = findRenderer(cell); | |||
if (renderer instanceof WidgetRenderer) { | |||
try { | |||
Widget w = Util.findWidget(cell.getElement() | |||
Widget w = WidgetUtil.findWidget(cell.getElement() | |||
.getFirstChildElement(), Widget.class); | |||
if (w != null) { | |||
@@ -4516,7 +4520,7 @@ public class Grid<T> extends ResizeComposite implements | |||
} | |||
private boolean isElementInChildWidget(Element e) { | |||
Widget w = Util.findWidget(e, null); | |||
Widget w = WidgetUtil.findWidget(e, null); | |||
if (w == this) { | |||
return false; |
@@ -19,7 +19,7 @@ package com.vaadin.tests.widgetset.client; | |||
import com.google.gwt.dom.client.DivElement; | |||
import com.google.gwt.dom.client.Document; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.extensions.AbstractExtensionConnector; | |||
import com.vaadin.shared.ui.Connect; | |||
import com.vaadin.tests.extensions.BasicExtension; | |||
@@ -35,8 +35,8 @@ public class BasicExtensionTestConnector extends AbstractExtensionConnector { | |||
} | |||
private void appendMessage(String action) { | |||
String message = Util.getSimpleName(this) + action | |||
+ Util.getSimpleName(target); | |||
String message = WidgetUtil.getSimpleName(this) + action | |||
+ WidgetUtil.getSimpleName(target); | |||
DivElement element = Document.get().createDivElement(); | |||
element.setInnerText(message); |
@@ -18,7 +18,7 @@ package com.vaadin.tests.widgetset.client; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.dom.client.SpanElement; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.WidgetUtil; | |||
import com.vaadin.client.ui.ui.UIConnector; | |||
import com.vaadin.shared.ui.Connect; | |||
import com.vaadin.ui.UI; | |||
@@ -33,7 +33,7 @@ public class CustomUIConnector extends UIConnector { | |||
public void test() { | |||
SpanElement span = Document.get().createSpanElement(); | |||
span.setInnerText("This is the " | |||
+ Util.getSimpleName(CustomUIConnector.this)); | |||
+ WidgetUtil.getSimpleName(CustomUIConnector.this)); | |||
Document.get().getBody().insertFirst(span); | |||
} | |||
}); |