import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
// Ensure the overlay container is added to the dom and set as a live
// area for assistive devices
- com.google.gwt.user.client.Element overlayContainer = VOverlay
- .getOverlayContainer(this);
+ Element overlayContainer = VOverlay.getOverlayContainer(this);
Roles.getAlertRole().setAriaLiveProperty(overlayContainer,
LiveValue.ASSERTIVE);
VOverlay.setOverlayContainerLabel(this,
return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementByPath(Ljava/lang/String;)(id);
});
client.getElementByPathStartingAt = $entry(function(id, element) {
- return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/user/client/Element;)(id, element);
+ return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/dom/client/Element;)(id, element);
});
client.getElementsByPath = $entry(function(id) {
return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementsByPath(Ljava/lang/String;)(id);
});
client.getElementsByPathStartingAt = $entry(function(id, element) {
- return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementsByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/user/client/Element;)(id, element);
+ return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getElementsByPathStartingAt(Ljava/lang/String;Lcom/google/gwt/dom/client/Element;)(id, element);
});
client.getPathForElement = $entry(function(element) {
- return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getPathForElement(Lcom/google/gwt/user/client/Element;)(element);
+ return componentLocator.@com.vaadin.client.componentlocator.ComponentLocator::getPathForElement(Lcom/google/gwt/dom/client/Element;)(element);
});
client.initializing = false;
* @return Connector for focused element or null.
*/
private ComponentConnector getActiveConnector() {
- com.google.gwt.user.client.Element focusedElement = Util
- .getFocusedElement();
+ Element focusedElement = Util.getFocusedElement();
if (focusedElement == null) {
return null;
}
*/
package com.vaadin.client;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
+
/**
* Contains size information about a rendered container and its content area.
*
* @param widget
*
* @return true if the size has changed since last update
+ * @deprecated As of 7.2, call and override {@link #updateSize(Element)}
+ * instead
*/
+ @Deprecated
public boolean updateSize(com.google.gwt.user.client.Element element) {
Size newSize = new Size(element.getOffsetWidth(),
element.getOffsetHeight());
}
}
+ /**
+ * Update the size of the widget.
+ *
+ * @param widget
+ *
+ * @return true if the size has changed since last update
+ *
+ * @since 7.2
+ */
+ public boolean updateSize(Element element) {
+ return updateSize(DOM.asOld(element));
+ }
+
@Override
public String toString() {
return "RenderInformation [contentArea=" + contentArea
package com.vaadin.client;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
*/
@Deprecated
public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers {
- private com.google.gwt.user.client.Element children = Document.get()
- .createDivElement().cast();
+ private Element children = Document.get().createDivElement();
private SpanElement handle = Document.get().createSpanElement();
private SpanElement text = Document.get().createSpanElement();
add(child, children);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @deprecated As of 7.2, call and override {@link #add(Widget, Element)}
+ * instead.
+ */
@Override
+ @Deprecated
protected void add(Widget child,
com.google.gwt.user.client.Element container) {
super.add(child, container);
getElement().getStyle().setPaddingLeft(3, Unit.PX);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @since 7.2
+ */
+ @Override
+ protected void add(Widget child, Element container) {
+ add(child, DOM.asOld(container));
+ }
+
/**
* {@inheritDoc} Events are not fired when double clicking child widgets.
*/
import com.google.gwt.dom.client.AnchorElement;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.NodeList;
}
}
- private static final com.google.gwt.user.client.Element escapeHtmlHelper = DOM
- .createDiv();
+ private static final Element escapeHtmlHelper = DOM.createDiv();
/**
* Converts html entities to text.
* @return
*/
public static native com.google.gwt.user.client.Element cloneNode(
- com.google.gwt.user.client.Element element, boolean deep)
+ Element element, boolean deep)
/*-{
return element.cloneNode(deep);
}-*/;
- public static int measureHorizontalPaddingAndBorder(
- com.google.gwt.user.client.Element element, int paddingGuess) {
+ public static int measureHorizontalPaddingAndBorder(Element element,
+ int paddingGuess) {
String originalWidth = DOM.getStyleAttribute(element, "width");
int originalOffsetWidth = element.getOffsetWidth();
return padding;
}
- public static int measureVerticalPaddingAndBorder(
- com.google.gwt.user.client.Element element, int paddingGuess) {
+ public static int measureVerticalPaddingAndBorder(Element element,
+ int paddingGuess) {
String originalHeight = DOM.getStyleAttribute(element, "height");
int originalOffsetHeight = element.getOffsetHeight();
int widthGuess = (originalOffsetHeight - paddingGuess);
return padding;
}
- public static int measureHorizontalBorder(
- com.google.gwt.user.client.Element element) {
+ public static int measureHorizontalBorder(Element element) {
int borders;
if (BrowserInfo.get().isIE()) {
return borders;
}
- public static int measureVerticalBorder(
- com.google.gwt.user.client.Element element) {
+ public static int measureVerticalBorder(Element element) {
int borders;
if (BrowserInfo.get().isIE()) {
String width = element.getStyle().getProperty("width");
return borders;
}
- public static int measureMarginLeft(
- com.google.gwt.user.client.Element element) {
+ public static int measureMarginLeft(Element element) {
return element.getAbsoluteLeft()
- element.getParentElement().getAbsoluteLeft();
}
}
}
- public static int setWidthExcludingPaddingAndBorder(
- com.google.gwt.user.client.Element element, int requestedWidth,
- int horizontalPaddingBorderGuess,
+ public static int setWidthExcludingPaddingAndBorder(Element element,
+ int requestedWidth, int horizontalPaddingBorderGuess,
boolean requestedWidthIncludesPaddingBorder) {
int widthGuess = requestedWidth - horizontalPaddingBorderGuess;
}
- public static int setHeightExcludingPaddingAndBorder(
- com.google.gwt.user.client.Element element, int requestedHeight,
- int verticalPaddingBorderGuess,
+ public static int setHeightExcludingPaddingAndBorder(Element element,
+ int requestedHeight, int verticalPaddingBorderGuess,
boolean requestedHeightIncludesPaddingBorder) {
int heightGuess = requestedHeight - verticalPaddingBorderGuess;
return name.substring(name.lastIndexOf('.') + 1);
}
- public static void setFloat(com.google.gwt.user.client.Element element,
- String value) {
+ public static void setFloat(Element element, String value) {
if (BrowserInfo.get().isIE()) {
DOM.setStyleAttribute(element, "styleFloat", value);
} else {
public static int getNativeScrollbarSize() {
if (detectedScrollbarSize < 0) {
- com.google.gwt.user.client.Element scroller = DOM.createDiv();
+ Element scroller = DOM.createDiv();
scroller.getStyle().setProperty("width", "50px");
scroller.getStyle().setProperty("height", "50px");
scroller.getStyle().setProperty("overflow", "scroll");
* @param elem
* with overflow auto
*/
- public static void runWebkitOverflowAutoFix(
- final com.google.gwt.user.client.Element elem) {
+ public static void runWebkitOverflowAutoFix(final Element elem) {
// Add max version if fix lands sometime to Webkit
// Starting from Opera 11.00, also a problem in Opera
if (BrowserInfo.get().requiresOverflowAutoFix()) {
* element does not belong to a child.
*/
public static ComponentConnector getConnectorForElement(
- ApplicationConnection client, Widget parent,
- com.google.gwt.user.client.Element element) {
+ ApplicationConnection client, Widget parent, Element element) {
- com.google.gwt.user.client.Element browseElement = element;
- com.google.gwt.user.client.Element rootElement = parent.getElement();
+ Element browseElement = element;
+ Element rootElement = parent.getElement();
while (browseElement != null && browseElement != rootElement) {
if (connector != null) {
// check that inside the rootElement
while (browseElement != null && browseElement != rootElement) {
- browseElement = (com.google.gwt.user.client.Element) browseElement
- .getParentElement();
+ browseElement = browseElement.getParentElement();
}
if (browseElement != rootElement) {
return null;
}
}
- browseElement = (com.google.gwt.user.client.Element) browseElement
- .getParentElement();
+ browseElement = browseElement.getParentElement();
}
// No connector found, element is possibly inside a VOverlay
* @param el
* the element to focus
*/
- public static native void focus(com.google.gwt.user.client.Element el)
+ public static native void focus(Element el)
/*-{
try {
el.focus();
* the element to start from
*/
public static ComponentConnector findPaintable(
- ApplicationConnection client,
- com.google.gwt.user.client.Element element) {
+ ApplicationConnection client, Element element) {
Widget widget = Util.findWidget(element, null);
ConnectorMap vPaintableMap = ConnectorMap.get(client);
while (widget != null && !vPaintableMap.isConnector(widget)) {
* the Widget type to seek for
*/
@SuppressWarnings("unchecked")
- public static <T> T findWidget(com.google.gwt.user.client.Element element,
+ public static <T> T findWidget(Element element,
Class<? extends Widget> class1) {
if (element != null) {
/* First seek for the first EventListener (~Widget) from dom */
while (eventListener == null && element != null) {
eventListener = Event.getEventListener(element);
if (eventListener == null) {
- element = (com.google.gwt.user.client.Element) element
- .getParentElement();
+ element = element.getParentElement();
}
}
if (eventListener instanceof Widget) {
* @param element
* The element that should be redrawn
*/
- public static void forceWebkitRedraw(
- com.google.gwt.user.client.Element element) {
+ public static void forceWebkitRedraw(Element element) {
Style style = element.getStyle();
String s = style.getProperty("webkitTransform");
if (s == null || s.length() == 0) {
* @param e
* The element to perform the hack on
*/
- public static final void forceIE8Redraw(com.google.gwt.user.client.Element e) {
+ public static final void forceIE8Redraw(Element e) {
if (BrowserInfo.get().isIE8()) {
setStyleTemporarily(e, "zoom", "1");
}
* @param element
* The element to detach and re-attach
*/
- public static void detachAttach(com.google.gwt.user.client.Element element) {
+ public static void detachAttach(Element element) {
if (element == null) {
return;
}
}
- public static void sinkOnloadForImages(
- com.google.gwt.user.client.Element element) {
+ public static void sinkOnloadForImages(Element element) {
NodeList<com.google.gwt.dom.client.Element> imgElements = element
.getElementsByTagName("img");
for (int i = 0; i < imgElements.getLength(); i++) {
- DOM.sinkEvents(
- (com.google.gwt.user.client.Element) imgElements.getItem(i),
- Event.ONLOAD);
+ DOM.sinkEvents(imgElements.getItem(i), Event.ONLOAD);
}
}
* @param subElement
* @return
*/
- public static int getChildElementIndex(
- com.google.gwt.user.client.Element childElement) {
+ public static int getChildElementIndex(Element childElement) {
int idx = 0;
Node n = childElement;
while ((n = n.getPreviousSibling()) != null) {
* @param tempValue
* The temporary value
*/
- public static void setStyleTemporarily(
- com.google.gwt.user.client.Element element,
+ public static void setStyleTemporarily(Element element,
final String styleProperty, String tempValue) {
final Style style = element.getStyle();
final String currentValue = style.getProperty(styleProperty);
* Get target with element from point as we want the actual element, not
* the one that sunk the event.
*/
- final com.google.gwt.user.client.Element target = getElementFromPoint(
- touch.getClientX(), touch.getClientY());
+ final Element target = getElementFromPoint(touch.getClientX(),
+ touch.getClientY());
/*
* Fixes infocusable form fields in Safari of iOS 5.x and some Android
* @param elem
* The element to scroll into view
*/
- public static native void scrollIntoViewVertically(
- com.google.gwt.user.client.Element elem)
+ public static native void scrollIntoViewVertically(Element elem)
/*-{
var top = elem.offsetTop;
var height = elem.offsetHeight;
package com.vaadin.client;
import com.google.gwt.aria.client.Roles;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTML;
private final ComponentConnector owner;
- private com.google.gwt.user.client.Element errorIndicatorElement;
+ private Element errorIndicatorElement;
- private com.google.gwt.user.client.Element requiredFieldIndicator;
+ private Element requiredFieldIndicator;
private Icon icon;
private String iconAltText = "";
- private com.google.gwt.user.client.Element captionText;
+ private Element captionText;
private final ApplicationConnection client;
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ final Element target = DOM.eventGetTarget(event);
if (DOM.eventGetType(event) == Event.ONLOAD
&& icon.getElement() == target) {
}
protected com.google.gwt.user.client.Element getTextElement() {
- return captionText;
+ return DOM.asOld(captionText);
}
- public static String getCaptionOwnerPid(com.google.gwt.user.client.Element e) {
+ public static String getCaptionOwnerPid(Element e) {
return getOwnerPid(e);
}
- private native static void setOwnerPid(
- com.google.gwt.user.client.Element el, String pid)
+ private native static void setOwnerPid(Element el, String pid)
/*-{
el.vOwnerPid = pid;
}-*/;
- public native static String getOwnerPid(
- com.google.gwt.user.client.Element el)
+ public native static String getOwnerPid(Element el)
/*-{
return el.vOwnerPid;
}-*/;
package com.vaadin.client;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
* Shows this error message next to given element.
*
* @param indicatorElement
+ * @deprecated As of 7.2, call and override {@link #showAt(Element)} instead
*/
+ @Deprecated
public void showAt(com.google.gwt.user.client.Element indicatorElement) {
VOverlay errorContainer = (VOverlay) getParent();
if (errorContainer == null) {
}
+ /**
+ * Shows this error message next to given element.
+ *
+ * @param indicatorElement
+ *
+ * @since 7.2
+ */
+ public void showAt(Element indicatorElement) {
+ showAt(DOM.asOld(indicatorElement));
+ }
+
public void hide() {
final VOverlay errorContainer = (VOverlay) getParent();
if (errorContainer != null) {
package com.vaadin.client;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.user.client.DOM;
}
};
- private com.google.gwt.user.client.Element element;
+ private Element element;
/**
* Returns the delay (in ms) which must pass before the loading indicator
getConnection().getUIConnector().getWidget().getElement()
.appendChild(element);
}
- return element;
+ return DOM.asOld(element);
}
}
import com.google.gwt.aria.client.LiveValue;
import com.google.gwt.aria.client.RelevantValue;
import com.google.gwt.aria.client.Roles;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
| Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONMOUSEMOVE
| Event.ONCLICK;
VErrorMessage em = new VErrorMessage();
- com.google.gwt.user.client.Element description = DOM.createDiv();
+ Element description = DOM.createDiv();
private boolean closing = false;
private boolean opening = false;
* Element used in search
* @return true if connector and tooltip found
*/
- private boolean resolveConnector(
- com.google.gwt.user.client.Element element) {
+ private boolean resolveConnector(Element element) {
ApplicationConnection ac = getApplicationConnection();
ComponentConnector connector = Util.getConnectorForElement(ac,
private void handleShowHide(DomEvent domEvent, boolean isFocused) {
Event event = Event.as(domEvent.getNativeEvent());
- com.google.gwt.dom.client.Element element = com.google.gwt.user.client.Element
- .as(event.getEventTarget());
+ Element element = Element.as(event.getEventTarget());
// We can ignore move event if it's handled by move or over already
if (currentElement == element && handledByFocus == true) {
return;
}
- boolean connectorAndTooltipFound = resolveConnector((com.google.gwt.user.client.Element) element);
+ boolean connectorAndTooltipFound = resolveConnector(element);
if (!connectorAndTooltipFound) {
if (isShowing()) {
handleHideEvent();
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
import com.vaadin.client.ApplicationConnection;
/**
* The element to generate a path for.
* @return A String locator that identifies the target element or null if a
* String locator could not be created.
+ * @deprecated As of 7.2, call and override
+ * {@link #getPathForElement(Element)} instead
*/
+ @Deprecated
public String getPathForElement(
com.google.gwt.user.client.Element targetElement) {
for (LocatorStrategy strategy : locatorStrategies) {
return null;
}
+ /**
+ * Generates a String locator which uniquely identifies the target element.
+ * The {@link #getElementByPath(String)} method can be used for the inverse
+ * operation, i.e. locating an element based on the return value from this
+ * method.
+ * <p>
+ * Note that getElementByPath(getPathForElement(element)) == element is not
+ * always true as #getPathForElement(Element) can return a path to another
+ * element if the widget determines an action on the other element will give
+ * the same result as the action on the target element.
+ * </p>
+ *
+ * @since 7.2
+ * @param targetElement
+ * The element to generate a path for.
+ * @return A String locator that identifies the target element or null if a
+ * String locator could not be created.
+ */
+ public String getPathForElement(Element targetElement) {
+ return getPathForElement(DOM.asOld(targetElement));
+ }
+
/**
* Locates an element using a String locator (path) which identifies a DOM
* element. The {@link #getPathForElement(Element)} method can be used for
public com.google.gwt.user.client.Element getElementByPath(String path) {
for (LocatorStrategy strategy : locatorStrategies) {
if (strategy.validatePath(path)) {
- com.google.gwt.user.client.Element element = strategy
- .getElementByPath(path);
+ Element element = strategy.getElementByPath(path);
if (null != element) {
- return element;
+ return DOM.asOld(element);
}
}
}
* @return The JavaScriptArray of DOM elements identified by {@code path} or
* empty array if elements could not be located.
*/
- public JsArray<com.google.gwt.user.client.Element> getElementsByPath(
- String path) {
- JsArray<com.google.gwt.user.client.Element> jsElements = JavaScriptObject
- .createArray().cast();
+ public JsArray<Element> getElementsByPath(String path) {
+ JsArray<Element> jsElements = JavaScriptObject.createArray().cast();
for (LocatorStrategy strategy : locatorStrategies) {
if (strategy.validatePath(path)) {
- List<com.google.gwt.user.client.Element> elements = strategy
- .getElementsByPath(path);
+ List<Element> elements = strategy.getElementsByPath(path);
if (elements.size() > 0) {
- for (com.google.gwt.user.client.Element e : elements) {
+ for (Element e : elements) {
jsElements.push(e);
}
return jsElements;
* @return The JavaScriptArray of DOM elements identified by {@code path} or
* empty array if elements could not be located.
*/
- public JsArray<com.google.gwt.user.client.Element> getElementsByPathStartingAt(
- String path, com.google.gwt.user.client.Element root) {
- JsArray<com.google.gwt.user.client.Element> jsElements = JavaScriptObject
- .createArray().cast();
+ public JsArray<Element> getElementsByPathStartingAt(String path,
+ Element root) {
+ JsArray<Element> jsElements = JavaScriptObject.createArray().cast();
for (LocatorStrategy strategy : locatorStrategies) {
if (strategy.validatePath(path)) {
- List<com.google.gwt.user.client.Element> elements = strategy
- .getElementsByPathStartingAt(path, root);
+ List<Element> elements = strategy.getElementsByPathStartingAt(
+ path, root);
if (elements.size() > 0) {
- for (com.google.gwt.user.client.Element e : elements) {
+ for (Element e : elements) {
jsElements.push(e);
}
return jsElements;
*
* @see #getElementByPath(String)
*
+ * @since 7.2
+ *
* @param path
* The path of the element to be found
* @param root
* could not be located.
*/
public com.google.gwt.user.client.Element getElementByPathStartingAt(
- String path, com.google.gwt.user.client.Element root) {
+ String path, Element root) {
for (LocatorStrategy strategy : locatorStrategies) {
if (strategy.validatePath(path)) {
- com.google.gwt.user.client.Element element = strategy
- .getElementByPathStartingAt(path, root);
+ Element element = strategy.getElementByPathStartingAt(path,
+ root);
if (null != element) {
- return element;
+ return DOM.asOld(element);
}
}
}
import java.util.List;
import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.HasWidgets;
}
@Override
- public String getPathForElement(
- com.google.gwt.user.client.Element targetElement) {
+ public String getPathForElement(Element targetElement) {
ComponentConnector connector = Util
.findPaintable(client, targetElement);
* If the widget can provide an identifier for the targetElement we
* let it do that
*/
- String elementLocator = ((SubPartAware) w)
- .getSubPartName(targetElement);
+ String elementLocator = ((SubPartAware) w).getSubPartName(DOM
+ .asOld(targetElement));
if (elementLocator != null) {
return path + LegacyLocatorStrategy.SUBPART_SEPARATOR
+ elementLocator;
* {@inheritDoc}
*/
@Override
- public com.google.gwt.user.client.Element getElementByPath(String path) {
+ public Element getElementByPath(String path) {
return getElementByPathStartingAt(path, null);
}
* {@inheritDoc}
*/
@Override
- public com.google.gwt.user.client.Element getElementByPathStartingAt(
- String path, com.google.gwt.user.client.Element baseElement) {
+ public Element getElementByPathStartingAt(String path, Element baseElement) {
/*
* Path is of type "targetWidgetPath#componentPart" or
* "targetWidgetPath".
* {@inheritDoc}
*/
@Override
- public List<com.google.gwt.user.client.Element> getElementsByPath(
- String path) {
+ public List<Element> getElementsByPath(String path) {
// This type of search is not supported in LegacyLocator
- List<com.google.gwt.user.client.Element> array = new ArrayList<com.google.gwt.user.client.Element>();
- com.google.gwt.user.client.Element e = getElementByPath(path);
+ List<Element> array = new ArrayList<Element>();
+ Element e = getElementByPath(path);
if (e != null) {
array.add(e);
}
* {@inheritDoc}
*/
@Override
- public List<com.google.gwt.user.client.Element> getElementsByPathStartingAt(
- String path, com.google.gwt.user.client.Element root) {
+ public List<Element> getElementsByPathStartingAt(String path, Element root) {
// This type of search is not supported in LegacyLocator
- List<com.google.gwt.user.client.Element> array = new ArrayList<com.google.gwt.user.client.Element>();
- com.google.gwt.user.client.Element e = getElementByPathStartingAt(path,
- root);
+ List<Element> array = new ArrayList<Element>();
+ Element e = getElementByPathStartingAt(path, root);
if (e != null) {
array.add(e);
}
* @return The widget whose root element is a parent of
* {@code targetElement}.
*/
- private Widget findParentWidget(
- com.google.gwt.user.client.Element targetElement,
- Widget ancestorWidget) {
+ private Widget findParentWidget(Element targetElement, Widget ancestorWidget) {
/*
* As we cannot resolve Widgets from the element we start from the
* widget and move downwards to the correct child widget, as long as we
* @return The element identified by path, relative to baseElement or null
* if the element could not be found.
*/
- private com.google.gwt.user.client.Element getElementByDOMPath(
- com.google.gwt.user.client.Element baseElement, String path) {
+ private Element getElementByDOMPath(Element baseElement, String path) {
String parts[] = path.split(PARENTCHILD_SEPARATOR);
- com.google.gwt.user.client.Element element = baseElement;
+ Element element = baseElement;
for (int i = 0, l = parts.length; i < l; ++i) {
String part = parts[i];
if (Util.findWidget(baseElement, null) instanceof VAbstractOrderedLayout) {
if (element.hasChildNodes()) {
- com.google.gwt.user.client.Element e = element
- .getFirstChildElement().cast();
+ Element e = element.getFirstChildElement().cast();
String cn = e.getClassName();
if (cn != null
&& (cn.equals("v-expand") || cn
* The starting point for the locator. The generated path is
* relative to this element.
* @return A String locator that can be used to locate the target element
- * using
- * {@link #getElementByDOMPath(com.google.gwt.user.client.Element, String)}
- * or null if the locator String cannot be created.
+ * using {@link #getElementByDOMPath(Element, String)} or null if
+ * the locator String cannot be created.
*/
- private String getDOMPathForElement(
- com.google.gwt.user.client.Element element,
- com.google.gwt.user.client.Element baseElement) {
- com.google.gwt.user.client.Element e = element;
+ private String getDOMPathForElement(Element element, Element baseElement) {
+ Element e = element;
String path = "";
while (true) {
int childIndex = -1;
- com.google.gwt.user.client.Element siblingIterator = e;
+ Element siblingIterator = e;
while (siblingIterator != null) {
childIndex++;
siblingIterator = siblingIterator.getPreviousSiblingElement()
import java.util.List;
+import com.google.gwt.dom.client.Element;
+
/**
* This interface should be implemented by all locator strategies. A locator
* strategy is responsible for generating and decoding a string that identifies
* @return A String locator that identifies the target element or null if a
* String locator could not be created.
*/
- String getPathForElement(com.google.gwt.user.client.Element targetElement);
+ String getPathForElement(Element targetElement);
/**
* Locates an element using a String locator (path) which identifies a DOM
* @return The DOM element identified by {@code path} or null if the element
* could not be located.
*/
- com.google.gwt.user.client.Element getElementByPath(String path);
+ Element getElementByPath(String path);
/**
* Locates an element using a String locator (path) which identifies a DOM
* @return The DOM element identified by {@code path} or null if the element
* could not be located.
*/
- com.google.gwt.user.client.Element getElementByPathStartingAt(String path,
- com.google.gwt.user.client.Element root);
+ Element getElementByPathStartingAt(String path,
+ Element root);
/**
* Locates all elements that match a String locator (path) which identifies
* @return List that contains all matched elements. Empty list if none
* found.
*/
- List<com.google.gwt.user.client.Element> getElementsByPath(String path);
+ List<Element> getElementsByPath(String path);
/**
* Locates all elements that match a String locator (path) which identifies
* found.
*/
- List<com.google.gwt.user.client.Element> getElementsByPathStartingAt(
- String path, com.google.gwt.user.client.Element root);
+ List<Element> getElementsByPathStartingAt(
+ String path, Element root);
}
import java.util.Arrays;
import java.util.List;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
* {@inheritDoc}
*/
@Override
- public String getPathForElement(
- com.google.gwt.user.client.Element targetElement) {
+ public String getPathForElement(Element targetElement) {
if (targetElement == null) {
return "";
}
* Target element
* @return Best selector string formatted with a post filter
*/
- private String getBestSelector(List<String> selectors,
- com.google.gwt.user.client.Element target) {
+ private String getBestSelector(List<String> selectors, Element target) {
// The last selector gives us smallest list index for target element.
String bestSelector = selectors.get(selectors.size() - 1);
int min = getElementsByPath(bestSelector).indexOf(target);
* @return a list of ConnectorPath objects, in descending order towards the
* common root container.
*/
- private List<ConnectorPath> getConnectorHierarchyForElement(
- com.google.gwt.user.client.Element elem) {
- com.google.gwt.user.client.Element e = elem;
+ private List<ConnectorPath> getConnectorHierarchyForElement(Element elem) {
+ Element e = elem;
ComponentConnector c = Util.findPaintable(client, e);
List<ConnectorPath> connectorHierarchy = new ArrayList<ConnectorPath>();
}
}
- e = (com.google.gwt.user.client.Element) e.getParentElement();
+ e = e.getParentElement();
if (e != null) {
c = Util.findPaintable(client, e);
e = c != null ? c.getWidget().getElement() : null;
* {@inheritDoc}
*/
@Override
- public List<com.google.gwt.user.client.Element> getElementsByPath(
- String path) {
+ public List<Element> getElementsByPath(String path) {
List<SelectorPredicate> postFilters = SelectorPredicate
.extractPostFilterPredicates(path);
if (postFilters.size() > 0) {
path = path.substring(1, path.lastIndexOf(')'));
}
- List<com.google.gwt.user.client.Element> elements = new ArrayList<com.google.gwt.user.client.Element>();
+ List<Element> elements = new ArrayList<Element>();
if (isNotificationExpression(path)) {
for (VNotification n : findNotificationsByPath(path)) {
if (p.getIndex() >= elements.size()) {
elements.clear();
} else {
- com.google.gwt.user.client.Element e = elements.get(p
- .getIndex());
+ Element e = elements.get(p.getIndex());
elements.clear();
elements.add(e);
}
* {@inheritDoc}
*/
@Override
- public com.google.gwt.user.client.Element getElementByPath(String path) {
- List<com.google.gwt.user.client.Element> elements = getElementsByPath(path);
+ public Element getElementByPath(String path) {
+ List<Element> elements = getElementsByPath(path);
if (elements.isEmpty()) {
return null;
}
* {@inheritDoc}
*/
@Override
- public com.google.gwt.user.client.Element getElementByPathStartingAt(
- String path, com.google.gwt.user.client.Element root) {
- List<com.google.gwt.user.client.Element> elements = getElementsByPathStartingAt(
- path, root);
+ public Element getElementByPathStartingAt(String path, Element root) {
+ List<Element> elements = getElementsByPathStartingAt(path, root);
if (elements.isEmpty()) {
return null;
}
* {@inheritDoc}
*/
@Override
- public List<com.google.gwt.user.client.Element> getElementsByPathStartingAt(
- String path, com.google.gwt.user.client.Element root) {
+ public List<Element> getElementsByPathStartingAt(String path, Element root) {
List<SelectorPredicate> postFilters = SelectorPredicate
.extractPostFilterPredicates(path);
if (postFilters.size() > 0) {
path = path.substring(1, path.lastIndexOf(')'));
}
- List<com.google.gwt.user.client.Element> elements = getElementsByPathStartingAtConnector(
- path, Util.findPaintable(client, root));
+ List<Element> elements = getElementsByPathStartingAtConnector(path,
+ Util.findPaintable(client, root));
for (SelectorPredicate p : postFilters) {
// Post filtering supports only indexes and follows instruction
if (p.getIndex() >= elements.size()) {
elements.clear();
} else {
- com.google.gwt.user.client.Element e = elements.get(p
- .getIndex());
+ Element e = elements.get(p.getIndex());
elements.clear();
elements.add(e);
}
* @return the list of elements identified by path or empty list if not
* found.
*/
- private List<com.google.gwt.user.client.Element> getElementsByPathStartingAtConnector(
- String path, ComponentConnector root) {
+ private List<Element> getElementsByPathStartingAtConnector(String path,
+ ComponentConnector root) {
String[] pathComponents = path.split(SUBPART_SEPARATOR);
List<ComponentConnector> connectors;
if (pathComponents[0].length() > 0) {
connectors = Arrays.asList(root);
}
- List<com.google.gwt.user.client.Element> output = new ArrayList<com.google.gwt.user.client.Element>();
+ List<Element> output = new ArrayList<Element>();
if (null != connectors && !connectors.isEmpty()) {
if (pathComponents.length > 1) {
// We have subparts
*/
package com.vaadin.client.debug.internal;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
hierarchyPanel.addListener(new SelectConnectorListener() {
@Override
public void select(ServerConnector connector,
- com.google.gwt.user.client.Element element) {
+ Element element) {
printState(connector, true);
}
});
analyzeLayoutsPanel.addListener(new SelectConnectorListener() {
@Override
public void select(ServerConnector connector,
- com.google.gwt.user.client.Element element) {
+ Element element) {
printState(connector, true);
}
});
}
if (event.getTypeInt() == Event.ONMOUSEMOVE) {
Highlight.hideAll();
- com.google.gwt.user.client.Element eventTarget = Util
- .getElementFromPoint(event.getNativeEvent()
- .getClientX(), event.getNativeEvent()
- .getClientY());
+ Element eventTarget = Util.getElementFromPoint(event
+ .getNativeEvent().getClientX(), event.getNativeEvent()
+ .getClientY());
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) {
infoPanel.clear();
return;
event.consume();
event.getNativeEvent().stopPropagation();
stopFind();
- com.google.gwt.user.client.Element eventTarget = Util
- .getElementFromPoint(event.getNativeEvent()
- .getClientX(), event.getNativeEvent()
- .getClientY());
+ Element eventTarget = Util.getElementFromPoint(event
+ .getNativeEvent().getClientX(), event.getNativeEvent()
+ .getClientY());
for (ApplicationConnection a : ApplicationConfiguration
.getRunningApplications()) {
ComponentConnector connector = Util.getConnectorForElement(
import java.util.HashSet;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
private static final int MIN_WIDTH = 3;
private static final int MIN_HEIGHT = 3;
- static HashSet<com.google.gwt.user.client.Element> highlights;
+ static HashSet<Element> highlights;
/**
* Highlight the {@link Widget} for the given {@link ComponentConnector}.
* ComponentConnector
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(ComponentConnector connector) {
+ static Element show(ComponentConnector connector) {
return show(connector, DEFAULT_COLOR);
}
* @return Highlight element, or <code>null</code> if the connector isn't a
* component
*/
- static com.google.gwt.user.client.Element showOnly(ServerConnector connector) {
+ static Element showOnly(ServerConnector connector) {
hideAll();
if (connector instanceof ComponentConnector) {
return show((ComponentConnector) connector);
* Color of highlight
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(
- ComponentConnector connector, String color) {
+ static Element show(ComponentConnector connector, String color) {
if (connector != null) {
Widget w = connector.getWidget();
return show(w, color);
* Widget to highlight
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(Widget widget) {
+ static Element show(Widget widget) {
return show(widget, DEFAULT_COLOR);
}
* Color of highlight
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(Widget widget, String color) {
+ static Element show(Widget widget, String color) {
if (widget != null) {
show(widget.getElement(), color);
}
* Element to highlight
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(
- com.google.gwt.user.client.Element element) {
+ static Element show(Element element) {
return show(element, DEFAULT_COLOR);
}
* Color of highlight
* @return Highlight element
*/
- static com.google.gwt.user.client.Element show(
- com.google.gwt.user.client.Element element, String color) {
+ static Element show(Element element, String color) {
if (element != null) {
if (highlights == null) {
- highlights = new HashSet<com.google.gwt.user.client.Element>();
+ highlights = new HashSet<Element>();
}
- com.google.gwt.user.client.Element highlight = DOM.createDiv();
+ Element highlight = DOM.createDiv();
Style style = highlight.getStyle();
style.setTop(element.getAbsoluteTop(), Unit.PX);
style.setLeft(element.getAbsoluteLeft(), Unit.PX);
* @param highlight
* Highlight to hide
*/
- static void hide(com.google.gwt.user.client.Element highlight) {
+ static void hide(Element highlight) {
if (highlight != null && highlight.getParentElement() != null) {
highlight.getParentElement().removeChild(highlight);
highlights.remove(highlight);
*/
static void hideAll() {
if (highlights != null) {
- for (com.google.gwt.user.client.Element highlight : highlights) {
+ for (Element highlight : highlights) {
if (highlight.getParentElement() != null) {
highlight.getParentElement().removeChild(highlight);
}
*/
package com.vaadin.client.debug.internal;
+import com.google.gwt.dom.client.Element;
import com.vaadin.client.ServerConnector;
/**
* selected element of the connector or null if unknown
*/
public void select(ServerConnector connector,
- com.google.gwt.user.client.Element element);
+ Element element);
}
\ No newline at end of file
import java.util.List;
import java.util.Map;
+import com.google.gwt.dom.client.Element;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.componentlocator.ComponentLocator;
import com.vaadin.client.componentlocator.SelectorPredicate;
*/
public class SelectorPath {
private final String path;
- private final com.google.gwt.user.client.Element element;
+ private final Element element;
private final ComponentLocator locator;
private static Map<String, Integer> counter = new HashMap<String, Integer>();
private static Map<String, String> legacyNames = new HashMap<String, String>();
legacyNames.put("ScrollTable", "Table");
}
- protected SelectorPath(ServerConnector c,
- com.google.gwt.user.client.Element e) {
+ protected SelectorPath(ServerConnector c, Element e) {
element = e;
locator = new ComponentLocator(c.getConnection());
path = locator.getPathForElement(e);
return path;
}
- public com.google.gwt.user.client.Element getElement() {
+ public Element getElement() {
return element;
}
import java.util.HashMap;
import java.util.Map;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
public void onMouseOver(MouseOverEvent event) {
Highlight.hideAll();
- com.google.gwt.user.client.Element element = path.getElement();
+ Element element = path.getElement();
if (null != element) {
Highlight.show(element);
}
Highlight.hideAll();
}
- private void pickSelector(ServerConnector connector,
- com.google.gwt.user.client.Element element) {
+ private void pickSelector(ServerConnector connector, Element element) {
SelectorPath p = new SelectorPath(connector, Util
.findPaintable(connector.getConnection(), element).getWidget()
}
if (event.getTypeInt() == Event.ONMOUSEMOVE
|| event.getTypeInt() == Event.ONCLICK) {
- com.google.gwt.user.client.Element eventTarget = Util
- .getElementFromPoint(event.getNativeEvent()
- .getClientX(), event.getNativeEvent()
- .getClientY());
+ Element eventTarget = Util.getElementFromPoint(event
+ .getNativeEvent().getClientX(), event.getNativeEvent()
+ .getClientY());
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) {
if (isFindMode() && event.getTypeInt() == Event.ONCLICK) {
stopFind();
};
- private ComponentConnector findConnector(
- com.google.gwt.user.client.Element element) {
+ private ComponentConnector findConnector(Element element) {
for (ApplicationConnection a : ApplicationConfiguration
.getRunningApplications()) {
ComponentConnector connector = Util.getConnectorForElement(a, a
*/
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ContextMenuEvent;
import com.google.gwt.event.dom.client.ContextMenuHandler;
/**
* The element where the last mouse down event was registered.
*/
- private com.google.gwt.user.client.Element lastMouseDownTarget;
+ private Element lastMouseDownTarget;
/**
* Set to true by {@link #mouseUpPreviewHandler} if it gets a mouseup at the
// Event's reported target not always correct if event
// capture is in use
- com.google.gwt.user.client.Element elementUnderMouse = Util
- .getElementUnderMouse(event.getNativeEvent());
+ Element elementUnderMouse = Util.getElementUnderMouse(event
+ .getNativeEvent());
if (lastMouseDownTarget != null
&& elementUnderMouse == lastMouseDownTarget) {
mouseUpPreviewMatched = true;
style.setLeft(0, Unit.PX);
getElement().appendChild(focusElement);
/* Sink from focusElement too as focus and blur don't bubble */
- DOM.sinkEvents(
- (com.google.gwt.user.client.Element) focusElement.cast(),
- Event.FOCUSEVENTS);
+ DOM.sinkEvents(focusElement, Event.FOCUSEVENTS);
// revert to original, not focusable
getElement().setPropertyObject("tabIndex", null);
} else {
@Override
public void setFocus(boolean focus) {
if (focus) {
- FocusImpl.getFocusImplForPanel().focus(
- (com.google.gwt.user.client.Element) focusElement.cast());
+ FocusImpl.getFocusImplForPanel().focus(focusElement);
} else {
- FocusImpl.getFocusImplForPanel().blur(
- (com.google.gwt.user.client.Element) focusElement.cast());
+ FocusImpl.getFocusImplForPanel().blur(focusElement);
}
}
style.setLeft(0, Unit.PX);
getElement().appendChild(focusElement);
/* Sink from focusElemet too as focusa and blur don't bubble */
- DOM.sinkEvents(
- (com.google.gwt.user.client.Element) focusElement
- .cast(), Event.FOCUSEVENTS);
+ DOM.sinkEvents(focusElement, Event.FOCUSEVENTS);
// revert to original, not focusable
getElement().setPropertyObject("tabIndex", null);
public void setFocus(boolean focus) {
if (useFakeFocusElement()) {
if (focus) {
- FocusImpl.getFocusImplForPanel().focus(
- (com.google.gwt.user.client.Element) focusElement
- .cast());
+ FocusImpl.getFocusImplForPanel().focus(focusElement);
} else {
- FocusImpl.getFocusImplForPanel().blur(
- (com.google.gwt.user.client.Element) focusElement
- .cast());
+ FocusImpl.getFocusImplForPanel().blur(focusElement);
}
} else {
super.setFocus(focus);
import java.util.Iterator;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
private void fireAction(final Event event, final ShortcutAction a,
ComponentConnector target) {
- final com.google.gwt.user.client.Element et = DOM.eventGetTarget(event);
+ final Element et = DOM.eventGetTarget(event);
if (target == null) {
target = Util.findPaintable(client, et);
}
* <p>
* TODO separate opera impl with generator
*/
- private static void shakeTarget(final com.google.gwt.user.client.Element e) {
+ private static void shakeTarget(final Element e) {
blur(e);
if (BrowserInfo.get().isOpera()) {
// will mess up with focus and blur event if the focus is not
}
}
- private static native void blur(com.google.gwt.user.client.Element e)
+ private static native void blur(Element e)
/*-{
if(e.blur) {
e.blur();
}
}-*/;
- private static native void focus(com.google.gwt.user.client.Element e)
+ private static native void focus(Element e)
/*-{
if(e.blur) {
e.focus();
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;
private DivElement marginElement;
- protected final com.google.gwt.user.client.Element canvas = DOM.createDiv();
+ protected final Element canvas = DOM.createDiv();
/**
* Default constructor
import java.util.Collections;
import java.util.List;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.Style;
import com.google.gwt.event.dom.client.TouchCancelEvent;
Widget secondChild;
- private final com.google.gwt.user.client.Element wrapper = DOM.createDiv();
+ private final Element wrapper = DOM.createDiv();
- private final com.google.gwt.user.client.Element firstContainer = DOM
- .createDiv();
+ private final Element firstContainer = DOM.createDiv();
- private final com.google.gwt.user.client.Element secondContainer = DOM
- .createDiv();
+ private final Element secondContainer = DOM.createDiv();
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element splitter = DOM.createDiv();
+ public final Element splitter = DOM.createDiv();
private boolean resizing;
/** For internal use only. May be removed or replaced in the future. */
public List<String> componentStyleNames = Collections.emptyList();
- private com.google.gwt.user.client.Element draggingCurtain;
+ private Element draggingCurtain;
/** For internal use only. May be removed or replaced in the future. */
public ApplicationConnection client;
private TouchScrollHandler touchScrollHandler;
- protected com.google.gwt.user.client.Element scrolledContainer;
+ protected Element scrolledContainer;
protected int origScrollTop;
if (locked || !isEnabled()) {
return;
}
- final com.google.gwt.user.client.Element trg = event.getEventTarget()
- .cast();
+ final Element trg = event.getEventTarget().cast();
if (trg == splitter || trg == DOM.getChild(splitter, 0)) {
resizing = true;
DOM.setCapture(getElement());
import java.util.Iterator;
import java.util.Set;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
private VCaption caption;
private boolean open = false;
- private com.google.gwt.user.client.Element content = DOM.createDiv();
- private com.google.gwt.user.client.Element captionNode = DOM
- .createDiv();
+ private Element content = DOM.createDiv();
+ private Element captionNode = DOM.createDiv();
private String styleName;
public StackItem(UIDL tabUidl) {
}
public com.google.gwt.user.client.Element getContainerElement() {
- return content;
+ return DOM.asOld(content);
}
public Widget getChildWidget() {
import java.util.Date;
import java.util.List;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ContextMenuEvent;
import com.google.gwt.event.dom.client.ContextMenuHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
* @param e
* The element to apply the hack on
*/
- private native void blockSelect(com.google.gwt.user.client.Element e)
+ private native void blockSelect(Element e)
/*-{
e.onselectstart = function() {
return false;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.aria.client.SelectedValue;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
* @param subElement
* @return true if {@code w} is a parent of subElement, false otherwise.
*/
- private boolean contains(Widget w,
- com.google.gwt.user.client.Element subElement) {
+ private boolean contains(Widget w, Element subElement) {
if (w == null || w.getElement() == null) {
return false;
}
}
if (SUBPART_MONTH_YEAR_HEADER.equals(subPart)) {
- return (com.google.gwt.user.client.Element) getCellFormatter()
- .getElement(0, 2).getChild(0);
+ return DOM.asOld((Element) getCellFormatter().getElement(0, 2)
+ .getChild(0));
}
return null;
}
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
public ApplicationConnection client;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element errorIndicatorElement;
+ public Element errorIndicatorElement;
/** For internal use only. May be removed or replaced in the future. */
public Icon icon;
public VCheckBox() {
setStyleName(CLASSNAME);
- com.google.gwt.user.client.Element el = DOM.getFirstChild(getElement());
+ Element el = DOM.getFirstChild(getElement());
while (el != null) {
DOM.sinkEvents(el,
(DOM.getEventsSunk(el) | VTooltip.TOOLTIP_EVENTS));
*
* @return Element of the CheckBox itself
*/
- private com.google.gwt.user.client.Element getCheckBoxElement() {
+ private Element getCheckBoxElement() {
// FIXME: Would love to use a better way to access the checkbox element
- return (com.google.gwt.user.client.Element) getElement()
- .getFirstChildElement();
+ return getElement().getFirstChildElement();
}
@Override
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.TableSectionElement;
private int top;
- private com.google.gwt.user.client.Element focusedElement;
+ private Element focusedElement;
private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor(100,
new ScheduledCommand() {
addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
- com.google.gwt.user.client.Element currentFocus = Util
- .getFocusedElement();
+ Element currentFocus = Util.getFocusedElement();
if (focusedElement != null
&& (currentFocus == null
|| menu.getElement().isOrHasChild(currentFocus) || RootPanel
import java.util.HashMap;
import java.util.Iterator;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.Style;
public static final String CLASSNAME = "v-customlayout";
/** Location-name to containing element in DOM map */
- private final HashMap<String, com.google.gwt.user.client.Element> locationToElement = new HashMap<String, com.google.gwt.user.client.Element>();
+ private final HashMap<String, Element> locationToElement = new HashMap<String, Element>();
/** Location-name to contained widget map */
final HashMap<String, Widget> locationToWidget = new HashMap<String, Widget>();
private boolean htmlInitialized = false;
- private com.google.gwt.user.client.Element elementWithNativeResizeFunction;
+ private Element elementWithNativeResizeFunction;
private String height = "";
}
// If no given location is found in the layout, and exception is throws
- com.google.gwt.user.client.Element elem = locationToElement
- .get(location);
+ Element elem = locationToElement.get(location);
if (elem == null && hasTemplate()) {
throw new IllegalArgumentException("No location " + location
+ " found");
}
/** Collect locations from template */
- private void scanForLocations(com.google.gwt.user.client.Element elem) {
+ private void scanForLocations(Element elem) {
final String location = elem.getAttribute("location");
if (!"".equals(location)) {
* parent about possible size change.
*/
private void initImgElements() {
- NodeList<com.google.gwt.dom.client.Element> nodeList = getElement()
- .getElementsByTagName("IMG");
+ NodeList<Element> nodeList = getElement().getElementsByTagName("IMG");
for (int i = 0; i < nodeList.getLength(); i++) {
- com.google.gwt.dom.client.ImageElement img = (ImageElement) nodeList
- .getItem(i);
- DOM.sinkEvents((com.google.gwt.user.client.Element) img.cast(),
- Event.ONLOAD);
+ ImageElement img = ImageElement.as(nodeList.getItem(i));
+ DOM.sinkEvents(img, Event.ONLOAD);
}
}
}
}
- private native void detachResizedFunction(
- com.google.gwt.user.client.Element element)
+ private native void detachResizedFunction(Element element)
/*-{
element.notifyChildrenOfSizeChange = null;
}-*/;
- private native void publishResizedFunction(
- com.google.gwt.user.client.Element element)
+ private native void publishResizedFunction(Element element)
/*-{
var self = this;
element.notifyChildrenOfSizeChange = $entry(function() {
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.TouchStartEvent;
import com.google.gwt.event.dom.client.TouchStartHandler;
import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Widget;
transferable.setDragSource(getConnector());
ComponentConnector paintable = Util.findPaintable(client,
- (com.google.gwt.user.client.Element) event.getEventTarget()
- .cast());
+ Element.as(event.getEventTarget()));
Widget widget = paintable.getWidget();
transferable.setData("component", paintable);
VDragEvent dragEvent = VDragAndDropManager.get().startDrag(
/** For internal use only. May be removed or replaced in the future. */
public ValueMap html5DataFlavors;
- private com.google.gwt.user.client.Element dragStartElement;
+ private Element dragStartElement;
/** For internal use only. May be removed or replaced in the future. */
public void initDragStartMode() {
- com.google.gwt.user.client.Element div = getElement();
+ Element div = getElement();
if (dragStartMode == HTML5) {
if (dragStartElement == null) {
dragStartElement = getDragStartElement();
return ConnectorMap.get(client).getConnector(this);
}
+ /**
+ * @deprecated As of 7.2, call or override
+ * {@link #hookHtml5DragStart(Element)} instead
+ */
+ @Deprecated
protected native void hookHtml5DragStart(
com.google.gwt.user.client.Element el)
/*-{
}), false);
}-*/;
+ /**
+ * @since 7.2
+ */
+ protected void hookHtml5DragStart(Element el) {
+ hookHtml5DragStart(DOM.asOld(el));
+ }
+
/**
* Prototype code, memory leak risk.
*
* @param el
+ * @deprecated As of 7.2, call or override {@link #hookHtml5Events(Element)}
+ * instead
*/
+ @Deprecated
protected native void hookHtml5Events(com.google.gwt.user.client.Element el)
/*-{
var me = this;
}), false);
}-*/;
+ /**
+ * Prototype code, memory leak risk.
+ *
+ * @param el
+ *
+ * @since 7.2
+ */
+ protected void hookHtml5Events(Element el) {
+ hookHtml5Events(DOM.asOld(el));
+ }
+
public boolean updateDropDetails(VDragEvent drag) {
VerticalDropLocation oldVL = verticalDropLocation;
verticalDropLocation = DDUtil.getVerticalDropLocation(getElement(),
import com.google.gwt.dom.client.AnchorElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
import com.vaadin.client.VConsole;
public class VDragAndDropWrapperIE extends VDragAndDropWrapper {
@Override
protected com.google.gwt.user.client.Element getDragStartElement() {
VConsole.log("IE get drag start element...");
- com.google.gwt.user.client.Element div = getElement();
+ Element div = getElement();
if (dragStartMode == HTML5) {
if (anchor == null) {
anchor = Document.get().createAnchorElement();
div.appendChild(anchor);
}
VConsole.log("IE get drag start element...");
- return (com.google.gwt.user.client.Element) anchor.cast();
+ return anchor.cast();
} else {
if (anchor != null) {
div.removeChild(anchor);
anchor = null;
}
- return div;
+ return DOM.asOld(div);
}
}
+ @Deprecated
@Override
protected native void hookHtml5DragStart(
com.google.gwt.user.client.Element el)
}));
}-*/;
+ @Override
+ protected void hookHtml5DragStart(Element el) {
+ hookHtml5DragStart(DOM.asOld(el));
+ }
+
+ @Deprecated
@Override
protected native void hookHtml5Events(com.google.gwt.user.client.Element el)
/*-{
}));
}-*/;
+ @Override
+ protected void hookHtml5Events(Element el) {
+ hookHtml5Events(DOM.asOld(el));
+ }
+
}
import java.util.Iterator;
import java.util.Map;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTML;
public static String CLASSNAME = "v-embedded";
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element browserElement;
+ public Element browserElement;
/** For internal use only. May be removed or replaced in the future. */
public String type;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Unit;
/** For internal use only. May be removed or replaced in the future. */
public final SuggestionMenu menu;
- private final com.google.gwt.user.client.Element up = DOM.createDiv();
- private final com.google.gwt.user.client.Element down = DOM.createDiv();
- private final com.google.gwt.user.client.Element status = DOM
- .createDiv();
+ private final Element up = DOM.createDiv();
+ private final Element down = DOM.createDiv();
+ private final Element status = DOM.createDiv();
private boolean isPagingEnabled = true;
getElement().getStyle().setZIndex(Z_INDEX);
- final com.google.gwt.user.client.Element root = getContainerElement();
+ final Element root = getContainerElement();
up.setInnerHTML("<span>Prev</span>");
DOM.sinkEvents(up, Event.ONCLICK);
public void onBrowserEvent(Event event) {
debug("VFS.SP: onBrowserEvent()");
if (event.getTypeInt() == Event.ONCLICK) {
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ final Element target = DOM.eventGetTarget(event);
if (target == up || target == DOM.getChild(up, 0)) {
lazyPageScroller.scrollUp();
} else if (target == down || target == DOM.getChild(down, 0)) {
offsetHeight = getOffsetHeight();
final int desiredWidth = getMainWidth();
- com.google.gwt.user.client.Element menuFirstChild = menu
- .getElement().getFirstChildElement().cast();
+ Element menuFirstChild = menu.getElement().getFirstChildElement();
int naturalMenuWidth = menuFirstChild.getOffsetWidth();
if (popupOuterPadding == -1) {
return null;
}
- com.google.gwt.user.client.Element menuItemRoot = subElement;
+ Element menuItemRoot = subElement;
while (menuItemRoot != null
&& !menuItemRoot.getTagName().equalsIgnoreCase("td")) {
menuItemRoot = menuItemRoot.getParentElement().cast();
*/
preventNextBlurEventInIE = false;
- com.google.gwt.user.client.Element focusedElement = Util
- .getIEFocusedElement();
+ Element focusedElement = Util.getIEFocusedElement();
if (getElement().isOrHasChild(focusedElement)
|| suggestionPopup.getElement()
.isOrHasChild(focusedElement)) {
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.event.shared.HandlerRegistration;
public Widget lo;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element legend = DOM.createLegend();
+ public Element legend = DOM.createLegend();
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element caption = DOM.createSpan();
+ public Element caption = DOM.createSpan();
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element desc = DOM.createDiv();
+ public Element desc = DOM.createDiv();
/** For internal use only. May be removed or replaced in the future. */
public Icon icon;
public VErrorMessage errorMessage = new VErrorMessage();
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element fieldContainer = DOM.createDiv();
+ public Element fieldContainer = DOM.createDiv();
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element footerContainer = DOM.createDiv();
+ public Element footerContainer = DOM.createDiv();
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element fieldSet = DOM.createFieldSet();
+ public Element fieldSet = DOM.createFieldSet();
/** For internal use only. May be removed or replaced in the future. */
public Widget footer;
}
lo = newLayoutWidget;
}
-
- /** For internal use only. May be removed or replaced in the future. */
- @Override
- public void add(Widget child, com.google.gwt.user.client.Element container) {
- super.add(child, container);
- }
}
import java.util.List;
import com.google.gwt.aria.client.Roles;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
}
public void setMargins(MarginInfo margins) {
- com.google.gwt.user.client.Element margin = getElement();
+ Element margin = getElement();
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP,
margins.hasTop());
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT,
private final ComponentConnector owner;
- private com.google.gwt.user.client.Element requiredFieldIndicator;
+ private Element requiredFieldIndicator;
private Icon icon;
- private com.google.gwt.user.client.Element captionText;
+ private Element captionText;
/**
*
public class ErrorFlag extends HTML {
private static final String CLASSNAME = VFormLayout.CLASSNAME
+ "-error-indicator";
- com.google.gwt.user.client.Element errorIndicatorElement;
+ Element errorIndicatorElement;
private ComponentConnector owner;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
void layoutCellsVertically() {
int verticalSpacing = getVerticalSpacing();
LayoutManager layoutManager = LayoutManager.get(client);
- com.google.gwt.user.client.Element element = getElement();
+ Element element = getElement();
int paddingTop = layoutManager.getPaddingTop(element);
int paddingBottom = layoutManager.getPaddingBottom(element);
void layoutCellsHorizontally() {
LayoutManager layoutManager = LayoutManager.get(client);
- com.google.gwt.user.client.Element element = getElement();
+ Element element = getElement();
int x = layoutManager.getPaddingLeft(element);
int paddingRight = layoutManager.getPaddingRight(element);
int horizontalSpacing = getHorizontalSpacing();
if (component.isRelativeWidth()) {
slot.getWrapperElement().getStyle().setWidth(100, Unit.PCT);
}
- com.google.gwt.user.client.Element slotWrapper = slot
- .getWrapperElement();
+ Element slotWrapper = slot.getWrapperElement();
getElement().appendChild(slotWrapper);
Widget widget = component.getWidget();
* this layout
* @return The Paintable which the element is a part of. Null if the element
* belongs to the layout and not to a child.
+ * @deprecated As of 7.2, call or override {@link #getComponent(Element)}
+ * instead
*/
+ @Deprecated
public ComponentConnector getComponent(
com.google.gwt.user.client.Element element) {
return Util.getConnectorForElement(client, this, element);
+
+ }
+
+ /**
+ * Returns the deepest nested child component which contains "element". The
+ * child component is also returned if "element" is part of its caption.
+ * <p>
+ * For internal use only. May be removed or replaced in the future.
+ *
+ * @param element
+ * An element that is a nested sub element of the root element in
+ * this layout
+ * @return The Paintable which the element is a part of. Null if the element
+ * belongs to the layout and not to a child.
+ *
+ * @since 7.2
+ */
+ public ComponentConnector getComponent(Element element) {
+ return getComponent(DOM.asOld(element));
}
/** For internal use only. May be removed or replaced in the future. */
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
public int targetHeight;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element errorIndicatorElement;
+ public Element errorIndicatorElement;
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element anchor = DOM.createAnchor();
+ public final Element anchor = DOM.createAnchor();
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element captionElement = DOM
- .createSpan();
+ public final Element captionElement = DOM.createSpan();
/** For internal use only. May be removed or replaced in the future. */
public Icon icon;
@Override
public void onBrowserEvent(Event event) {
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ final Element target = DOM.eventGetTarget(event);
if (event.getTypeInt() == Event.ONLOAD) {
Util.notifyParentOfSizeChange(this, true);
}
package com.vaadin.client.ui;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.MediaElement;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.SourceElement;
}
public void addSource(String sourceUrl, String sourceType) {
- com.google.gwt.user.client.Element src = Document.get()
- .createElement(SourceElement.TAG).cast();
+ Element src = Document.get().createElement(SourceElement.TAG);
src.setAttribute("src", sourceUrl);
src.setAttribute("type", sourceType);
media.appendChild(src);
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Unit;
/** Widget fields **/
protected boolean subMenu;
protected ArrayList<CustomMenuItem> items;
- protected com.google.gwt.user.client.Element containerElement;
+ protected Element containerElement;
protected VOverlay popup;
protected VMenuBar visibleChildMenu;
protected boolean menuVisible = false;
* Remove all the items in this menu
*/
public void clearItems() {
- com.google.gwt.user.client.Element e = getContainerElement();
+ Element e = getContainerElement();
while (DOM.getChildCount(e) > 0) {
DOM.removeChild(e, DOM.getChild(e, 0));
}
*/
@Override
public com.google.gwt.user.client.Element getContainerElement() {
- return containerElement;
+ return DOM.asOld(containerElement);
}
/**
return;
}
- com.google.gwt.user.client.Element targetElement = DOM
- .eventGetTarget(e);
+ Element targetElement = DOM.eventGetTarget(e);
CustomMenuItem targetItem = null;
for (int i = 0; i < items.size(); i++) {
CustomMenuItem item = items.get(i);
return null;
}
- com.google.gwt.user.client.Element menuItemRoot = subElement;
+ Element menuItemRoot = subElement;
while (menuItemRoot != null && menuItemRoot.getParentElement() != null
&& menuItemRoot.getParentElement() != getElement()) {
menuItemRoot = menuItemRoot.getParentElement().cast();
* @param element
* Element used in search
* @return Menu item or null if not found
+ * @deprecated As of 7.2, call or override
+ * {@link #getMenuItemWithElement(Element)} instead
*/
+ @Deprecated
public CustomMenuItem getMenuItemWithElement(
com.google.gwt.user.client.Element element) {
for (int i = 0; i < items.size(); i++) {
return null;
}
+
+ /**
+ * Get menu item with given DOM element
+ *
+ * @param element
+ * Element used in search
+ * @return Menu item or null if not found
+ *
+ * @since 7.2
+ */
+ public CustomMenuItem getMenuItemWithElement(Element element) {
+ return getMenuItemWithElement(DOM.asOld(element));
+ }
}
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
}
public void setPosition(com.vaadin.shared.Position position) {
- final com.google.gwt.user.client.Element el = getElement();
+ final Element el = getElement();
DOM.setStyleAttribute(el, "top", "");
DOM.setStyleAttribute(el, "left", "");
DOM.setStyleAttribute(el, "bottom", "");
}
}
- private void setOpacity(com.google.gwt.user.client.Element el, int opacity) {
+ private void setOpacity(Element el, int opacity) {
DOM.setStyleAttribute(el, "opacity", "" + (opacity / 100.0));
if (BrowserInfo.get().isIE()) {
DOM.setStyleAttribute(el, "filter", "Alpha(opacity=" + opacity
import com.google.gwt.animation.client.Animation;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.IFrameElement;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.BorderStyle;
/*
* The shadow element for this overlay.
*/
- private com.google.gwt.user.client.Element shadow;
+ private Element shadow;
/*
* The creator of this VOverlay (the widget that made the instance, not the
// Animate the size
positionAndSize.setAnimationFromCenterProgress(progress);
- com.google.gwt.user.client.Element container = getElement()
- .getParentElement().cast();
+ Element container = getElement().getParentElement();
if (isShadowEnabled()) {
updateShadowPosition(progress, zIndex, positionAndSize);
}
private void updateShimPosition(PositionAndSize positionAndSize) {
- updatePositionAndSize(
- (com.google.gwt.user.client.Element) com.google.gwt.user.client.Element
- .as(getShimElement()), positionAndSize);
+ updatePositionAndSize(getShimElement(), positionAndSize);
}
/**
return info.isIE() && info.isBrowserVersionNewerOrEqual(8, 0);
}
- private void updatePositionAndSize(com.google.gwt.user.client.Element e,
+ private void updatePositionAndSize(Element e,
PositionAndSize positionAndSize) {
e.getStyle().setLeft(positionAndSize.getLeft(), Unit.PX);
e.getStyle().setTop(positionAndSize.getTop(), Unit.PX);
ApplicationConnection ac) {
String id = ac.getConfiguration().getRootPanelId();
id = id += "-overlays";
- com.google.gwt.user.client.Element container = DOM.getElementById(id);
+ Element container = DOM.getElementById(id);
if (container == null) {
container = DOM.createDiv();
container.setId(id);
container.addClassName(CLASSNAME_CONTAINER);
RootPanel.get().getElement().appendChild(container);
}
- return container;
+ return DOM.asOld(container);
}
/**
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.SimplePanel;
public String id;
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element captionNode = DOM
- .createDiv();
+ public final Element captionNode = DOM.createDiv();
- private final com.google.gwt.user.client.Element captionText = DOM
- .createSpan();
+ private final Element captionText = DOM.createSpan();
private Icon icon;
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element bottomDecoration = DOM
- .createDiv();
+ public final Element bottomDecoration = DOM.createDiv();
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element contentNode = DOM
- .createDiv();
+ public final Element contentNode = DOM.createDiv();
- private com.google.gwt.user.client.Element errorIndicatorElement;
+ private Element errorIndicatorElement;
/** For internal use only. May be removed or replaced in the future. */
public ShortcutActionHandler shortcutHandler;
@Override
protected com.google.gwt.user.client.Element getContainerElement() {
- return contentNode;
+ return DOM.asOld(contentNode);
}
/** For internal use only. May be removed or replaced in the future. */
import com.google.gwt.aria.client.LiveValue;
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.DomEvent;
private Label selectedDate;
- private com.google.gwt.user.client.Element descriptionForAssisitveDevicesElement;
+ private Element descriptionForAssisitveDevicesElement;
public VPopupCalendar() {
super();
import java.util.Iterator;
import java.util.Set;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
super.onDetach();
}
- private static native void nativeBlur(com.google.gwt.user.client.Element e)
+ private static native void nativeBlur(Element e)
/*-{
if(e && e.blur) {
e.blur();
private boolean hasHadMouseOver = false;
private boolean hideOnMouseOut = true;
- private final Set<com.google.gwt.user.client.Element> activeChildren = new HashSet<com.google.gwt.user.client.Element>();
+ private final Set<Element> activeChildren = new HashSet<Element>();
private ShortcutActionHandler shortcutActionHandler;
// to use ONMOUSEMOVE that doesn't target the popup
@Override
public boolean onEventPreview(Event event) {
- com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ Element target = DOM.eventGetTarget(event);
boolean eventTargetsPopup = DOM.isOrHasChild(getElement(), target);
int type = DOM.eventGetType(event);
}
// Notify children that have used the keyboard
- for (com.google.gwt.user.client.Element e : activeChildren) {
+ for (Element e : activeChildren) {
try {
nativeBlur(e);
} catch (Exception ignored) {
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.HasEnabled;
*/
public class VProgressBar extends Widget implements HasEnabled {
- com.google.gwt.user.client.Element wrapper = DOM.createDiv();
- com.google.gwt.user.client.Element indicator = DOM.createDiv();
+ Element wrapper = DOM.createDiv();
+ Element indicator = DOM.createDiv();
private boolean indeterminate = false;
private float state = 0.0f;
import java.util.Map.Entry;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.event.dom.client.KeyDownHandler;
* Detects space used by components paddings and borders.
*/
private void detectExtraSizes() {
- com.google.gwt.user.client.Element clone = Util.cloneNode(getElement(),
- false);
+ Element clone = Util.cloneNode(getElement(), false);
DOM.setElementAttribute(clone, "id", "");
DOM.setStyleAttribute(clone, "visibility", "hidden");
DOM.setStyleAttribute(clone, "position", "absolute");
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.NodeList;
private final HashMap<Object, String> actionMap = new HashMap<Object, String>();
private String[] visibleColOrder;
private boolean initialContentReceived = false;
- private com.google.gwt.user.client.Element scrollPositionElement;
+ private Element scrollPositionElement;
/** For internal use only. May be removed or replaced in the future. */
public boolean enabled;
super.onDetach();
// ensure that scrollPosElement will be detached
if (scrollPositionElement != null) {
- final com.google.gwt.user.client.Element parent = DOM
- .getParent(scrollPositionElement);
+ final Element parent = DOM.getParent(scrollPositionElement);
if (parent != null) {
DOM.removeChild(parent, scrollPositionElement);
}
public class HeaderCell extends Widget {
- com.google.gwt.user.client.Element td = DOM.createTD();
+ Element td = DOM.createTD();
- com.google.gwt.user.client.Element captionContainer = DOM.createDiv();
+ Element captionContainer = DOM.createDiv();
- com.google.gwt.user.client.Element sortIndicator = DOM.createDiv();
+ Element sortIndicator = DOM.createDiv();
- com.google.gwt.user.client.Element colResizeWidget = DOM.createDiv();
+ Element colResizeWidget = DOM.createDiv();
- com.google.gwt.user.client.Element floatingCopyOfHeaderCell;
+ Element floatingCopyOfHeaderCell;
private boolean sortable = false;
private final String cid;
HashMap<String, HeaderCell> availableCells = new HashMap<String, HeaderCell>();
- com.google.gwt.user.client.Element div = DOM.createDiv();
- com.google.gwt.user.client.Element hTableWrapper = DOM.createDiv();
- com.google.gwt.user.client.Element hTableContainer = DOM.createDiv();
- com.google.gwt.user.client.Element table = DOM.createTable();
- com.google.gwt.user.client.Element headerTableBody = DOM.createTBody();
- com.google.gwt.user.client.Element tr = DOM.createTR();
+ Element div = DOM.createDiv();
+ Element hTableWrapper = DOM.createDiv();
+ Element hTableContainer = DOM.createDiv();
+ Element table = DOM.createTable();
+ Element headerTableBody = DOM.createTBody();
+ Element tr = DOM.createTR();
- private final com.google.gwt.user.client.Element columnSelector = DOM
- .createDiv();
+ private final Element columnSelector = DOM.createDiv();
private int focusedSlot = -1;
public void moveCell(int oldIndex, int newIndex) {
final HeaderCell hCell = getHeaderCell(oldIndex);
- final com.google.gwt.user.client.Element cell = hCell.getElement();
+ final Element cell = hCell.getElement();
visibleCells.remove(oldIndex);
DOM.removeChild(tr, cell);
private void focusSlot(int index) {
removeSlotFocus();
if (index > 0) {
- com.google.gwt.user.client.Element child = tr
- .getChild(index - 1).getFirstChild().cast();
+ Element child = tr.getChild(index - 1).getFirstChild().cast();
child.setClassName(VScrollTable.this.getStylePrimaryName()
+ "-resizer");
child.addClassName(VScrollTable.this.getStylePrimaryName()
+ "-focus-slot-right");
} else {
- com.google.gwt.user.client.Element child = tr.getChild(index)
- .getFirstChild().cast();
+ Element child = tr.getChild(index).getFirstChild().cast();
child.setClassName(VScrollTable.this.getStylePrimaryName()
+ "-resizer");
child.addClassName(VScrollTable.this.getStylePrimaryName()
return;
}
if (focusedSlot == 0) {
- com.google.gwt.user.client.Element child = tr
- .getChild(focusedSlot).getFirstChild().cast();
+ Element child = tr.getChild(focusedSlot).getFirstChild().cast();
child.setClassName(VScrollTable.this.getStylePrimaryName()
+ "-resizer");
} else if (focusedSlot > 0) {
- com.google.gwt.user.client.Element child = tr
- .getChild(focusedSlot - 1).getFirstChild().cast();
+ Element child = tr.getChild(focusedSlot - 1).getFirstChild()
+ .cast();
child.setClassName(VScrollTable.this.getStylePrimaryName()
+ "-resizer");
}
* A cell in the footer
*/
public class FooterCell extends Widget {
- private final com.google.gwt.user.client.Element td = DOM.createTD();
- private final com.google.gwt.user.client.Element captionContainer = DOM
- .createDiv();
+ private final Element td = DOM.createTD();
+ private final Element captionContainer = DOM.createDiv();
private char align = ALIGN_LEFT;
private int width = -1;
private float expandRatio = 0;
// value (greater of header and data
// cols)
- final int hw = ((com.google.gwt.user.client.Element) getElement()
- .getLastChild()).getOffsetWidth()
- + getHeaderPadding();
+ final int hw = ((Element) getElement().getLastChild())
+ .getOffsetWidth() + getHeaderPadding();
if (columnIndex < 0) {
columnIndex = 0;
for (Iterator<Widget> it = tHead.iterator(); it
ArrayList<Widget> visibleCells = new ArrayList<Widget>();
HashMap<String, FooterCell> availableCells = new HashMap<String, FooterCell>();
- com.google.gwt.user.client.Element div = DOM.createDiv();
- com.google.gwt.user.client.Element hTableWrapper = DOM.createDiv();
- com.google.gwt.user.client.Element hTableContainer = DOM.createDiv();
- com.google.gwt.user.client.Element table = DOM.createTable();
- com.google.gwt.user.client.Element headerTableBody = DOM.createTBody();
- com.google.gwt.user.client.Element tr = DOM.createTR();
+ Element div = DOM.createDiv();
+ Element hTableWrapper = DOM.createDiv();
+ Element hTableContainer = DOM.createDiv();
+ Element table = DOM.createTable();
+ Element headerTableBody = DOM.createTBody();
+ Element tr = DOM.createTR();
public TableFooter() {
*/
public void moveCell(int oldIndex, int newIndex) {
final FooterCell hCell = getFooterCell(oldIndex);
- final com.google.gwt.user.client.Element cell = hCell.getElement();
+ final Element cell = hCell.getElement();
visibleCells.remove(oldIndex);
DOM.removeChild(tr, cell);
*/
private boolean tBodyMeasurementsDone = false;
- com.google.gwt.user.client.Element preSpacer = DOM.createDiv();
- com.google.gwt.user.client.Element postSpacer = DOM.createDiv();
+ Element preSpacer = DOM.createDiv();
+ Element postSpacer = DOM.createDiv();
- com.google.gwt.user.client.Element container = DOM.createDiv();
+ Element container = DOM.createDiv();
TableSectionElement tBodyElement = Document.get().createTBodyElement();
- com.google.gwt.user.client.Element table = DOM.createTable();
+ Element table = DOM.createTable();
private int firstRendered;
private int lastRendered;
if (BrowserInfo.get().requiresTouchScrollDelegate()) {
NodeList<Node> childNodes = container.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
- com.google.gwt.user.client.Element item = (com.google.gwt.user.client.Element) childNodes
- .getItem(i);
+ Element item = (Element) childNodes.getItem(i);
item.getStyle().setProperty("webkitTransform",
"translate3d(0,0,0)");
}
for (Widget row : renderedRows) {
if (!(row instanceof VScrollTableGeneratedRow)) {
TableRowElement tr = row.getElement().cast();
- com.google.gwt.user.client.Element wrapperdiv = tr
- .getCells().getItem(columnIndex)
+ Element wrapperdiv = tr.getCells().getItem(columnIndex)
.getFirstChildElement().cast();
return wrapperdiv.getOffsetWidth();
}
while (rows.hasNext()) {
final VScrollTableRow row = (VScrollTableRow) rows.next();
- final com.google.gwt.user.client.Element td = DOM.getChild(
- row.getElement(), oldIndex);
+ final Element td = DOM.getChild(row.getElement(), oldIndex);
if (td != null) {
DOM.removeChild(row.getElement(), td);
}
protected void setCellWidth(int cellIx, int width) {
- final com.google.gwt.user.client.Element cell = DOM.getChild(
- getElement(), cellIx);
+ final Element cell = DOM.getChild(getElement(), cellIx);
Style wrapperStyle = cell.getFirstChildElement().getStyle();
int wrapperWidth = width;
if (BrowserInfo.get().isWebkit()
protected void initCellWithText(String text, char align,
String style, boolean textIsHTML, boolean sorted,
String description, final TableCellElement td) {
- final com.google.gwt.user.client.Element container = DOM
- .createDiv();
+ final Element container = DOM.createDiv();
container.setClassName(VScrollTable.this.getStylePrimaryName()
+ "-cell-wrapper");
protected void updateCellStyleNames(TableCellElement td,
String primaryStyleName) {
- com.google.gwt.user.client.Element container = td
- .getFirstChild().cast();
+ Element container = td.getFirstChild().cast();
container.setClassName(primaryStyleName + "-cell-wrapper");
/*
protected void initCellWithWidget(Widget w, char align,
String style, boolean sorted, final TableCellElement td) {
- final com.google.gwt.user.client.Element container = DOM
- .createDiv();
+ final Element container = DOM.createDiv();
String className = VScrollTable.this.getStylePrimaryName()
+ "-cell-content";
if (style != null && !style.equals("")) {
* Whether the event is sent immediately
* @return Whether a click event was sent
*/
- private boolean handleClickEvent(Event event,
- com.google.gwt.user.client.Element targetTdOrTr,
+ private boolean handleClickEvent(Event event, Element targetTdOrTr,
boolean immediate) {
if (!client.hasEventListeners(VScrollTable.this,
TableConstants.ITEM_CLICK_EVENT_ID)) {
com.google.gwt.dom.client.Element target) {
TooltipInfo info = null;
- final com.google.gwt.user.client.Element targetTdOrTr = getTdOrTr((com.google.gwt.user.client.Element) target
- .cast());
+ final Element targetTdOrTr = getTdOrTr(target);
if (targetTdOrTr != null
&& "td".equals(targetTdOrTr.getTagName().toLowerCase())) {
TableCellElement td = (TableCellElement) targetTdOrTr
return info;
}
- private com.google.gwt.user.client.Element getTdOrTr(
- com.google.gwt.user.client.Element target) {
- com.google.gwt.user.client.Element thisTrElement = getElement();
+ private Element getTdOrTr(Element target) {
+ Element thisTrElement = getElement();
if (target == thisTrElement) {
// This was a on the TR element
return target;
}
// Iterate upwards until we find the TR element
- com.google.gwt.user.client.Element element = target;
+ Element element = target;
while (element != null
- && element.getParentElement().cast() != thisTrElement) {
- element = element.getParentElement().cast();
+ && element.getParentElement() != thisTrElement) {
+ element = element.getParentElement();
}
return element;
}
boolean touchEventHandled = false;
if (enabled && hasNativeTouchScrolling) {
- final com.google.gwt.user.client.Element targetTdOrTr = getEventTargetTdOrTr(event);
+ final Element targetTdOrTr = getEventTargetTdOrTr(event);
final int type = event.getTypeInt();
switch (type) {
if (enabled && !touchEventHandled) {
final int type = event.getTypeInt();
- final com.google.gwt.user.client.Element targetTdOrTr = getEventTargetTdOrTr(event);
+ final Element targetTdOrTr = getEventTargetTdOrTr(event);
if (type == Event.ONCONTEXTMENU) {
showContextMenu(event);
if (enabled
// Remove IE text selection hack
if (BrowserInfo.get().isIE()) {
- ((com.google.gwt.user.client.Element) event
- .getEventTarget().cast())
+ ((Element) event.getEventTarget().cast())
.setPropertyJSO("onselectstart",
null);
}
// Prevent default text selection in IE
if (BrowserInfo.get().isIE()) {
- ((com.google.gwt.user.client.Element) event
- .getEventTarget().cast())
+ ((Element) event.getEventTarget().cast())
.setPropertyJSO(
"onselectstart",
getPreventTextSelectionIEHack());
}
protected void startRowDrag(Event event, final int type,
- com.google.gwt.user.client.Element targetTdOrTr) {
+ Element targetTdOrTr) {
VTransferable transferable = new VTransferable();
transferable.setDragSource(ConnectorMap.get(client)
.getConnector(VScrollTable.this));
&& rowKeyIsSelected(rowKey)) {
// Create a drag image of ALL rows
- ev.createDragImage(
- (com.google.gwt.user.client.Element) scrollBody.tBodyElement
- .cast(), true);
+ ev.createDragImage(scrollBody.tBodyElement, true);
// Hide rows which are not selected
- com.google.gwt.user.client.Element dragImage = ev
- .getDragImage();
+ Element dragImage = ev.getDragImage();
int i = 0;
for (Iterator<Widget> iterator = scrollBody.iterator(); iterator
.hasNext();) {
VScrollTableRow next = (VScrollTableRow) iterator
.next();
- com.google.gwt.user.client.Element child = (com.google.gwt.user.client.Element) dragImage
- .getChild(i++);
+ Element child = (Element) dragImage.getChild(i++);
if (!rowKeyIsSelected(next.rowKey)) {
child.getStyle().setVisibility(Visibility.HIDDEN);
* @return TD or TR element that the event targets (the actual event
* target is this element or a child of it)
*/
- private com.google.gwt.user.client.Element getEventTargetTdOrTr(
- Event event) {
- final com.google.gwt.user.client.Element eventTarget = event
- .getEventTarget().cast();
+ private Element getEventTargetTdOrTr(Event event) {
+ final Element eventTarget = event.getEventTarget().cast();
Widget widget = Util.findWidget(eventTarget, null);
if (widget != this) {
.getVisibleCellCount(); ix++) {
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth();
}
- Util.setWidthExcludingPaddingAndBorder(
- (com.google.gwt.user.client.Element) getElement()
- .getChild(cellIx), spanWidth, 13, false);
+ Util.setWidthExcludingPaddingAndBorder((Element) getElement()
+ .getChild(cellIx), spanWidth, 13, false);
}
}
private void updateDropDetails(VDragEvent drag) {
dropDetails = new TableDDDetails();
- com.google.gwt.user.client.Element elementOver = drag
- .getElementOver();
+ Element elementOver = drag.getElementOver();
VScrollTableRow row = Util.findWidget(elementOver, getRowClass());
if (row != null) {
dropDetails.overkey = row.rowKey;
- com.google.gwt.user.client.Element tr = row.getElement();
- com.google.gwt.user.client.Element element = elementOver;
+ Element tr = row.getElement();
+ Element element = elementOver;
while (element != null && element.getParentElement() != tr) {
- element = (com.google.gwt.user.client.Element) element
- .getParentElement();
+ element = element.getParentElement();
}
int childIndex = DOM.getChildIndex(tr, element);
dropDetails.colkey = tHead.getHeaderCell(childIndex)
* ...and sometimes it sends blur events even though the focus
* handler is still active. (#10464)
*/
- com.google.gwt.user.client.Element focusedElement = Util
- .getIEFocusedElement();
+ Element focusedElement = Util.getIEFocusedElement();
if (Util.getConnectorForElement(client, getParent(), focusedElement) == this
&& focusedElement != null
&& focusedElement != scrollBodyPanel.getFocusElement()) {
int colIx = Integer.valueOf(result.getGroup(2));
VScrollTableRow row = scrollBody.getRowByRowIndex(rowIx);
if (row != null) {
- com.google.gwt.user.client.Element rowElement = row
- .getElement();
+ Element rowElement = row.getElement();
if (colIx < rowElement.getChildCount()) {
return rowElement.getChild(colIx).getFirstChild().cast();
}
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Unit;
};
/* DOM element for slider's base */
- private final com.google.gwt.user.client.Element base;
+ private final Element base;
private final int BASE_BORDER_WIDTH = 1;
/* DOM element for slider's handle */
- private final com.google.gwt.user.client.Element handle;
+ private final Element handle;
/* DOM element for decrement arrow */
- private final com.google.gwt.user.client.Element smaller;
+ private final Element smaller;
/* DOM element for increment arrow */
- private final com.google.gwt.user.client.Element bigger;
+ private final Element bigger;
/* Temporary dragging/animation variables */
private boolean dragging = false;
return;
}
- final com.google.gwt.user.client.Element p = getElement()
- .getParentElement().cast();
+ final Element p = getElement().getParentElement();
if (p.getPropertyInt(domProperty) > 50) {
if (isVertical()) {
setHeight();
@Override
public void execute() {
- final com.google.gwt.user.client.Element p = getElement()
- .getParentElement().cast();
+ final Element p = getElement().getParentElement();
if (p.getPropertyInt(domProperty) > (MIN_SIZE + 5)) {
if (isVertical()) {
setHeight();
if (disabled || readonly) {
return;
}
- final com.google.gwt.user.client.Element targ = DOM
- .eventGetTarget(event);
+ final Element targ = DOM.eventGetTarget(event);
if (DOM.eventGetType(event) == Event.ONMOUSEWHEEL) {
processMouseWheelEvent(event);
import com.google.gwt.aria.client.SelectedValue;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Visibility;
import com.google.gwt.dom.client.TableCellElement;
+ "-focus";
private TabCaption tabCaption;
- com.google.gwt.user.client.Element td = getElement();
+ Element td = getElement();
private VCloseHandler closeHandler;
private boolean enabledOnServer = true;
- private com.google.gwt.user.client.Element div;
+ private Element div;
private TabBar tabBar;
private boolean hiddenOnServer = false;
@Override
protected com.google.gwt.user.client.Element getContainerElement() {
// Attach caption element to div, not td
- return div;
+ return DOM.asOld(div);
}
public boolean isEnabledOnServer() {
public static class TabCaption extends VCaption {
private boolean closable = false;
- private com.google.gwt.user.client.Element closeButton;
+ private Element closeButton;
private Tab tab;
TabCaption(Tab tab, ApplicationConnection client) {
}
public com.google.gwt.user.client.Element getCloseButton() {
- return closeButton;
+ return DOM.asOld(closeButton);
}
}
static class TabBar extends ComplexPanel implements ClickHandler,
VCloseHandler {
- private final com.google.gwt.user.client.Element tr = DOM.createTR();
+ private final Element tr = DOM.createTR();
- private final com.google.gwt.user.client.Element spacerTd = DOM
- .createTD();
+ private final Element spacerTd = DOM.createTD();
private Tab selected;
TabBar(VTabsheet tabsheet) {
this.tabsheet = tabsheet;
- com.google.gwt.user.client.Element el = DOM.createTable();
+ Element el = DOM.createTable();
Roles.getPresentationRole().set(el);
- com.google.gwt.user.client.Element tbody = DOM.createTBody();
+ Element tbody = DOM.createTBody();
DOM.appendChild(el, tbody);
DOM.appendChild(tbody, tr);
setStyleName(spacerTd, CLASSNAME + "-spacertd");
}
protected com.google.gwt.user.client.Element getContainerElement() {
- return tr;
+ return DOM.asOld(tr);
}
public int getTabCount() {
@Override
public void onClick(ClickEvent event) {
TabCaption caption = (TabCaption) event.getSource();
- com.google.gwt.user.client.Element targetElement = event
- .getNativeEvent().getEventTarget().cast();
+ Element targetElement = event.getNativeEvent().getEventTarget()
+ .cast();
// the tab should not be focused if the close button was clicked
if (targetElement == caption.getCloseButton()) {
return;
/** For internal use only. May be removed or replaced in the future. */
// tabbar and 'scroller' container
- public final com.google.gwt.user.client.Element tabs;
+ public final Element tabs;
Tab focusedTab;
/**
* The tabindex property (position in the browser's focus cycle.) Named like
private static final FocusImpl focusImpl = FocusImpl.getFocusImplForPanel();
// tab-scroller element
- private final com.google.gwt.user.client.Element scroller;
+ private final Element scroller;
// tab-scroller next button element
- private final com.google.gwt.user.client.Element scrollerNext;
+ private final Element scrollerNext;
// tab-scroller prev button element
- private final com.google.gwt.user.client.Element scrollerPrev;
+ private final Element scrollerPrev;
/**
* The index of the first visible tab (when scrolled)
/** For internal use only. May be removed or replaced in the future. */
public final VTabsheetPanel tp = new VTabsheetPanel();
/** For internal use only. May be removed or replaced in the future. */
- public final com.google.gwt.user.client.Element contentNode;
+ public final Element contentNode;
- private final com.google.gwt.user.client.Element deco;
+ private final Element deco;
/** For internal use only. May be removed or replaced in the future. */
public boolean waitingForResponse;
}
private boolean isClippedTabs() {
- return (tb.getOffsetWidth() - DOM.getElementPropertyInt(
- (com.google.gwt.user.client.Element) tb.getContainerElement()
- .getLastChild().cast(), "offsetWidth")) > getOffsetWidth()
+ return (tb.getOffsetWidth() - DOM.getElementPropertyInt((Element) tb
+ .getContainerElement().getLastChild().cast(), "offsetWidth")) > getOffsetWidth()
- (isScrolledTabs() ? scroller.getOffsetWidth() : 0);
}
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
*/
@Override
public void add(Widget w) {
- com.google.gwt.user.client.Element el = createContainerElement();
+ Element el = createContainerElement();
DOM.appendChild(getElement(), el);
super.add(w, el);
}
- private com.google.gwt.user.client.Element createContainerElement() {
- com.google.gwt.user.client.Element el = DOM.createDiv();
+ private Element createContainerElement() {
+ Element el = DOM.createDiv();
DOM.setStyleAttribute(el, "position", "absolute");
hide(el);
touchScrollHandler.addElement(el);
* if <code>beforeIndex</code> is out of range
*/
public void insert(Widget w, int beforeIndex) {
- com.google.gwt.user.client.Element el = createContainerElement();
+ Element el = createContainerElement();
DOM.insertChild(getElement(), el, beforeIndex);
super.insert(w, el, beforeIndex, false);
}
@Override
public boolean remove(Widget w) {
- com.google.gwt.user.client.Element child = w.getElement();
- com.google.gwt.user.client.Element parent = null;
+ Element child = w.getElement();
+ Element parent = null;
if (child != null) {
parent = DOM.getParent(child);
}
unHide(DOM.getParent(visibleWidget.getElement()));
}
- private void hide(com.google.gwt.user.client.Element e) {
+ private void hide(Element e) {
DOM.setStyleAttribute(e, "visibility", "hidden");
DOM.setStyleAttribute(e, "top", "-100000px");
DOM.setStyleAttribute(e, "left", "-100000px");
}
- private void unHide(com.google.gwt.user.client.Element e) {
+ private void unHide(Element e) {
DOM.setStyleAttribute(e, "top", "0px");
DOM.setStyleAttribute(e, "left", "0px");
DOM.setStyleAttribute(e, "visibility", "");
width = minWidth;
}
- com.google.gwt.user.client.Element wrapperDiv = (com.google.gwt.user.client.Element) visibleWidget
- .getElement().getParentElement();
+ Element wrapperDiv = visibleWidget.getElement().getParentElement();
// width first
getElement().getStyle().setPropertyPx("width", width);
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ChangeEvent;
this(DOM.createInputText());
}
- protected VTextField(com.google.gwt.user.client.Element node) {
+ protected VTextField(Element node) {
super(node);
setStyleName(CLASSNAME);
addChangeHandler(this);
}
/** For internal use only. May be removed or replaced in the future. */
- public native void attachCutEventListener(
- com.google.gwt.user.client.Element el)
+ public native void attachCutEventListener(Element el)
/*-{
var me = this;
el.oncut = $entry(function() {
});
}-*/;
- protected native void detachCutEventListener(
- com.google.gwt.user.client.Element el)
+ protected native void detachCutEventListener(Element el)
/*-{
el.oncut = null;
}-*/;
return !"off".equals(wrap);
}
- private native void addOnInputListener(com.google.gwt.user.client.Element el)
+ private native void addOnInputListener(Element el)
/*-{
var self = this;
el.oninput = $entry(function() {
});
}-*/;
- private native void removeOnInputListener(
- com.google.gwt.user.client.Element el)
+ private native void removeOnInputListener(Element el)
/*-{
el.oninput = null;
}-*/;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
import com.google.gwt.event.dom.client.BlurEvent;
if (event.getTypeInt() == Event.ONMOUSEDOWN) {
// Prevent default text selection in IE
if (BrowserInfo.get().isIE()) {
- ((com.google.gwt.user.client.Element) event.getEventTarget()
- .cast()).setPropertyJSO("onselectstart",
- applyDisableTextSelectionIEHack());
+ ((Element) event.getEventTarget().cast()).setPropertyJSO(
+ "onselectstart", applyDisableTextSelectionIEHack());
}
} else if (event.getTypeInt() == Event.ONMOUSEUP) {
// Remove IE text selection hack
if (BrowserInfo.get().isIE()) {
- ((com.google.gwt.user.client.Element) event.getEventTarget()
- .cast()).setPropertyJSO("onselectstart", null);
+ ((Element) event.getEventTarget().cast()).setPropertyJSO(
+ "onselectstart", null);
}
} else if (event.getTypeInt() == Event.ONKEYUP) {
if (selectionHasChanged) {
}
- private String findCurrentMouseOverKey(
- com.google.gwt.user.client.Element elementOver) {
+ private String findCurrentMouseOverKey(Element elementOver) {
TreeNode treeNode = Util.findWidget(elementOver, TreeNode.class);
return treeNode == null ? null : treeNode.key;
}
/** For internal use only. May be removed or replaced in the future. */
public boolean childrenLoaded;
- com.google.gwt.user.client.Element nodeCaptionDiv;
+ Element nodeCaptionDiv;
- protected com.google.gwt.user.client.Element nodeCaptionSpan;
+ protected Element nodeCaptionSpan;
/** For internal use only. May be removed or replaced in the future. */
public FlowPanel childNodeContainer;
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
final int type = DOM.eventGetType(event);
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ final Element target = DOM.eventGetTarget(event);
if (type == Event.ONLOAD && target == icon.getElement()) {
iconLoaded.trigger();
nodeCaptionDiv = DOM.createDiv();
DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME
+ "-caption");
- com.google.gwt.user.client.Element wrapper = DOM.createDiv();
+ Element wrapper = DOM.createDiv();
wrapper.setId(labelId);
wrapper.setAttribute("for", treeItemId);
if (expandCollapse) {
return treeNode.getElement();
} else {
- return treeNode.nodeCaptionSpan;
+ return DOM.asOld(treeNode.nodeCaptionSpan);
}
} catch (Exception e) {
// Invalid locator string or node could not be found
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.dom.client.Style.Display;
protected boolean addTreeSpacer(UIDL rowUidl) {
if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) {
- com.google.gwt.user.client.Element container = (com.google.gwt.user.client.Element) getElement()
- .getLastChild().getFirstChild();
+ Element container = (Element) getElement().getLastChild()
+ .getFirstChild();
if (rowUidl.hasAttribute("icon")) {
// icons are in first content cell in TreeTable
}
private int getCellWidthFromDom(int cellIndex) {
- final com.google.gwt.user.client.Element cell = DOM.getChild(
- getElement(), cellIndex);
+ final Element cell = DOM.getChild(getElement(), cellIndex);
String w = cell.getStyle().getProperty("width");
if (w == null || "".equals(w) || !w.endsWith("px")) {
return -1;
.getVisibleCellCount(); ix++) {
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth();
}
- Util.setWidthExcludingPaddingAndBorder(
- (com.google.gwt.user.client.Element) getElement()
- .getChild(cellIx), spanWidth, 13, false);
+ Util.setWidthExcludingPaddingAndBorder((Element) getElement()
+ .getChild(cellIx), spanWidth, 13, false);
}
}
}
private void copyTRBackgroundsToTDs(VScrollTableRow row) {
- com.google.gwt.user.client.Element tr = row.getElement();
+ Element tr = row.getElement();
ComputedStyle cs = new ComputedStyle(tr);
String backgroundAttachment = cs
.getProperty("backgroundAttachment");
String backgroundImage = cs.getProperty("backgroundImage");
String backgroundOrigin = cs.getProperty("backgroundOrigin");
for (int ix = 0; ix < tr.getChildCount(); ix++) {
- com.google.gwt.user.client.Element td = tr.getChild(ix)
- .cast();
+ Element td = tr.getChild(ix).cast();
if (!elementHasBackground(td)) {
td.getStyle().setProperty("backgroundAttachment",
backgroundAttachment);
}
}
- private boolean elementHasBackground(
- com.google.gwt.user.client.Element element) {
+ private boolean elementHasBackground(Element element) {
ComputedStyle cs = new ComputedStyle(element);
String clr = cs.getProperty("backgroundColor");
String img = cs.getProperty("backgroundImage");
}
private void restoreStyleForTDsInRow(VScrollTableRow row) {
- com.google.gwt.user.client.Element tr = row.getElement();
+ Element tr = row.getElement();
for (int ix = 0; ix < tr.getChildCount(); ix++) {
- com.google.gwt.user.client.Element td = tr.getChild(ix)
- .cast();
+ Element td = tr.getChild(ix).cast();
td.getStyle().clearProperty("backgroundAttachment");
td.getStyle().clearProperty("backgroundClip");
td.getStyle().clearProperty("backgroundColor");
private class RowExpandAnimation extends Animation {
private final List<VScrollTableRow> rows;
- private com.google.gwt.user.client.Element cloneDiv;
- private com.google.gwt.user.client.Element cloneTable;
+ private Element cloneDiv;
+ private Element cloneTable;
private AnimationPreparator preparator;
/**
}
private void cloneAndAppendRow(VScrollTableRow row) {
- com.google.gwt.user.client.Element clonedTR = null;
+ Element clonedTR = null;
clonedTR = row.getElement().cloneNode(true).cast();
clonedTR.getStyle().setVisibility(Visibility.VISIBLE);
cloneTable.appendChild(clonedTR);
}
private void insertAnimatingDiv() {
- com.google.gwt.user.client.Element tableBody = getElement()
- .cast();
- com.google.gwt.user.client.Element tableBodyParent = tableBody
- .getParentElement().cast();
+ Element tableBody = getElement();
+ Element tableBodyParent = tableBody.getParentElement();
tableBodyParent.insertAfter(cloneDiv, tableBody);
}
resetCellWrapperDivsDisplayProperty(row);
row.removeStyleName("v-table-row-animating");
}
- com.google.gwt.user.client.Element tableBodyParent = (com.google.gwt.user.client.Element) getElement()
- .getParentElement();
+ Element tableBodyParent = getElement().getParentElement();
tableBodyParent.removeChild(cloneDiv);
}
private void setCellWrapperDivsToDisplayNone(VScrollTableRow row) {
- com.google.gwt.user.client.Element tr = row.getElement();
+ Element tr = row.getElement();
for (int ix = 0; ix < tr.getChildCount(); ix++) {
getWrapperDiv(tr, ix).getStyle().setDisplay(Display.NONE);
}
}
- private com.google.gwt.user.client.Element getWrapperDiv(
- com.google.gwt.user.client.Element tr, int tdIx) {
- com.google.gwt.user.client.Element td = tr.getChild(tdIx)
- .cast();
+ private Element getWrapperDiv(Element tr, int tdIx) {
+ Element td = tr.getChild(tdIx).cast();
return td.getChild(0).cast();
}
private void resetCellWrapperDivsDisplayProperty(VScrollTableRow row) {
- com.google.gwt.user.client.Element tr = row.getElement();
+ Element tr = row.getElement();
for (int ix = 0; ix < tr.getChildCount(); ix++) {
getWrapperDiv(tr, ix).getStyle().clearProperty("display");
}
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.FormElement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
setStyleName(CLASSNAME);
}
- private static native void setEncoding(
- com.google.gwt.user.client.Element form, String encoding)
+ private static native void setEncoding(Element form, String encoding)
/*-{
form.enctype = encoding;
// For IE8
setStyleName(getElement(), CLASSNAME + "-immediate", immediate);
}
- private static native void fireNativeClick(
- com.google.gwt.user.client.Element element)
+ private static native void fireNativeClick(Element element)
/*-{
element.click();
}-*/;
- private static native void fireNativeBlur(
- com.google.gwt.user.client.Element element)
+ private static native void fireNativeBlur(Element element)
/*-{
element.blur();
}-*/;
package com.vaadin.client.ui;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.dom.client.VideoElement;
import com.vaadin.client.Util;
*
* @param el
*/
- private native void updateDimensionsWhenMetadataLoaded(
- com.google.gwt.user.client.Element el)
+ private native void updateDimensionsWhenMetadataLoaded(Element el)
/*-{
var self = this;
el.addEventListener('loadedmetadata', $entry(function(e) {
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
public static final int Z_INDEX = 10000;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element contents;
+ public Element contents;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element header;
+ public Element header;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element footer;
+ public Element footer;
- private com.google.gwt.user.client.Element resizeBox;
+ private Element resizeBox;
/** For internal use only. May be removed or replaced in the future. */
public final FocusableScrollPanel contentPanel = new FocusableScrollPanel();
private int origH;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element closeBox;
+ public Element closeBox;
/** For internal use only. May be removed or replaced in the future. */
- public com.google.gwt.user.client.Element maximizeRestoreBox;
+ public Element maximizeRestoreBox;
/** For internal use only. May be removed or replaced in the future. */
public ApplicationConnection client;
/** For internal use only. May be removed or replaced in the future. */
public boolean resizeLazy = false;
- private com.google.gwt.user.client.Element modalityCurtain;
- private com.google.gwt.user.client.Element draggingCurtain;
- private com.google.gwt.user.client.Element resizingCurtain;
+ private Element modalityCurtain;
+ private Element draggingCurtain;
+ private Element resizingCurtain;
- private com.google.gwt.user.client.Element headerText;
+ private Element headerText;
private boolean closable = true;
private String assistivePrefix;
private String assistivePostfix;
- private com.google.gwt.user.client.Element topTabStop;
- private com.google.gwt.user.client.Element bottomTabStop;
+ private Element topTabStop;
+ private Element bottomTabStop;
private NativePreviewHandler topEventBlocker;
private NativePreviewHandler bottomEventBlocker;
/** For internal use only. May be removed or replaced in the future. */
public boolean immediate;
- private com.google.gwt.user.client.Element wrapper;
+ private Element wrapper;
/** For internal use only. May be removed or replaced in the future. */
public boolean visibilityChangesDisabled;
modalityCurtain = DOM.createDiv();
modalityCurtain.setClassName(CLASSNAME + "-modalitycurtain");
}
- return modalityCurtain;
+ return DOM.asOld(modalityCurtain);
}
protected void constructDOM() {
}
private void fixIE8FocusCaptureIssue() {
- com.google.gwt.user.client.Element e = DOM.createInputText();
+ Element e = DOM.createInputText();
Style elemStyle = e.getStyle();
elemStyle.setPosition(Position.ABSOLUTE);
elemStyle.setTop(-10, Unit.PX);
}
}
- private com.google.gwt.user.client.Element getDraggingCurtain() {
+ private Element getDraggingCurtain() {
if (draggingCurtain == null) {
draggingCurtain = createCurtain();
draggingCurtain.setClassName(CLASSNAME + "-draggingCurtain");
return draggingCurtain;
}
- private com.google.gwt.user.client.Element getResizingCurtain() {
+ private Element getResizingCurtain() {
if (resizingCurtain == null) {
resizingCurtain = createCurtain();
resizingCurtain.setClassName(CLASSNAME + "-resizingCurtain");
return resizingCurtain;
}
- private com.google.gwt.user.client.Element createCurtain() {
- com.google.gwt.user.client.Element curtain = DOM.createDiv();
+ private Element createCurtain() {
+ Element curtain = DOM.createDiv();
DOM.setStyleAttribute(curtain, "position", "absolute");
DOM.setStyleAttribute(curtain, "top", "0px");
if (contents == null) {
return super.getContainerElement();
}
- return contents;
+ return DOM.asOld(contents);
}
private Event headerDragPending;
final int type = event.getTypeInt();
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
+ final Element target = DOM.eventGetTarget(event);
if (resizing || resizeBox == target) {
onResizeEvent(event);
return true;
}
- final com.google.gwt.user.client.Element target = event
- .getEventTarget().cast();
+ final Element target = event.getEventTarget().cast();
if (!DOM.isOrHasChild(getTopmostWindow().getElement(), target)) {
// not within the modal window, but let's see if it's in the
// debug window
"All values in parameter description need to be non-null");
}
- com.google.gwt.user.client.Element element = ((ComponentConnector) connectors[index])
+ Element element = ((ComponentConnector) connectors[index])
.getWidget().getElement();
AriaHelper.ensureHasId(element);
ids[index] = Id.of(element);
package com.vaadin.client.ui;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.RootPanel;
import com.vaadin.client.ApplicationConnection;
if (ac == null) {
return super.getOverlayContainer();
} else {
- com.google.gwt.user.client.Element overlayContainer = getOverlayContainer(ac);
- return overlayContainer;
+ Element overlayContainer = getOverlayContainer(ac);
+ return DOM.asOld(overlayContainer);
}
}
ApplicationConnection ac) {
String id = ac.getConfiguration().getRootPanelId();
id = id += "-window-overlays";
- com.google.gwt.user.client.Element container = DOM.getElementById(id);
+ Element container = DOM.getElementById(id);
if (container == null) {
container = DOM.createDiv();
container.setId(id);
RootPanel.get().getElement().appendChild(container);
}
- return container;
+ return DOM.asOld(container);
}
}
import java.util.List;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
import com.vaadin.client.DirectionalManagedLayout;
* this layout
* @return The Paintable which the element is a part of. Null if the element
* belongs to the layout and not to a child.
+ * @deprecated As of 7.2, call or override
+ * {@link #getConnectorForElement(Element)} instead
*/
+ @Deprecated
protected ComponentConnector getConnectorForElement(
com.google.gwt.user.client.Element element) {
return Util.getConnectorForElement(getConnection(), getWidget(),
element);
}
+ /**
+ * Returns the deepest nested child component which contains "element". The
+ * child component is also returned if "element" is part of its caption.
+ *
+ * @param element
+ * An element that is a nested sub element of the root element in
+ * this layout
+ * @return The Paintable which the element is a part of. Null if the element
+ * belongs to the layout and not to a child.
+ *
+ * @since 7.2
+ */
+ protected ComponentConnector getConnectorForElement(Element element) {
+ return getConnectorForElement(DOM.asOld(element));
+ }
+
/*
* (non-Javadoc)
*
import com.google.gwt.aria.client.Id;
import com.google.gwt.aria.client.InvalidValue;
import com.google.gwt.aria.client.Roles;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
* @param captionElements
* Element with of caption to bind
*/
- public static void bindCaption(Widget widget,
- com.google.gwt.user.client.Element captionElement) {
+ public static void bindCaption(Widget widget, Element captionElement) {
assert widget != null : "Valid Widget required";
if (widget instanceof HandlesAriaCaption) {
((HandlesAriaCaption) widget).bindAriaCaption(null);
} else {
ensureHasId(captionElement);
- ((HandlesAriaCaption) widget).bindAriaCaption(captionElement);
+ ((HandlesAriaCaption) widget).bindAriaCaption(DOM
+ .asOld(captionElement));
}
} else if (captionElement != null) {
// Handle the default case
* @param required
* boolean, true when the element is required
*/
- public static void handleInputRequired(
- com.google.gwt.user.client.Element element, boolean required) {
+ public static void handleInputRequired(Element element, boolean required) {
if (required) {
Roles.getTextboxRole().setAriaRequiredProperty(element, required);
} else {
* @param invalid
* boolean, true when the element input has an error
*/
- public static void handleInputInvalid(
- com.google.gwt.user.client.Element element, boolean invalid) {
+ public static void handleInputInvalid(Element element, boolean invalid) {
if (invalid) {
Roles.getTextboxRole().setAriaInvalidState(element,
InvalidValue.TRUE);
* Element to check
* @return String with the id of the element
*/
- public static String ensureHasId(com.google.gwt.user.client.Element element) {
+ public static String ensureHasId(Element element) {
assert element != null : "Valid Element required";
String id = element.getId();
* @param boolean assistiveOnly true when element should only be visible for
* assistive devices, false to make the element visible for all
*/
- public static void setVisibleForAssistiveDevicesOnly(
- com.google.gwt.user.client.Element element, boolean assistiveOnly) {
+ public static void setVisibleForAssistiveDevicesOnly(Element element,
+ boolean assistiveOnly) {
if (assistiveOnly) {
element.addClassName(ASSISTIVE_DEVICE_ONLY_STYLE);
} else {
import java.util.List;
import com.google.gwt.core.shared.GWT;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ContextMenuEvent;
import com.google.gwt.i18n.client.DateTimeFormat;
*/
DateCell cell = (DateCell) widget;
int slotIndex = DOM.getChildIndex(
- cell.getElement(),
- (com.google.gwt.user.client.Element) ne
+ cell.getElement(), (Element) ne
.getEventTarget().cast());
DateCellSlot slot = cell.getSlot(slotIndex);
return CalendarConnector.this.getActionsBetween(
@Override
public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) {
TooltipInfo tooltipInfo = null;
- Widget w = Util.findWidget(
- (com.google.gwt.user.client.Element) element, null);
+ Widget w = Util.findWidget(element, null);
if (w instanceof HasTooltipKey) {
tooltipInfo = GWT.create(TooltipInfo.class);
String title = tooltips.get(((HasTooltipKey) w).getTooltipKey());
}
public int getSlotBorder() {
- return Util
- .measureVerticalBorder((com.google.gwt.user.client.Element) slotElements[0]);
+ return Util.measureVerticalBorder(slotElements[0]);
}
private void drawDayEvents(List<DateCellGroup> groups) {
updatePositionFor(dayEvent, targetDay, calendarEvent);
}
- add(dayEvent, (com.google.gwt.user.client.Element) main);
+ add(dayEvent, main);
}
// date methods are not deprecated in GWT
}
index++;
}
- this.insert(dayEvent, (com.google.gwt.user.client.Element) main, index,
- true);
+ this.insert(dayEvent, main, index, true);
}
public void removeEvent(DateCellDayEvent dayEvent) {
return today != null;
}
+ /**
+ * @deprecated As of 7.2, call or override
+ * {@link #addEmphasisStyle(Element)} instead
+ */
+ @Deprecated
public void addEmphasisStyle(com.google.gwt.user.client.Element elementOver) {
String originalStylename = getStyleName(elementOver);
setStyleName(elementOver, originalStylename + DRAGEMPHASISSTYLE);
}
+ /**
+ * @since 7.2
+ */
+ public void addEmphasisStyle(Element elementOver) {
+ addEmphasisStyle(DOM.asOld(elementOver));
+ }
+
+ /**
+ * @deprecated As of 7.2, call or override
+ * {@link #removeEmphasisStyle(Element)} instead
+ */
+ @Deprecated
public void removeEmphasisStyle(
com.google.gwt.user.client.Element elementOver) {
String originalStylename = getStyleName(elementOver);
- DRAGEMPHASISSTYLE.length()));
}
+ /**
+ * @since 7.2
+ */
+ public void removeEmphasisStyle(Element elementOver) {
+ removeEmphasisStyle(DOM.asOld(elementOver));
+ }
+
@Override
public void onContextMenu(ContextMenuEvent event) {
if (weekgrid.getCalendar().getMouseEventListener() != null) {
private int startXrelative;
private boolean disabled;
private final WeekGrid weekGrid;
- private com.google.gwt.user.client.Element topResizeBar;
- private com.google.gwt.user.client.Element bottomResizeBar;
+ private Element topResizeBar;
+ private Element bottomResizeBar;
private Element clickTarget;
private final Integer eventIndex;
private int slotHeight;
*/
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.ui.calendar.CalendarConnector;
super(connector);
}
- private com.google.gwt.user.client.Element currentTargetElement;
+ private Element currentTargetElement;
private SimpleDayCell currentTargetDay;
/*
* The element to check
* @return
*/
- private boolean isLocationValid(
- com.google.gwt.user.client.Element elementOver) {
- com.google.gwt.user.client.Element monthGridElement = calendarConnector
- .getWidget().getMonthGrid().getElement();
+ private boolean isLocationValid(Element elementOver) {
+ Element monthGridElement = calendarConnector.getWidget().getMonthGrid()
+ .getElement();
// drops are not allowed in:
// - weekday header
*/
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.ui.calendar.CalendarConnector;
*/
public class CalendarWeekDropHandler extends CalendarDropHandler {
- private com.google.gwt.user.client.Element currentTargetElement;
+ private Element currentTargetElement;
private DateCell currentTargetDay;
public CalendarWeekDropHandler(CalendarConnector connector) {
* The element to check
* @return
*/
- private boolean isLocationValid(
- com.google.gwt.user.client.Element elementOver) {
- com.google.gwt.user.client.Element weekGridElement = calendarConnector
- .getWidget().getWeekGrid().getElement();
- com.google.gwt.user.client.Element timeBarElement = calendarConnector
- .getWidget().getWeekGrid().getTimeBar().getElement();
-
- com.google.gwt.user.client.Element todayBarElement = null;
+ private boolean isLocationValid(Element elementOver) {
+ Element weekGridElement = calendarConnector.getWidget().getWeekGrid()
+ .getElement();
+ Element timeBarElement = calendarConnector.getWidget().getWeekGrid()
+ .getTimeBar().getElement();
+
+ Element todayBarElement = null;
if (calendarConnector.getWidget().getWeekGrid().hasToday()) {
- todayBarElement = (com.google.gwt.user.client.Element) calendarConnector
- .getWidget().getWeekGrid().getDateCellOfToday()
- .getTodaybarElement();
+ todayBarElement = calendarConnector.getWidget().getWeekGrid()
+ .getDateCellOfToday().getTodaybarElement();
}
// drops are not allowed in:
*/
package com.vaadin.client.ui.colorpicker;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
if (changedColor.length == changedX.length
&& changedX.length == changedY.length) {
for (int c = 0; c < changedColor.length; c++) {
- com.google.gwt.user.client.Element element = grid
- .getCellFormatter().getElement(
- Integer.parseInt(changedX[c]),
- Integer.parseInt(changedY[c]));
+ Element element = grid.getCellFormatter().getElement(
+ Integer.parseInt(changedX[c]),
+ Integer.parseInt(changedY[c]));
element.getStyle().setProperty("background",
changedColor[c]);
}
*/
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;
public class DDUtil {
- public static VerticalDropLocation getVerticalDropLocation(
- com.google.gwt.user.client.Element element, NativeEvent event,
- double topBottomRatio) {
+ public static VerticalDropLocation getVerticalDropLocation(Element element,
+ NativeEvent event, double topBottomRatio) {
int offsetHeight = element.getOffsetHeight();
return getVerticalDropLocation(element, offsetHeight, event,
topBottomRatio);
}
- public static VerticalDropLocation getVerticalDropLocation(
- com.google.gwt.user.client.Element element, int offsetHeight,
- NativeEvent event, double topBottomRatio) {
+ public static VerticalDropLocation getVerticalDropLocation(Element element,
+ int offsetHeight, NativeEvent event, double topBottomRatio) {
int clientY = Util.getTouchOrMouseClientY(event);
return getVerticalDropLocation(element, offsetHeight, clientY,
topBottomRatio);
}
- public static VerticalDropLocation getVerticalDropLocation(
- com.google.gwt.user.client.Element element, int offsetHeight,
- int clientY, double topBottomRatio) {
+ public static VerticalDropLocation getVerticalDropLocation(Element element,
+ int offsetHeight, int clientY, double topBottomRatio) {
// Event coordinates are relative to the viewport, element absolute
// position is relative to the document. Make element position relative
}
public static HorizontalDropLocation getHorizontalDropLocation(
- com.google.gwt.user.client.Element element, NativeEvent event,
+ Element element, NativeEvent event,
double leftRightRatio) {
int clientX = Util.getTouchOrMouseClientX(event);
}
if (currentDropHandler != null) {
- currentDrag
- .setElementOver((com.google.gwt.user.client.Element) targetElement);
+ currentDrag.setElementOver(targetElement);
currentDropHandler.dragEnter(currentDrag);
}
} else if (findDragTarget != null) {
- currentDrag
- .setElementOver((com.google.gwt.user.client.Element) targetElement);
+ currentDrag.setElementOver(targetElement);
currentDropHandler.dragOver(currentDrag);
}
// prevent text selection on IE
// ApplicationConnection.getConsole().log(
// "Target just modified on "
// + event.getType());
- currentDrag
- .setElementOver((com.google.gwt.user.client.Element) targetElement);
+ currentDrag.setElementOver(targetElement);
break;
}
// ApplicationConnection.getConsole().log(
// "DropHandler now"
// + currentDropHandler.getPaintable());
- currentDrag
- .setElementOver((com.google.gwt.user.client.Element) targetElement);
+ currentDrag.setElementOver(targetElement);
target.dragEnter(currentDrag);
} else if (target == null && currentDropHandler != null) {
// ApplicationConnection.getConsole().log("Invalid state!?");
case Event.ONMOUSEMOVE:
case Event.ONTOUCHMOVE:
if (currentDropHandler != null) {
- currentDrag
- .setElementOver((com.google.gwt.user.client.Element) targetElement);
+ currentDrag.setElementOver(targetElement);
currentDropHandler.dragOver(currentDrag);
}
nativeEvent.preventDefault();
*/
private VDropHandler findDragTarget(Element element) {
try {
- Widget w = Util.findWidget(
- (com.google.gwt.user.client.Element) element, null);
+ Widget w = Util.findWidget(element, null);
if (w == null) {
return null;
}
import java.util.Map;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.dom.client.TableElement;
import com.google.gwt.dom.client.TableSectionElement;
import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.user.client.DOM;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.Util;
private HashMap<String, Object> dropDetails = new HashMap<String, Object>();
- private com.google.gwt.user.client.Element elementOver;
+ private Element elementOver;
VDragEvent(VTransferable t, NativeEvent startEvent) {
transferable = t;
*/
public com.google.gwt.user.client.Element getElementOver() {
if (elementOver != null) {
- return elementOver;
+ return DOM.asOld(elementOver);
} else if (currentGwtEvent != null) {
return currentGwtEvent.getEventTarget().cast();
}
return null;
}
+ /**
+ * @deprecated As of 7.2, call or override {@link #setElementOver(Element)}
+ * instead
+ */
+ @Deprecated
public void setElementOver(com.google.gwt.user.client.Element targetElement) {
elementOver = targetElement;
}
+ /**
+ * @since 7.2
+ */
+ public void setElementOver(Element targetElement) {
+ setElementOver(DOM.asOld(targetElement));
+ }
+
/**
* Sets the drag image used for current drag and drop operation. Drag image
* is displayed next to mouse cursor during drag and drop.
* to HTML5 DataTransfer
*
* @param node
+ * @deprecated As of 7.2, call or override {@link #setDragImage(Element)}
+ * instead
*/
+ @Deprecated
public void setDragImage(com.google.gwt.user.client.Element node) {
setDragImage(node, DEFAULT_OFFSET, DEFAULT_OFFSET);
}
+ /**
+ * Sets the drag image used for current drag and drop operation. Drag image
+ * is displayed next to mouse cursor during drag and drop.
+ * <p>
+ * The element to be used as drag image will automatically get CSS style
+ * name "v-drag-element".
+ *
+ * TODO decide if this method should be here or in {@link VTransferable} (in
+ * HTML5 it is in DataTransfer) or {@link VDragAndDropManager}
+ *
+ * TODO should be possible to override behavior. Like to proxy the element
+ * to HTML5 DataTransfer
+ *
+ * @param node
+ *
+ * @since 7.2
+ */
+ public void setDragImage(Element node) {
+ setDragImage(DOM.asOld(node));
+ }
+
/**
* TODO consider using similar smaller (than map) api as in Transferable
*
* the horizontal offset of drag image from mouse cursor
* @param offsetY
* the vertical offset of drag image from mouse cursor
+ * @deprecated As of 7.2, call or override
+ * {@link #setDragImage(Element,int,int)} instead
*/
+ @Deprecated
public void setDragImage(com.google.gwt.user.client.Element element,
int offsetX, int offsetY) {
element.getStyle().setMarginLeft(offsetX, Unit.PX);
element.getStyle().setMarginTop(offsetY, Unit.PX);
VDragAndDropManager.get().setDragElement(element);
+
+ }
+
+ /**
+ * Sets the drag image used for current drag and drop operation. Drag image
+ * is displayed next to mouse cursor during drag and drop.
+ * <p>
+ * The element to be used as drag image will automatically get CSS style
+ * name "v-drag-element".
+ *
+ * @param element
+ * the dom element to be positioned next to mouse cursor
+ * @param offsetX
+ * the horizontal offset of drag image from mouse cursor
+ * @param offsetY
+ * the vertical offset of drag image from mouse cursor
+ *
+ * @since 7.2
+ */
+ public void setDragImage(Element element, int offsetX, int offsetY) {
+ setDragImage(DOM.asOld(element), offsetX, offsetY);
}
/**
* if drag image is not currently set for this drag operation.
*/
public com.google.gwt.user.client.Element getDragImage() {
- return (com.google.gwt.user.client.Element) VDragAndDropManager.get()
- .getDragElement();
+ return DOM.asOld(VDragAndDropManager.get().getDragElement());
}
/**
* @param alignImageToEvent
* if true, proxy image is aligned to start event, else next to
* mouse cursor
+ * @deprecated As of 7.2, call or override
+ * {@link #createDragImage(Element,boolean)} instead
*/
+ @Deprecated
public void createDragImage(com.google.gwt.user.client.Element element,
boolean alignImageToEvent) {
- com.google.gwt.user.client.Element cloneNode = (com.google.gwt.user.client.Element) element
- .cloneNode(true);
+ Element cloneNode = (Element) element.cloneNode(true);
if (BrowserInfo.get().isIE()) {
if (cloneNode.getTagName().toLowerCase().equals("tr")) {
TableElement table = Document.get().createTableElement();
}
+ /**
+ * Automatically tries to create a proxy image from given element.
+ *
+ * @param element
+ * @param alignImageToEvent
+ * if true, proxy image is aligned to start event, else next to
+ * mouse cursor
+ * @since 7.2
+ */
+ public void createDragImage(Element element, boolean alignImageToEvent) {
+ createDragImage(DOM.asOld(element), alignImageToEvent);
+ }
+
}
import java.util.Map;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.NodeList;
getWidget().type = uidl.getStringAttribute("type");
if (getWidget().type.equals("image")) {
getWidget().addStyleName(VEmbedded.CLASSNAME + "-image");
- com.google.gwt.user.client.Element el = null;
+ Element el = null;
boolean created = false;
NodeList<Node> nodes = getWidget().getElement().getChildNodes();
if (nodes != null && nodes.getLength() == 1) {
Node n = nodes.getItem(0);
if (n.getNodeType() == Node.ELEMENT_NODE) {
- com.google.gwt.user.client.Element e = (com.google.gwt.user.client.Element) n;
+ Element e = (Element) n;
if (e.getTagName().equals("IMG")) {
el = e;
}
TooltipInfo info = null;
if (element != getWidget().getElement()) {
- Object node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- VFormLayout.Caption.class);
+ Object node = Util.findWidget(element, VFormLayout.Caption.class);
if (node != null) {
VFormLayout.Caption caption = (VFormLayout.Caption) node;
info = caption.getOwner().getTooltipInfo(element);
} else {
- node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- VFormLayout.ErrorFlag.class);
+ node = Util.findWidget(element, VFormLayout.ErrorFlag.class);
if (node != null) {
VFormLayout.ErrorFlag flag = (VFormLayout.ErrorFlag) node;
package com.vaadin.client.ui.layout;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
public abstract class VLayoutSlot {
- private final com.google.gwt.user.client.Element wrapper = Document.get()
- .createDivElement().cast();
+ private final Element wrapper = Document.get().createDivElement();
private AlignmentInfo alignment;
private VCaption caption;
}
public com.google.gwt.user.client.Element getWrapperElement() {
- return wrapper;
+ return DOM.asOld(wrapper);
}
public void setExpandRatio(double expandRatio) {
import java.util.List;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
@Deprecated
public class MenuBar extends Widget implements PopupListener {
- private final com.google.gwt.user.client.Element body;
+ private final Element body;
private final ArrayList<MenuItem> items = new ArrayList<MenuItem>();
private MenuBar parentMenu;
private PopupPanel popup;
public MenuBar(boolean vertical) {
super();
- final com.google.gwt.user.client.Element table = DOM.createTable();
+ final Element table = DOM.createTable();
body = DOM.createTBody();
DOM.appendChild(table, body);
if (!vertical) {
- final com.google.gwt.user.client.Element tr = DOM.createTR();
+ final Element tr = DOM.createTR();
DOM.appendChild(body, tr);
}
this.vertical = vertical;
- final com.google.gwt.user.client.Element outer = DOM.createDiv();
+ final Element outer = DOM.createDiv();
DOM.appendChild(outer, table);
setElement(outer);
* the item to be added
*/
public void addItem(MenuItem item) {
- com.google.gwt.user.client.Element tr;
+ Element tr;
if (vertical) {
tr = DOM.createTR();
DOM.appendChild(body, tr);
* Removes all menu items from this menu bar.
*/
public void clearItems() {
- final com.google.gwt.user.client.Element container = getItemContainerElement();
+ final Element container = getItemContainerElement();
while (DOM.getChildCount(container) > 0) {
DOM.removeChild(container, DOM.getChild(container, 0));
}
return;
}
- final com.google.gwt.user.client.Element container = getItemContainerElement();
+ final Element container = getItemContainerElement();
DOM.removeChild(container, DOM.getChild(container, idx));
items.remove(idx);
}
// If the event target is part of the parent menu, suppress
// the
// event altogether.
- final com.google.gwt.user.client.Element target = DOM
- .eventGetTarget(event);
- final com.google.gwt.user.client.Element parentMenuElement = item
- .getParentMenu().getElement();
+ final Element target = DOM.eventGetTarget(event);
+ final Element parentMenuElement = item.getParentMenu()
+ .getElement();
if (DOM.isOrHasChild(parentMenuElement, target)) {
return false;
}
}
}
- private MenuItem findItem(com.google.gwt.user.client.Element hItem) {
+ private MenuItem findItem(Element hItem) {
for (int i = 0; i < items.size(); ++i) {
final MenuItem item = items.get(i);
if (DOM.isOrHasChild(item.getElement(), hItem)) {
return null;
}
- private com.google.gwt.user.client.Element getItemContainerElement() {
+ private Element getItemContainerElement() {
if (vertical) {
return body;
} else {
if (element != getWidget().getElement()) {
VMenuBar.CustomMenuItem item = getWidget().getMenuItemWithElement(
- (com.google.gwt.user.client.Element) element);
+ element);
if (item != null) {
info = item.getTooltip();
}
import java.util.List;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
public void onElementResize(ElementResizeEvent e) {
// Get all needed element references
- com.google.gwt.user.client.Element captionElement = (com.google.gwt.user.client.Element) e
- .getElement().cast();
+ Element captionElement = e.getElement();
// Caption position determines if the widget element is the first or
// last child inside the caption wrap
CaptionPosition pos = getWidget().getCaptionPositionFromElement(
- (com.google.gwt.user.client.Element) captionElement
- .getParentElement().cast());
+ captionElement.getParentElement());
// The default is the last child
- com.google.gwt.user.client.Element widgetElement = captionElement
- .getParentElement().getLastChild().cast();
+ Element widgetElement = captionElement.getParentElement()
+ .getLastChild().cast();
// ...but if caption position is bottom or right, the widget is the
// first child
@Override
public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) {
if (element != getWidget().getElement()) {
- Slot slot = Util.findWidget(
- (com.google.gwt.user.client.Element) element, Slot.class);
+ Slot slot = Util.findWidget(element, Slot.class);
if (slot != null && slot.getCaptionElement() != null
&& slot.getParent() == getWidget()
&& slot.getCaptionElement().isOrHasChild(element)) {
for (ComponentConnector child : getChildComponents()) {
Widget childWidget = child.getWidget();
Slot slot = getWidget().getSlot(childWidget);
- com.google.gwt.user.client.Element captionElement = slot
- .getCaptionElement();
+ Element captionElement = slot.getCaptionElement();
CaptionPosition captionPosition = slot.getCaptionPosition();
int pixelHeight = layoutManager.getOuterHeight(childWidget
import com.google.gwt.aria.client.Roles;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
public static final String SLOT_CLASSNAME = "v-slot";
- private com.google.gwt.user.client.Element spacer;
- private com.google.gwt.user.client.Element captionWrap;
- private com.google.gwt.user.client.Element caption;
- private com.google.gwt.user.client.Element captionText;
+ private Element spacer;
+ private Element captionWrap;
+ private Element caption;
+ private Element captionText;
private Icon icon;
- private com.google.gwt.user.client.Element errorIcon;
- private com.google.gwt.user.client.Element requiredIcon;
+ private Element errorIcon;
+ private Element requiredIcon;
private ElementResizeListener captionResizeListener;
@Override
public void onElementResize(ElementResizeEvent e) {
- com.google.gwt.user.client.Element caption = getCaptionElement();
+ Element caption = getCaptionElement();
if (caption != null) {
Util.forceIE8Redraw(caption);
}
* @return
*/
public com.google.gwt.user.client.Element getSpacingElement() {
- return spacer;
+ return DOM.asOld(spacer);
}
/**
// Caption wrappers
Widget widget = getWidget();
- final com.google.gwt.user.client.Element focusedElement = Util
- .getFocusedElement();
+ final Element focusedElement = Util.getFocusedElement();
// By default focus will not be lost
boolean focusLost = false;
if (captionText != null || icon != null || error != null || required) {
if (focusLost) {
// Find out what element is currently focused.
- com.google.gwt.user.client.Element currentFocus = Util
- .getFocusedElement();
+ Element currentFocus = Util.getFocusedElement();
if (currentFocus != null
&& currentFocus.equals(Document.get().getBody())) {
// Focus has moved to BodyElement and should be moved back to
* Get the slots caption element
*/
public com.google.gwt.user.client.Element getCaptionElement() {
- return caption;
+ return DOM.asOld(caption);
}
private boolean relativeWidth = false;
if (captionWrap == null) {
return getElement();
} else {
- return captionWrap;
+ return DOM.asOld(captionWrap);
}
}
import java.util.HashMap;
import java.util.Map;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Unit;
private Map<Widget, Slot> widgetToSlot = new HashMap<Widget, Slot>();
- private com.google.gwt.user.client.Element expandWrapper;
+ private Element expandWrapper;
private LayoutManager layoutManager;
/**
* {@inheritDoc}
+ *
+ * @deprecated As of 7.2, use or override
+ * {@link #insert(Widget, Element, int, boolean)} instead.
*/
@Override
+ @Deprecated
protected void insert(Widget child,
com.google.gwt.user.client.Element container, int beforeIndex,
boolean domInsert) {
getChildren().insert(child, beforeIndex);
// Physical attach.
- container = expandWrapper != null ? expandWrapper : getElement();
+ container = expandWrapper != null ? DOM.asOld(expandWrapper)
+ : getElement();
if (domInsert) {
if (spacing) {
if (beforeIndex != 0) {
adopt(child);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @since 7.2
+ */
+ @Override
+ protected void insert(Widget child, Element container, int beforeIndex,
+ boolean domInsert) {
+ insert(child, DOM.asOld(container), beforeIndex, domInsert);
+ }
+
/**
* Remove a slot from the layout
*
* @param widgetElement
* The element of the widget ( Same as getWidget().getElement() )
* @return
+ * @deprecated As of 7.2, call or override {@link #getSlot(Element)} instead
*/
+ @Deprecated
public Slot getSlot(com.google.gwt.user.client.Element widgetElement) {
for (Map.Entry<Widget, Slot> entry : widgetToSlot.entrySet()) {
if (entry.getKey().getElement() == widgetElement) {
return null;
}
+ /**
+ * Gets a slot based on the widget element. If no slot is found then null is
+ * returned.
+ *
+ * @param widgetElement
+ * The element of the widget ( Same as getWidget().getElement() )
+ * @return
+ *
+ * @since 7.2
+ */
+ public Slot getSlot(Element widgetElement) {
+ return getSlot(DOM.asOld(widgetElement));
+ }
+
/**
* Set the layout manager for the layout
*
* The wrapping element
*
* @return The caption position
+ * @deprecated As of 7.2, call or override
+ * {@link #getCaptionPositionFromElement(Element)} instead
*/
+ @Deprecated
public CaptionPosition getCaptionPositionFromElement(
com.google.gwt.user.client.Element captionWrap) {
RegExp captionPositionRegexp = RegExp.compile("v-caption-on-(\\S+)");
return captionPosition;
}
+ /**
+ * Deducts the caption position by examining the wrapping element.
+ * <p>
+ * For internal use only. May be removed or replaced in the future.
+ *
+ * @param captionWrap
+ * The wrapping element
+ *
+ * @return The caption position
+ * @since 7.2
+ */
+ public CaptionPosition getCaptionPositionFromElement(Element captionWrap) {
+ return getCaptionPositionFromElement(DOM.asOld(captionWrap));
+ }
+
/**
* Update the offset off the caption relative to the slot
* <p>
*
* @param caption
* The caption element
+ * @deprecated As of 7.2, call or override
+ * {@link #updateCaptionOffset(Element)} instead
*/
+ @Deprecated
public void updateCaptionOffset(com.google.gwt.user.client.Element caption) {
- com.google.gwt.user.client.Element captionWrap = caption
- .getParentElement().cast();
+ Element captionWrap = caption.getParentElement();
Style captionWrapStyle = captionWrap.getStyle();
captionWrapStyle.clearPaddingTop();
}
}
+ /**
+ * Update the offset off the caption relative to the slot
+ * <p>
+ * For internal use only. May be removed or replaced in the future.
+ *
+ * @param caption
+ * The caption element
+ * @since 7.2
+ */
+ public void updateCaptionOffset(Element caption) {
+ updateCaptionOffset(DOM.asOld(caption));
+ }
+
/**
* Set the margin of the layout
*
// Give each expanded child its own share
for (Slot slot : widgetToSlot.values()) {
- com.google.gwt.user.client.Element slotElement = slot.getElement();
+ Element slotElement = slot.getElement();
slotElement.removeAttribute("aria-hidden");
Style slotStyle = slotElement.getStyle();
lastExpandSize = -1;
while (expandWrapper.getChildCount() > 0) {
- com.google.gwt.user.client.Element el = expandWrapper.getChild(
- 0).cast();
+ Element el = expandWrapper.getChild(0).cast();
getElement().appendChild(el);
if (vertical) {
el.getStyle().clearHeight();
import java.util.LinkedList;
import java.util.List;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.DomEvent;
import com.google.gwt.event.dom.client.DomEvent.Type;
import com.google.gwt.event.shared.EventHandler;
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.ComponentConnector;
@Override
protected boolean shouldFireEvent(DomEvent<?> event) {
- com.google.gwt.user.client.Element target = event.getNativeEvent()
- .getEventTarget().cast();
+ Element target = event.getNativeEvent().getEventTarget().cast();
if (!getWidget().splitter.isOrHasChild(target)) {
return false;
}
@Override
protected com.google.gwt.user.client.Element getRelativeToElement() {
- return getWidget().splitter;
+ return DOM.asOld(getWidget().splitter);
}
@Override
TooltipInfo info = null;
if (element != getWidget().getElement()) {
- Object node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- VScrollTableRow.class);
+ Object node = Util.findWidget(element, VScrollTableRow.class);
if (node != null) {
VScrollTableRow row = (VScrollTableRow) node;
// Find a tooltip for the tab, if the element is a tab
if (element != getWidget().getElement()) {
- Object node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- VTabsheet.TabCaption.class);
+ Object node = Util.findWidget(element, VTabsheet.TabCaption.class);
if (node != null) {
VTabsheet.TabCaption caption = (VTabsheet.TabCaption) node;
// Try to find a tooltip for a node
if (element != getWidget().getElement()) {
- Object node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- TreeNode.class);
+ Object node = Util.findWidget(element, TreeNode.class);
if (node != null) {
TreeNode tnode = (TreeNode) node;
TooltipInfo info = null;
if (element != getWidget().getElement()) {
- Object node = Util.findWidget(
- (com.google.gwt.user.client.Element) element,
- VTreeTableRow.class);
+ Object node = Util.findWidget(element, VTreeTableRow.class);
if (node != null) {
VTreeTableRow row = (VTreeTableRow) node;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.HeadElement;
import com.google.gwt.dom.client.LinkElement;
import com.google.gwt.dom.client.NativeEvent;
@Override
public void onScroll(ScrollEvent event) {
- com.google.gwt.user.client.Element element = getWidget()
- .getElement();
+ Element element = getWidget().getElement();
int newScrollTop = element.getScrollTop();
int newScrollLeft = element.getScrollLeft();
if (newScrollTop != lastSentScrollTop
Style childStyle = layoutElement.getStyle();
// IE8 needs some hackery to measure its content correctly
- Util.forceIE8Redraw((com.google.gwt.user.client.Element) layoutElement);
+ Util.forceIE8Redraw(layoutElement);
if (content.isRelativeHeight() && !BrowserInfo.get().isIE9()) {
childStyle.setPosition(Position.ABSOLUTE);
package com.vaadin.tests.minitutorials.v7a2;
+import com.google.gwt.dom.client.Element;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.client.ui.SimpleManagedLayout;
import com.vaadin.client.ui.layout.ElementResizeEvent;
@Override
protected void init() {
- com.google.gwt.user.client.Element button = getWidget().getWidget(1)
- .getElement();
+ Element button = getWidget().getWidget(1).getElement();
getLayoutManager().addElementResizeListener(button, listener);
getLayoutManager().registerDependency(this, button);
@Override
public void onUnregister() {
- com.google.gwt.user.client.Element button = getWidget().getWidget(1)
- .getElement();
+ Element button = getWidget().getWidget(1).getElement();
getLayoutManager().removeElementResizeListener(button, listener);
getLayoutManager().unregisterDependency(this, button);
@Override
public void layout() {
- com.google.gwt.user.client.Element button = getWidget().getWidget(1)
- .getElement();
+ Element button = getWidget().getWidget(1).getElement();
int buttonWidth = getLayoutManager().getOuterWidth(button);
buttonWidth -= getLayoutManager().getMarginRight(button);
getWidget().adjustButtonSpace(buttonWidth);