This is the first step towards eliminating usage of the class. Reasoning about upcoming steps will be easier when it's clear which class "Element" refers to. Change-Id: Iea5547f789edc77c3b4ac95a5e2eb34d2717999etags/7.2.0.beta1
@@ -57,7 +57,6 @@ import com.google.gwt.regexp.shared.MatchResult; | |||
import com.google.gwt.regexp.shared.RegExp; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.Window.ClosingEvent; | |||
@@ -516,7 +515,8 @@ public class ApplicationConnection { | |||
// Ensure the overlay container is added to the dom and set as a live | |||
// area for assistive devices | |||
Element overlayContainer = VOverlay.getOverlayContainer(this); | |||
com.google.gwt.user.client.Element overlayContainer = VOverlay | |||
.getOverlayContainer(this); | |||
Roles.getAlertRole().setAriaLiveProperty(overlayContainer, | |||
LiveValue.ASSERTIVE); | |||
VOverlay.setOverlayContainerLabel(this, | |||
@@ -3483,7 +3483,8 @@ public class ApplicationConnection { | |||
* @return Connector for focused element or null. | |||
*/ | |||
private ComponentConnector getActiveConnector() { | |||
Element focusedElement = Util.getFocusedElement(); | |||
com.google.gwt.user.client.Element focusedElement = Util | |||
.getFocusedElement(); | |||
if (focusedElement == null) { | |||
return null; | |||
} |
@@ -15,8 +15,6 @@ | |||
*/ | |||
package com.vaadin.client; | |||
import com.google.gwt.user.client.Element; | |||
/** | |||
* Contains size information about a rendered container and its content area. | |||
* | |||
@@ -52,7 +50,7 @@ public class RenderInformation { | |||
* | |||
* @return true if the size has changed since last update | |||
*/ | |||
public boolean updateSize(Element element) { | |||
public boolean updateSize(com.google.gwt.user.client.Element element) { | |||
Size newSize = new Size(element.getOffsetWidth(), | |||
element.getOffsetHeight()); | |||
if (newSize.equals(renderedSize)) { |
@@ -30,7 +30,6 @@ import com.google.gwt.event.dom.client.DoubleClickHandler; | |||
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.Element; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Label; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -43,7 +42,8 @@ import com.google.gwt.user.client.ui.Widget; | |||
*/ | |||
@Deprecated | |||
public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { | |||
private Element children = Document.get().createDivElement().cast(); | |||
private com.google.gwt.user.client.Element children = Document.get() | |||
.createDivElement().cast(); | |||
private SpanElement handle = Document.get().createSpanElement(); | |||
private SpanElement text = Document.get().createSpanElement(); | |||
@@ -144,7 +144,8 @@ public class SimpleTree extends ComplexPanel implements HasDoubleClickHandlers { | |||
} | |||
@Override | |||
protected void add(Widget child, Element container) { | |||
protected void add(Widget child, | |||
com.google.gwt.user.client.Element container) { | |||
super.add(child, container); | |||
handle.getStyle().setDisplay(Display.INLINE_BLOCK); | |||
getElement().getStyle().setPaddingLeft(3, Unit.PX); |
@@ -35,7 +35,6 @@ import com.google.gwt.dom.client.Style.Display; | |||
import com.google.gwt.dom.client.Touch; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.EventListener; | |||
import com.google.gwt.user.client.Window; | |||
@@ -75,7 +74,8 @@ public class Util { | |||
* @param y | |||
* @return the element at given coordinates | |||
*/ | |||
public static native Element getElementFromPoint(int clientX, int clientY) | |||
public static native com.google.gwt.user.client.Element getElementFromPoint( | |||
int clientX, int clientY) | |||
/*-{ | |||
var el = $wnd.document.elementFromPoint(clientX, clientY); | |||
// Call elementFromPoint two times to make sure IE8 also returns something sensible if the application is running in an iframe | |||
@@ -147,7 +147,8 @@ public class Util { | |||
} | |||
} | |||
private static final Element escapeHtmlHelper = DOM.createDiv(); | |||
private static final com.google.gwt.user.client.Element escapeHtmlHelper = DOM | |||
.createDiv(); | |||
/** | |||
* Converts html entities to text. | |||
@@ -196,13 +197,14 @@ public class Util { | |||
* clone child tree also | |||
* @return | |||
*/ | |||
public static native Element cloneNode(Element element, boolean deep) | |||
public static native com.google.gwt.user.client.Element cloneNode( | |||
com.google.gwt.user.client.Element element, boolean deep) | |||
/*-{ | |||
return element.cloneNode(deep); | |||
}-*/; | |||
public static int measureHorizontalPaddingAndBorder(Element element, | |||
int paddingGuess) { | |||
public static int measureHorizontalPaddingAndBorder( | |||
com.google.gwt.user.client.Element element, int paddingGuess) { | |||
String originalWidth = DOM.getStyleAttribute(element, "width"); | |||
int originalOffsetWidth = element.getOffsetWidth(); | |||
@@ -218,8 +220,8 @@ public class Util { | |||
return padding; | |||
} | |||
public static int measureVerticalPaddingAndBorder(Element element, | |||
int paddingGuess) { | |||
public static int measureVerticalPaddingAndBorder( | |||
com.google.gwt.user.client.Element element, int paddingGuess) { | |||
String originalHeight = DOM.getStyleAttribute(element, "height"); | |||
int originalOffsetHeight = element.getOffsetHeight(); | |||
int widthGuess = (originalOffsetHeight - paddingGuess); | |||
@@ -233,7 +235,8 @@ public class Util { | |||
return padding; | |||
} | |||
public static int measureHorizontalBorder(Element element) { | |||
public static int measureHorizontalBorder( | |||
com.google.gwt.user.client.Element element) { | |||
int borders; | |||
if (BrowserInfo.get().isIE()) { | |||
@@ -264,7 +267,8 @@ public class Util { | |||
return borders; | |||
} | |||
public static int measureVerticalBorder(Element element) { | |||
public static int measureVerticalBorder( | |||
com.google.gwt.user.client.Element element) { | |||
int borders; | |||
if (BrowserInfo.get().isIE()) { | |||
String width = element.getStyle().getProperty("width"); | |||
@@ -296,7 +300,8 @@ public class Util { | |||
return borders; | |||
} | |||
public static int measureMarginLeft(Element element) { | |||
public static int measureMarginLeft( | |||
com.google.gwt.user.client.Element element) { | |||
return element.getAbsoluteLeft() | |||
- element.getParentElement().getAbsoluteLeft(); | |||
} | |||
@@ -345,8 +350,9 @@ public class Util { | |||
} | |||
} | |||
public static int setWidthExcludingPaddingAndBorder(Element element, | |||
int requestedWidth, int horizontalPaddingBorderGuess, | |||
public static int setWidthExcludingPaddingAndBorder( | |||
com.google.gwt.user.client.Element element, int requestedWidth, | |||
int horizontalPaddingBorderGuess, | |||
boolean requestedWidthIncludesPaddingBorder) { | |||
int widthGuess = requestedWidth - horizontalPaddingBorderGuess; | |||
@@ -378,8 +384,9 @@ public class Util { | |||
} | |||
public static int setHeightExcludingPaddingAndBorder(Element element, | |||
int requestedHeight, int verticalPaddingBorderGuess, | |||
public static int setHeightExcludingPaddingAndBorder( | |||
com.google.gwt.user.client.Element element, int requestedHeight, | |||
int verticalPaddingBorderGuess, | |||
boolean requestedHeightIncludesPaddingBorder) { | |||
int heightGuess = requestedHeight - verticalPaddingBorderGuess; | |||
@@ -420,7 +427,8 @@ public class Util { | |||
return name.substring(name.lastIndexOf('.') + 1); | |||
} | |||
public static void setFloat(Element element, String value) { | |||
public static void setFloat(com.google.gwt.user.client.Element element, | |||
String value) { | |||
if (BrowserInfo.get().isIE()) { | |||
DOM.setStyleAttribute(element, "styleFloat", value); | |||
} else { | |||
@@ -432,7 +440,7 @@ public class Util { | |||
public static int getNativeScrollbarSize() { | |||
if (detectedScrollbarSize < 0) { | |||
Element scroller = DOM.createDiv(); | |||
com.google.gwt.user.client.Element scroller = DOM.createDiv(); | |||
scroller.getStyle().setProperty("width", "50px"); | |||
scroller.getStyle().setProperty("height", "50px"); | |||
scroller.getStyle().setProperty("overflow", "scroll"); | |||
@@ -455,7 +463,8 @@ public class Util { | |||
* @param elem | |||
* with overflow auto | |||
*/ | |||
public static void runWebkitOverflowAutoFix(final Element elem) { | |||
public static void runWebkitOverflowAutoFix( | |||
final com.google.gwt.user.client.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()) { | |||
@@ -768,10 +777,11 @@ public class Util { | |||
* element does not belong to a child. | |||
*/ | |||
public static ComponentConnector getConnectorForElement( | |||
ApplicationConnection client, Widget parent, Element element) { | |||
ApplicationConnection client, Widget parent, | |||
com.google.gwt.user.client.Element element) { | |||
Element browseElement = element; | |||
Element rootElement = parent.getElement(); | |||
com.google.gwt.user.client.Element browseElement = element; | |||
com.google.gwt.user.client.Element rootElement = parent.getElement(); | |||
while (browseElement != null && browseElement != rootElement) { | |||
@@ -789,7 +799,8 @@ public class Util { | |||
if (connector != null) { | |||
// check that inside the rootElement | |||
while (browseElement != null && browseElement != rootElement) { | |||
browseElement = (Element) browseElement.getParentElement(); | |||
browseElement = (com.google.gwt.user.client.Element) browseElement | |||
.getParentElement(); | |||
} | |||
if (browseElement != rootElement) { | |||
return null; | |||
@@ -798,7 +809,8 @@ public class Util { | |||
} | |||
} | |||
browseElement = (Element) browseElement.getParentElement(); | |||
browseElement = (com.google.gwt.user.client.Element) browseElement | |||
.getParentElement(); | |||
} | |||
// No connector found, element is possibly inside a VOverlay | |||
@@ -819,7 +831,7 @@ public class Util { | |||
* @param el | |||
* the element to focus | |||
*/ | |||
public static native void focus(Element el) | |||
public static native void focus(com.google.gwt.user.client.Element el) | |||
/*-{ | |||
try { | |||
el.focus(); | |||
@@ -836,7 +848,8 @@ public class Util { | |||
* the element to start from | |||
*/ | |||
public static ComponentConnector findPaintable( | |||
ApplicationConnection client, Element element) { | |||
ApplicationConnection client, | |||
com.google.gwt.user.client.Element element) { | |||
Widget widget = Util.findWidget(element, null); | |||
ConnectorMap vPaintableMap = ConnectorMap.get(client); | |||
while (widget != null && !vPaintableMap.isConnector(widget)) { | |||
@@ -856,7 +869,7 @@ public class Util { | |||
* the Widget type to seek for | |||
*/ | |||
@SuppressWarnings("unchecked") | |||
public static <T> T findWidget(Element element, | |||
public static <T> T findWidget(com.google.gwt.user.client.Element element, | |||
Class<? extends Widget> class1) { | |||
if (element != null) { | |||
/* First seek for the first EventListener (~Widget) from dom */ | |||
@@ -864,7 +877,8 @@ public class Util { | |||
while (eventListener == null && element != null) { | |||
eventListener = Event.getEventListener(element); | |||
if (eventListener == null) { | |||
element = (Element) element.getParentElement(); | |||
element = (com.google.gwt.user.client.Element) element | |||
.getParentElement(); | |||
} | |||
} | |||
if (eventListener instanceof Widget) { | |||
@@ -890,7 +904,8 @@ public class Util { | |||
* @param element | |||
* The element that should be redrawn | |||
*/ | |||
public static void forceWebkitRedraw(Element element) { | |||
public static void forceWebkitRedraw( | |||
com.google.gwt.user.client.Element element) { | |||
Style style = element.getStyle(); | |||
String s = style.getProperty("webkitTransform"); | |||
if (s == null || s.length() == 0) { | |||
@@ -908,7 +923,7 @@ public class Util { | |||
* @param e | |||
* The element to perform the hack on | |||
*/ | |||
public static final void forceIE8Redraw(Element e) { | |||
public static final void forceIE8Redraw(com.google.gwt.user.client.Element e) { | |||
if (BrowserInfo.get().isIE8()) { | |||
setStyleTemporarily(e, "zoom", "1"); | |||
} | |||
@@ -923,7 +938,7 @@ public class Util { | |||
* @param element | |||
* The element to detach and re-attach | |||
*/ | |||
public static void detachAttach(Element element) { | |||
public static void detachAttach(com.google.gwt.user.client.Element element) { | |||
if (element == null) { | |||
return; | |||
} | |||
@@ -943,11 +958,14 @@ public class Util { | |||
} | |||
public static void sinkOnloadForImages(Element element) { | |||
public static void sinkOnloadForImages( | |||
com.google.gwt.user.client.Element element) { | |||
NodeList<com.google.gwt.dom.client.Element> imgElements = element | |||
.getElementsByTagName("img"); | |||
for (int i = 0; i < imgElements.getLength(); i++) { | |||
DOM.sinkEvents((Element) imgElements.getItem(i), Event.ONLOAD); | |||
DOM.sinkEvents( | |||
(com.google.gwt.user.client.Element) imgElements.getItem(i), | |||
Event.ONLOAD); | |||
} | |||
} | |||
@@ -958,7 +976,8 @@ public class Util { | |||
* @param subElement | |||
* @return | |||
*/ | |||
public static int getChildElementIndex(Element childElement) { | |||
public static int getChildElementIndex( | |||
com.google.gwt.user.client.Element childElement) { | |||
int idx = 0; | |||
Node n = childElement; | |||
while ((n = n.getPreviousSibling()) != null) { | |||
@@ -1038,7 +1057,8 @@ public class Util { | |||
* @param tempValue | |||
* The temporary value | |||
*/ | |||
public static void setStyleTemporarily(Element element, | |||
public static void setStyleTemporarily( | |||
com.google.gwt.user.client.Element element, | |||
final String styleProperty, String tempValue) { | |||
final Style style = element.getStyle(); | |||
final String currentValue = style.getProperty(styleProperty); | |||
@@ -1074,7 +1094,8 @@ public class Util { | |||
* the mouse event to get coordinates from | |||
* @return the element at the coordinates of the event | |||
*/ | |||
public static Element getElementUnderMouse(NativeEvent event) { | |||
public static com.google.gwt.user.client.Element getElementUnderMouse( | |||
NativeEvent event) { | |||
int pageX = getTouchOrMouseClientX(event); | |||
int pageY = getTouchOrMouseClientY(event); | |||
@@ -1146,8 +1167,8 @@ public class Util { | |||
* Get target with element from point as we want the actual element, not | |||
* the one that sunk the event. | |||
*/ | |||
final Element target = getElementFromPoint(touch.getClientX(), | |||
touch.getClientY()); | |||
final com.google.gwt.user.client.Element target = getElementFromPoint( | |||
touch.getClientX(), touch.getClientY()); | |||
/* | |||
* Fixes infocusable form fields in Safari of iOS 5.x and some Android | |||
@@ -1181,7 +1202,7 @@ public class Util { | |||
* | |||
* @return The active element or null if no active element could be found. | |||
*/ | |||
public native static Element getFocusedElement() | |||
public native static com.google.gwt.user.client.Element getFocusedElement() | |||
/*-{ | |||
if ($wnd.document.activeElement) { | |||
return $wnd.document.activeElement; | |||
@@ -1197,7 +1218,7 @@ public class Util { | |||
* @deprecated Use #getFocusedElement instead | |||
*/ | |||
@Deprecated | |||
public static Element getIEFocusedElement() { | |||
public static com.google.gwt.user.client.Element getIEFocusedElement() { | |||
return getFocusedElement(); | |||
} | |||
@@ -1243,7 +1264,8 @@ public class Util { | |||
* @param elem | |||
* The element to scroll into view | |||
*/ | |||
public static native void scrollIntoViewVertically(Element elem) | |||
public static native void scrollIntoViewVertically( | |||
com.google.gwt.user.client.Element elem) | |||
/*-{ | |||
var top = elem.offsetTop; | |||
var height = elem.offsetHeight; |
@@ -18,7 +18,6 @@ package com.vaadin.client; | |||
import com.google.gwt.aria.client.Roles; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.vaadin.client.communication.StateChangeEvent; | |||
@@ -37,15 +36,15 @@ public class VCaption extends HTML { | |||
private final ComponentConnector owner; | |||
private Element errorIndicatorElement; | |||
private com.google.gwt.user.client.Element errorIndicatorElement; | |||
private Element requiredFieldIndicator; | |||
private com.google.gwt.user.client.Element requiredFieldIndicator; | |||
private Icon icon; | |||
private String iconAltText = ""; | |||
private Element captionText; | |||
private com.google.gwt.user.client.Element captionText; | |||
private final ApplicationConnection client; | |||
@@ -412,7 +411,8 @@ public class VCaption extends HTML { | |||
@Override | |||
public void onBrowserEvent(Event event) { | |||
super.onBrowserEvent(event); | |||
final Element target = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
if (DOM.eventGetType(event) == Event.ONLOAD | |||
&& icon.getElement() == target) { | |||
@@ -669,20 +669,22 @@ public class VCaption extends HTML { | |||
return tooltipInfo; | |||
} | |||
protected Element getTextElement() { | |||
protected com.google.gwt.user.client.Element getTextElement() { | |||
return captionText; | |||
} | |||
public static String getCaptionOwnerPid(Element e) { | |||
public static String getCaptionOwnerPid(com.google.gwt.user.client.Element e) { | |||
return getOwnerPid(e); | |||
} | |||
private native static void setOwnerPid(Element el, String pid) | |||
private native static void setOwnerPid( | |||
com.google.gwt.user.client.Element el, String pid) | |||
/*-{ | |||
el.vOwnerPid = pid; | |||
}-*/; | |||
public native static String getOwnerPid(Element el) | |||
public native static String getOwnerPid( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
return el.vOwnerPid; | |||
}-*/; |
@@ -17,7 +17,6 @@ | |||
package com.vaadin.client; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -62,7 +61,7 @@ public class VErrorMessage extends FlowPanel { | |||
* | |||
* @param indicatorElement | |||
*/ | |||
public void showAt(Element indicatorElement) { | |||
public void showAt(com.google.gwt.user.client.Element indicatorElement) { | |||
VOverlay errorContainer = (VOverlay) getParent(); | |||
if (errorContainer == null) { | |||
errorContainer = new VOverlay(); |
@@ -19,7 +19,6 @@ package com.vaadin.client; | |||
import com.google.gwt.dom.client.Style.Display; | |||
import com.google.gwt.dom.client.Style.Position; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Timer; | |||
/** | |||
@@ -67,7 +66,7 @@ public class VLoadingIndicator { | |||
} | |||
}; | |||
private Element element; | |||
private com.google.gwt.user.client.Element element; | |||
/** | |||
* Returns the delay (in ms) which must pass before the loading indicator | |||
@@ -228,7 +227,7 @@ public class VLoadingIndicator { | |||
* | |||
* @return The loading indicator DOM element | |||
*/ | |||
public Element getElement() { | |||
public com.google.gwt.user.client.Element getElement() { | |||
if (element == null) { | |||
element = DOM.createDiv(); | |||
element.getStyle().setPosition(Position.ABSOLUTE); |
@@ -30,7 +30,6 @@ import com.google.gwt.event.dom.client.KeyDownHandler; | |||
import com.google.gwt.event.dom.client.MouseMoveEvent; | |||
import com.google.gwt.event.dom.client.MouseMoveHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
@@ -49,7 +48,7 @@ public class VTooltip extends VWindowOverlay { | |||
| Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONMOUSEMOVE | |||
| Event.ONCLICK; | |||
VErrorMessage em = new VErrorMessage(); | |||
Element description = DOM.createDiv(); | |||
com.google.gwt.user.client.Element description = DOM.createDiv(); | |||
private boolean closing = false; | |||
private boolean opening = false; | |||
@@ -324,7 +323,8 @@ public class VTooltip extends VWindowOverlay { | |||
* Element used in search | |||
* @return true if connector and tooltip found | |||
*/ | |||
private boolean resolveConnector(Element element) { | |||
private boolean resolveConnector( | |||
com.google.gwt.user.client.Element element) { | |||
ApplicationConnection ac = getApplicationConnection(); | |||
ComponentConnector connector = Util.getConnectorForElement(ac, | |||
@@ -410,8 +410,8 @@ public class VTooltip extends VWindowOverlay { | |||
private void handleShowHide(DomEvent domEvent, boolean isFocused) { | |||
Event event = Event.as(domEvent.getNativeEvent()); | |||
com.google.gwt.dom.client.Element element = Element.as(event | |||
.getEventTarget()); | |||
com.google.gwt.dom.client.Element element = com.google.gwt.user.client.Element | |||
.as(event.getEventTarget()); | |||
// We can ignore move event if it's handled by move or over already | |||
if (currentElement == element && handledByFocus == true) { |
@@ -20,7 +20,6 @@ import java.util.List; | |||
import com.google.gwt.core.client.JavaScriptObject; | |||
import com.google.gwt.core.client.JsArray; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ApplicationConnection; | |||
/** | |||
@@ -72,7 +71,8 @@ public class ComponentLocator { | |||
* @return A String locator that identifies the target element or null if a | |||
* String locator could not be created. | |||
*/ | |||
public String getPathForElement(Element targetElement) { | |||
public String getPathForElement( | |||
com.google.gwt.user.client.Element targetElement) { | |||
for (LocatorStrategy strategy : locatorStrategies) { | |||
String path = strategy.getPathForElement(targetElement); | |||
if (null != path) { | |||
@@ -94,10 +94,11 @@ public class ComponentLocator { | |||
* @return The DOM element identified by {@code path} or null if the element | |||
* could not be located. | |||
*/ | |||
public Element getElementByPath(String path) { | |||
public com.google.gwt.user.client.Element getElementByPath(String path) { | |||
for (LocatorStrategy strategy : locatorStrategies) { | |||
if (strategy.validatePath(path)) { | |||
Element element = strategy.getElementByPath(path); | |||
com.google.gwt.user.client.Element element = strategy | |||
.getElementByPath(path); | |||
if (null != element) { | |||
return element; | |||
} | |||
@@ -116,13 +117,16 @@ public class ComponentLocator { | |||
* @return The JavaScriptArray of DOM elements identified by {@code path} or | |||
* empty array if elements could not be located. | |||
*/ | |||
public JsArray<Element> getElementsByPath(String path) { | |||
JsArray<Element> jsElements = JavaScriptObject.createArray().cast(); | |||
public JsArray<com.google.gwt.user.client.Element> getElementsByPath( | |||
String path) { | |||
JsArray<com.google.gwt.user.client.Element> jsElements = JavaScriptObject | |||
.createArray().cast(); | |||
for (LocatorStrategy strategy : locatorStrategies) { | |||
if (strategy.validatePath(path)) { | |||
List<Element> elements = strategy.getElementsByPath(path); | |||
List<com.google.gwt.user.client.Element> elements = strategy | |||
.getElementsByPath(path); | |||
if (elements.size() > 0) { | |||
for (Element e : elements) { | |||
for (com.google.gwt.user.client.Element e : elements) { | |||
jsElements.push(e); | |||
} | |||
return jsElements; | |||
@@ -146,15 +150,16 @@ public class ComponentLocator { | |||
* @return The JavaScriptArray of DOM elements identified by {@code path} or | |||
* empty array if elements could not be located. | |||
*/ | |||
public JsArray<Element> getElementsByPathStartingAt(String path, | |||
Element root) { | |||
JsArray<Element> jsElements = JavaScriptObject.createArray().cast(); | |||
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(); | |||
for (LocatorStrategy strategy : locatorStrategies) { | |||
if (strategy.validatePath(path)) { | |||
List<Element> elements = strategy.getElementsByPathStartingAt( | |||
path, root); | |||
List<com.google.gwt.user.client.Element> elements = strategy | |||
.getElementsByPathStartingAt(path, root); | |||
if (elements.size() > 0) { | |||
for (Element e : elements) { | |||
for (com.google.gwt.user.client.Element e : elements) { | |||
jsElements.push(e); | |||
} | |||
return jsElements; | |||
@@ -177,11 +182,12 @@ public class ComponentLocator { | |||
* @return The DOM element identified by {@code path} or null if the element | |||
* could not be located. | |||
*/ | |||
public Element getElementByPathStartingAt(String path, Element root) { | |||
public com.google.gwt.user.client.Element getElementByPathStartingAt( | |||
String path, com.google.gwt.user.client.Element root) { | |||
for (LocatorStrategy strategy : locatorStrategies) { | |||
if (strategy.validatePath(path)) { | |||
Element element = strategy.getElementByPathStartingAt(path, | |||
root); | |||
com.google.gwt.user.client.Element element = strategy | |||
.getElementByPathStartingAt(path, root); | |||
if (null != element) { | |||
return element; | |||
} |
@@ -22,7 +22,6 @@ import java.util.List; | |||
import com.google.gwt.core.client.JavaScriptObject; | |||
import com.google.gwt.regexp.shared.RegExp; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -87,7 +86,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
} | |||
@Override | |||
public String getPathForElement(Element targetElement) { | |||
public String getPathForElement( | |||
com.google.gwt.user.client.Element targetElement) { | |||
ComponentConnector connector = Util | |||
.findPaintable(client, targetElement); | |||
@@ -191,7 +191,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Element getElementByPath(String path) { | |||
public com.google.gwt.user.client.Element getElementByPath(String path) { | |||
return getElementByPathStartingAt(path, null); | |||
} | |||
@@ -199,7 +199,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Element getElementByPathStartingAt(String path, Element baseElement) { | |||
public com.google.gwt.user.client.Element getElementByPathStartingAt( | |||
String path, com.google.gwt.user.client.Element baseElement) { | |||
/* | |||
* Path is of type "targetWidgetPath#componentPart" or | |||
* "targetWidgetPath". | |||
@@ -238,10 +239,11 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public List<Element> getElementsByPath(String path) { | |||
public List<com.google.gwt.user.client.Element> getElementsByPath( | |||
String path) { | |||
// This type of search is not supported in LegacyLocator | |||
List<Element> array = new ArrayList<Element>(); | |||
Element e = getElementByPath(path); | |||
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); | |||
if (e != null) { | |||
array.add(e); | |||
} | |||
@@ -252,10 +254,12 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public List<Element> getElementsByPathStartingAt(String path, Element root) { | |||
public List<com.google.gwt.user.client.Element> getElementsByPathStartingAt( | |||
String path, com.google.gwt.user.client.Element root) { | |||
// This type of search is not supported in LegacyLocator | |||
List<Element> array = new ArrayList<Element>(); | |||
Element e = getElementByPathStartingAt(path, root); | |||
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); | |||
if (e != null) { | |||
array.add(e); | |||
} | |||
@@ -294,7 +298,9 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* @return The widget whose root element is a parent of | |||
* {@code targetElement}. | |||
*/ | |||
private Widget findParentWidget(Element targetElement, Widget ancestorWidget) { | |||
private Widget findParentWidget( | |||
com.google.gwt.user.client.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 | |||
@@ -323,9 +329,10 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* @return The element identified by path, relative to baseElement or null | |||
* if the element could not be found. | |||
*/ | |||
private Element getElementByDOMPath(Element baseElement, String path) { | |||
private com.google.gwt.user.client.Element getElementByDOMPath( | |||
com.google.gwt.user.client.Element baseElement, String path) { | |||
String parts[] = path.split(PARENTCHILD_SEPARATOR); | |||
Element element = baseElement; | |||
com.google.gwt.user.client.Element element = baseElement; | |||
for (int i = 0, l = parts.length; i < l; ++i) { | |||
String part = parts[i]; | |||
@@ -335,7 +342,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
if (Util.findWidget(baseElement, null) instanceof VAbstractOrderedLayout) { | |||
if (element.hasChildNodes()) { | |||
Element e = element.getFirstChildElement().cast(); | |||
com.google.gwt.user.client.Element e = element | |||
.getFirstChildElement().cast(); | |||
String cn = e.getClassName(); | |||
if (cn != null | |||
&& (cn.equals("v-expand") || cn | |||
@@ -384,12 +392,14 @@ public class LegacyLocatorStrategy implements LocatorStrategy { | |||
* {@link #getElementByDOMPath(com.google.gwt.user.client.Element, String)} | |||
* or null if the locator String cannot be created. | |||
*/ | |||
private String getDOMPathForElement(Element element, Element baseElement) { | |||
Element e = element; | |||
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; | |||
String path = ""; | |||
while (true) { | |||
int childIndex = -1; | |||
Element siblingIterator = e; | |||
com.google.gwt.user.client.Element siblingIterator = e; | |||
while (siblingIterator != null) { | |||
childIndex++; | |||
siblingIterator = siblingIterator.getPreviousSiblingElement() |
@@ -17,8 +17,6 @@ package com.vaadin.client.componentlocator; | |||
import java.util.List; | |||
import com.google.gwt.user.client.Element; | |||
/** | |||
* This interface should be implemented by all locator strategies. A locator | |||
* strategy is responsible for generating and decoding a string that identifies | |||
@@ -59,7 +57,7 @@ public interface LocatorStrategy { | |||
* @return A String locator that identifies the target element or null if a | |||
* String locator could not be created. | |||
*/ | |||
String getPathForElement(Element targetElement); | |||
String getPathForElement(com.google.gwt.user.client.Element targetElement); | |||
/** | |||
* Locates an element using a String locator (path) which identifies a DOM | |||
@@ -72,7 +70,7 @@ public interface LocatorStrategy { | |||
* @return The DOM element identified by {@code path} or null if the element | |||
* could not be located. | |||
*/ | |||
Element getElementByPath(String path); | |||
com.google.gwt.user.client.Element getElementByPath(String path); | |||
/** | |||
* Locates an element using a String locator (path) which identifies a DOM | |||
@@ -87,7 +85,8 @@ public interface LocatorStrategy { | |||
* @return The DOM element identified by {@code path} or null if the element | |||
* could not be located. | |||
*/ | |||
Element getElementByPathStartingAt(String path, Element root); | |||
com.google.gwt.user.client.Element getElementByPathStartingAt(String path, | |||
com.google.gwt.user.client.Element root); | |||
/** | |||
* Locates all elements that match a String locator (path) which identifies | |||
@@ -100,7 +99,7 @@ public interface LocatorStrategy { | |||
* @return List that contains all matched elements. Empty list if none | |||
* found. | |||
*/ | |||
List<Element> getElementsByPath(String path); | |||
List<com.google.gwt.user.client.Element> getElementsByPath(String path); | |||
/** | |||
* Locates all elements that match a String locator (path) which identifies | |||
@@ -118,5 +117,6 @@ public interface LocatorStrategy { | |||
* found. | |||
*/ | |||
List<Element> getElementsByPathStartingAt(String path, Element root); | |||
List<com.google.gwt.user.client.Element> getElementsByPathStartingAt( | |||
String path, com.google.gwt.user.client.Element root); | |||
} |
@@ -19,7 +19,6 @@ import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.List; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -71,7 +70,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public String getPathForElement(Element targetElement) { | |||
public String getPathForElement( | |||
com.google.gwt.user.client.Element targetElement) { | |||
if (targetElement == null) { | |||
return ""; | |||
} | |||
@@ -116,7 +116,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* Target element | |||
* @return Best selector string formatted with a post filter | |||
*/ | |||
private String getBestSelector(List<String> selectors, Element target) { | |||
private String getBestSelector(List<String> selectors, | |||
com.google.gwt.user.client.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); | |||
@@ -214,8 +215,9 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* @return a list of ConnectorPath objects, in descending order towards the | |||
* common root container. | |||
*/ | |||
private List<ConnectorPath> getConnectorHierarchyForElement(Element elem) { | |||
Element e = elem; | |||
private List<ConnectorPath> getConnectorHierarchyForElement( | |||
com.google.gwt.user.client.Element elem) { | |||
com.google.gwt.user.client.Element e = elem; | |||
ComponentConnector c = Util.findPaintable(client, e); | |||
List<ConnectorPath> connectorHierarchy = new ArrayList<ConnectorPath>(); | |||
@@ -233,7 +235,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
} | |||
} | |||
e = (Element) e.getParentElement(); | |||
e = (com.google.gwt.user.client.Element) e.getParentElement(); | |||
if (e != null) { | |||
c = Util.findPaintable(client, e); | |||
e = c != null ? c.getWidget().getElement() : null; | |||
@@ -274,14 +276,15 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public List<Element> getElementsByPath(String path) { | |||
public List<com.google.gwt.user.client.Element> getElementsByPath( | |||
String path) { | |||
List<SelectorPredicate> postFilters = SelectorPredicate | |||
.extractPostFilterPredicates(path); | |||
if (postFilters.size() > 0) { | |||
path = path.substring(1, path.lastIndexOf(')')); | |||
} | |||
List<Element> elements = new ArrayList<Element>(); | |||
List<com.google.gwt.user.client.Element> elements = new ArrayList<com.google.gwt.user.client.Element>(); | |||
if (isNotificationExpression(path)) { | |||
for (VNotification n : findNotificationsByPath(path)) { | |||
@@ -302,7 +305,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
if (p.getIndex() >= elements.size()) { | |||
elements.clear(); | |||
} else { | |||
Element e = elements.get(p.getIndex()); | |||
com.google.gwt.user.client.Element e = elements.get(p | |||
.getIndex()); | |||
elements.clear(); | |||
elements.add(e); | |||
} | |||
@@ -316,8 +320,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Element getElementByPath(String path) { | |||
List<Element> elements = getElementsByPath(path); | |||
public com.google.gwt.user.client.Element getElementByPath(String path) { | |||
List<com.google.gwt.user.client.Element> elements = getElementsByPath(path); | |||
if (elements.isEmpty()) { | |||
return null; | |||
} | |||
@@ -328,8 +332,10 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public Element getElementByPathStartingAt(String path, Element root) { | |||
List<Element> elements = getElementsByPathStartingAt(path, root); | |||
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); | |||
if (elements.isEmpty()) { | |||
return null; | |||
} | |||
@@ -341,15 +347,16 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
public List<Element> getElementsByPathStartingAt(String path, Element root) { | |||
public List<com.google.gwt.user.client.Element> getElementsByPathStartingAt( | |||
String path, com.google.gwt.user.client.Element root) { | |||
List<SelectorPredicate> postFilters = SelectorPredicate | |||
.extractPostFilterPredicates(path); | |||
if (postFilters.size() > 0) { | |||
path = path.substring(1, path.lastIndexOf(')')); | |||
} | |||
List<Element> elements = getElementsByPathStartingAtConnector(path, | |||
Util.findPaintable(client, root)); | |||
List<com.google.gwt.user.client.Element> elements = getElementsByPathStartingAtConnector( | |||
path, Util.findPaintable(client, root)); | |||
for (SelectorPredicate p : postFilters) { | |||
// Post filtering supports only indexes and follows instruction | |||
@@ -359,7 +366,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
if (p.getIndex() >= elements.size()) { | |||
elements.clear(); | |||
} else { | |||
Element e = elements.get(p.getIndex()); | |||
com.google.gwt.user.client.Element e = elements.get(p | |||
.getIndex()); | |||
elements.clear(); | |||
elements.add(e); | |||
} | |||
@@ -416,8 +424,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
* @return the list of elements identified by path or empty list if not | |||
* found. | |||
*/ | |||
private List<Element> getElementsByPathStartingAtConnector(String path, | |||
ComponentConnector root) { | |||
private List<com.google.gwt.user.client.Element> getElementsByPathStartingAtConnector( | |||
String path, ComponentConnector root) { | |||
String[] pathComponents = path.split(SUBPART_SEPARATOR); | |||
List<ComponentConnector> connectors; | |||
if (pathComponents[0].length() > 0) { | |||
@@ -427,7 +435,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { | |||
connectors = Arrays.asList(root); | |||
} | |||
List<Element> output = new ArrayList<Element>(); | |||
List<com.google.gwt.user.client.Element> output = new ArrayList<com.google.gwt.user.client.Element>(); | |||
if (null != connectors && !connectors.isEmpty()) { | |||
if (pathComponents.length > 1) { | |||
// We have subparts |
@@ -19,7 +19,6 @@ import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.event.dom.client.KeyCodes; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
@@ -108,14 +107,16 @@ public class HierarchySection implements Section { | |||
hierarchyPanel.addListener(new SelectConnectorListener() { | |||
@Override | |||
public void select(ServerConnector connector, Element element) { | |||
public void select(ServerConnector connector, | |||
com.google.gwt.user.client.Element element) { | |||
printState(connector, true); | |||
} | |||
}); | |||
analyzeLayoutsPanel.addListener(new SelectConnectorListener() { | |||
@Override | |||
public void select(ServerConnector connector, Element element) { | |||
public void select(ServerConnector connector, | |||
com.google.gwt.user.client.Element element) { | |||
printState(connector, true); | |||
} | |||
}); | |||
@@ -240,9 +241,10 @@ public class HierarchySection implements Section { | |||
} | |||
if (event.getTypeInt() == Event.ONMOUSEMOVE) { | |||
Highlight.hideAll(); | |||
Element eventTarget = Util.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
com.google.gwt.user.client.Element eventTarget = Util | |||
.getElementFromPoint(event.getNativeEvent() | |||
.getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { | |||
infoPanel.clear(); | |||
return; | |||
@@ -272,9 +274,10 @@ public class HierarchySection implements Section { | |||
event.consume(); | |||
event.getNativeEvent().stopPropagation(); | |||
stopFind(); | |||
Element eventTarget = Util.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
com.google.gwt.user.client.Element eventTarget = Util | |||
.getElementFromPoint(event.getNativeEvent() | |||
.getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
for (ApplicationConnection a : ApplicationConfiguration | |||
.getRunningApplications()) { | |||
ComponentConnector connector = Util.getConnectorForElement( |
@@ -21,7 +21,6 @@ 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.Element; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.BrowserInfo; | |||
@@ -51,7 +50,7 @@ public class Highlight { | |||
private static final int MIN_WIDTH = 3; | |||
private static final int MIN_HEIGHT = 3; | |||
static HashSet<Element> highlights; | |||
static HashSet<com.google.gwt.user.client.Element> highlights; | |||
/** | |||
* Highlight the {@link Widget} for the given {@link ComponentConnector}. | |||
@@ -64,7 +63,7 @@ public class Highlight { | |||
* ComponentConnector | |||
* @return Highlight element | |||
*/ | |||
static Element show(ComponentConnector connector) { | |||
static com.google.gwt.user.client.Element show(ComponentConnector connector) { | |||
return show(connector, DEFAULT_COLOR); | |||
} | |||
@@ -83,7 +82,7 @@ public class Highlight { | |||
* @return Highlight element, or <code>null</code> if the connector isn't a | |||
* component | |||
*/ | |||
static Element showOnly(ServerConnector connector) { | |||
static com.google.gwt.user.client.Element showOnly(ServerConnector connector) { | |||
hideAll(); | |||
if (connector instanceof ComponentConnector) { | |||
return show((ComponentConnector) connector); | |||
@@ -106,7 +105,8 @@ public class Highlight { | |||
* Color of highlight | |||
* @return Highlight element | |||
*/ | |||
static Element show(ComponentConnector connector, String color) { | |||
static com.google.gwt.user.client.Element show( | |||
ComponentConnector connector, String color) { | |||
if (connector != null) { | |||
Widget w = connector.getWidget(); | |||
return show(w, color); | |||
@@ -125,7 +125,7 @@ public class Highlight { | |||
* Widget to highlight | |||
* @return Highlight element | |||
*/ | |||
static Element show(Widget widget) { | |||
static com.google.gwt.user.client.Element show(Widget widget) { | |||
return show(widget, DEFAULT_COLOR); | |||
} | |||
@@ -142,7 +142,7 @@ public class Highlight { | |||
* Color of highlight | |||
* @return Highlight element | |||
*/ | |||
static Element show(Widget widget, String color) { | |||
static com.google.gwt.user.client.Element show(Widget widget, String color) { | |||
if (widget != null) { | |||
show(widget.getElement(), color); | |||
} | |||
@@ -160,7 +160,8 @@ public class Highlight { | |||
* Element to highlight | |||
* @return Highlight element | |||
*/ | |||
static Element show(Element element) { | |||
static com.google.gwt.user.client.Element show( | |||
com.google.gwt.user.client.Element element) { | |||
return show(element, DEFAULT_COLOR); | |||
} | |||
@@ -177,13 +178,14 @@ public class Highlight { | |||
* Color of highlight | |||
* @return Highlight element | |||
*/ | |||
static Element show(Element element, String color) { | |||
static com.google.gwt.user.client.Element show( | |||
com.google.gwt.user.client.Element element, String color) { | |||
if (element != null) { | |||
if (highlights == null) { | |||
highlights = new HashSet<Element>(); | |||
highlights = new HashSet<com.google.gwt.user.client.Element>(); | |||
} | |||
Element highlight = DOM.createDiv(); | |||
com.google.gwt.user.client.Element highlight = DOM.createDiv(); | |||
Style style = highlight.getStyle(); | |||
style.setTop(element.getAbsoluteTop(), Unit.PX); | |||
style.setLeft(element.getAbsoluteLeft(), Unit.PX); | |||
@@ -221,7 +223,7 @@ public class Highlight { | |||
* @param highlight | |||
* Highlight to hide | |||
*/ | |||
static void hide(Element highlight) { | |||
static void hide(com.google.gwt.user.client.Element highlight) { | |||
if (highlight != null && highlight.getParentElement() != null) { | |||
highlight.getParentElement().removeChild(highlight); | |||
highlights.remove(highlight); | |||
@@ -233,7 +235,7 @@ public class Highlight { | |||
*/ | |||
static void hideAll() { | |||
if (highlights != null) { | |||
for (Element highlight : highlights) { | |||
for (com.google.gwt.user.client.Element highlight : highlights) { | |||
if (highlight.getParentElement() != null) { | |||
highlight.getParentElement().removeChild(highlight); | |||
} |
@@ -15,7 +15,6 @@ | |||
*/ | |||
package com.vaadin.client.debug.internal; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ServerConnector; | |||
/** | |||
@@ -33,5 +32,6 @@ public interface SelectConnectorListener { | |||
* @param element | |||
* selected element of the connector or null if unknown | |||
*/ | |||
public void select(ServerConnector connector, Element element); | |||
public void select(ServerConnector connector, | |||
com.google.gwt.user.client.Element element); | |||
} |
@@ -20,7 +20,6 @@ import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ServerConnector; | |||
import com.vaadin.client.componentlocator.ComponentLocator; | |||
import com.vaadin.client.componentlocator.SelectorPredicate; | |||
@@ -36,7 +35,7 @@ import com.vaadin.client.componentlocator.SelectorPredicate; | |||
*/ | |||
public class SelectorPath { | |||
private final String path; | |||
private final Element element; | |||
private final com.google.gwt.user.client.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>(); | |||
@@ -46,7 +45,8 @@ public class SelectorPath { | |||
legacyNames.put("ScrollTable", "Table"); | |||
} | |||
protected SelectorPath(ServerConnector c, Element e) { | |||
protected SelectorPath(ServerConnector c, | |||
com.google.gwt.user.client.Element e) { | |||
element = e; | |||
locator = new ComponentLocator(c.getConnection()); | |||
path = locator.getPathForElement(e); | |||
@@ -56,7 +56,7 @@ public class SelectorPath { | |||
return path; | |||
} | |||
public Element getElement() { | |||
public com.google.gwt.user.client.Element getElement() { | |||
return element; | |||
} | |||
@@ -26,7 +26,6 @@ import com.google.gwt.event.dom.client.MouseOutHandler; | |||
import com.google.gwt.event.dom.client.MouseOverEvent; | |||
import com.google.gwt.event.dom.client.MouseOverHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
@@ -73,7 +72,7 @@ public class TestBenchSection implements Section { | |||
public void onMouseOver(MouseOverEvent event) { | |||
Highlight.hideAll(); | |||
Element element = path.getElement(); | |||
com.google.gwt.user.client.Element element = path.getElement(); | |||
if (null != element) { | |||
Highlight.show(element); | |||
} | |||
@@ -193,7 +192,8 @@ public class TestBenchSection implements Section { | |||
Highlight.hideAll(); | |||
} | |||
private void pickSelector(ServerConnector connector, Element element) { | |||
private void pickSelector(ServerConnector connector, | |||
com.google.gwt.user.client.Element element) { | |||
SelectorPath p = new SelectorPath(connector, Util | |||
.findPaintable(connector.getConnection(), element).getWidget() | |||
@@ -216,9 +216,10 @@ public class TestBenchSection implements Section { | |||
} | |||
if (event.getTypeInt() == Event.ONMOUSEMOVE | |||
|| event.getTypeInt() == Event.ONCLICK) { | |||
Element eventTarget = Util.getElementFromPoint(event | |||
.getNativeEvent().getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
com.google.gwt.user.client.Element eventTarget = Util | |||
.getElementFromPoint(event.getNativeEvent() | |||
.getClientX(), event.getNativeEvent() | |||
.getClientY()); | |||
if (VDebugWindow.get().getElement().isOrHasChild(eventTarget)) { | |||
if (isFindMode() && event.getTypeInt() == Event.ONCLICK) { | |||
stopFind(); | |||
@@ -258,7 +259,8 @@ public class TestBenchSection implements Section { | |||
}; | |||
private ComponentConnector findConnector(Element element) { | |||
private ComponentConnector findConnector( | |||
com.google.gwt.user.client.Element element) { | |||
for (ApplicationConnection a : ApplicationConfiguration | |||
.getRunningApplications()) { | |||
ComponentConnector connector = Util.getConnectorForElement(a, a |
@@ -27,7 +27,6 @@ import com.google.gwt.event.dom.client.MouseUpEvent; | |||
import com.google.gwt.event.dom.client.MouseUpHandler; | |||
import com.google.gwt.event.shared.EventHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
@@ -49,7 +48,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
/** | |||
* The element where the last mouse down event was registered. | |||
*/ | |||
private Element lastMouseDownTarget; | |||
private com.google.gwt.user.client.Element lastMouseDownTarget; | |||
/** | |||
* Set to true by {@link #mouseUpPreviewHandler} if it gets a mouseup at the | |||
@@ -72,8 +71,8 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
// Event's reported target not always correct if event | |||
// capture is in use | |||
Element elementUnderMouse = Util.getElementUnderMouse(event | |||
.getNativeEvent()); | |||
com.google.gwt.user.client.Element elementUnderMouse = Util | |||
.getElementUnderMouse(event.getNativeEvent()); | |||
if (lastMouseDownTarget != null | |||
&& elementUnderMouse == lastMouseDownTarget) { | |||
mouseUpPreviewMatched = true; | |||
@@ -238,7 +237,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, | |||
* @return The Element used for calculating relative coordinates for a click | |||
* or null if no relative coordinates can be calculated. | |||
*/ | |||
protected Element getRelativeToElement() { | |||
protected com.google.gwt.user.client.Element getRelativeToElement() { | |||
return connector.getWidget().getElement(); | |||
} | |||
@@ -21,7 +21,6 @@ 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.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.google.gwt.user.client.ui.impl.FocusImpl; | |||
@@ -68,10 +67,10 @@ public class FocusElementPanel extends SimpleFocusablePanel { | |||
public void setFocus(boolean focus) { | |||
if (focus) { | |||
FocusImpl.getFocusImplForPanel().focus( | |||
(Element) focusElement.cast()); | |||
(com.google.gwt.user.client.Element) focusElement.cast()); | |||
} else { | |||
FocusImpl.getFocusImplForPanel() | |||
.blur((Element) focusElement.cast()); | |||
FocusImpl.getFocusImplForPanel().blur( | |||
(com.google.gwt.user.client.Element) focusElement.cast()); | |||
} | |||
} | |||
@@ -86,7 +85,7 @@ public class FocusElementPanel extends SimpleFocusablePanel { | |||
/** | |||
* @return the focus element | |||
*/ | |||
public Element getFocusElement() { | |||
public com.google.gwt.user.client.Element getFocusElement() { | |||
return focusElement.cast(); | |||
} | |||
} |
@@ -29,7 +29,6 @@ import com.google.gwt.event.dom.client.ScrollEvent; | |||
import com.google.gwt.event.dom.client.ScrollHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ScrollPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -99,10 +98,12 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements | |||
if (useFakeFocusElement()) { | |||
if (focus) { | |||
FocusImpl.getFocusImplForPanel().focus( | |||
(Element) focusElement.cast()); | |||
(com.google.gwt.user.client.Element) focusElement | |||
.cast()); | |||
} else { | |||
FocusImpl.getFocusImplForPanel().blur( | |||
(Element) focusElement.cast()); | |||
(com.google.gwt.user.client.Element) focusElement | |||
.cast()); | |||
} | |||
} else { | |||
super.setFocus(focus); | |||
@@ -192,7 +193,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements | |||
}); | |||
} | |||
public Element getFocusElement() { | |||
public com.google.gwt.user.client.Element getFocusElement() { | |||
if (useFakeFocusElement()) { | |||
return focusElement.cast(); | |||
} else { |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.client.ui; | |||
import com.google.gwt.dom.client.NativeEvent; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.MouseEventDetailsBuilder; | |||
import com.vaadin.shared.EventId; | |||
@@ -34,10 +33,12 @@ public abstract class LayoutClickEventHandler extends AbstractClickEventHandler | |||
super(connector, clickEventIdentifier); | |||
} | |||
protected abstract ComponentConnector getChildComponent(Element element); | |||
protected abstract ComponentConnector getChildComponent( | |||
com.google.gwt.user.client.Element element); | |||
protected ComponentConnector getChildComponent(NativeEvent event) { | |||
return getChildComponent((Element) event.getEventTarget().cast()); | |||
return getChildComponent((com.google.gwt.user.client.Element) event | |||
.getEventTarget().cast()); | |||
} | |||
@Override |
@@ -22,7 +22,6 @@ import java.util.Iterator; | |||
import com.google.gwt.core.client.Scheduler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.KeyboardListener; | |||
@@ -142,7 +141,7 @@ public class ShortcutActionHandler { | |||
private void fireAction(final Event event, final ShortcutAction a, | |||
ComponentConnector target) { | |||
final Element et = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element et = DOM.eventGetTarget(event); | |||
if (target == null) { | |||
target = Util.findPaintable(client, et); | |||
} | |||
@@ -193,7 +192,7 @@ public class ShortcutActionHandler { | |||
* <p> | |||
* TODO separate opera impl with generator | |||
*/ | |||
private static void shakeTarget(final Element e) { | |||
private static void shakeTarget(final com.google.gwt.user.client.Element e) { | |||
blur(e); | |||
if (BrowserInfo.get().isOpera()) { | |||
// will mess up with focus and blur event if the focus is not | |||
@@ -210,14 +209,14 @@ public class ShortcutActionHandler { | |||
} | |||
} | |||
private static native void blur(Element e) | |||
private static native void blur(com.google.gwt.user.client.Element e) | |||
/*-{ | |||
if(e.blur) { | |||
e.blur(); | |||
} | |||
}-*/; | |||
private static native void focus(Element e) | |||
private static native void focus(com.google.gwt.user.client.Element e) | |||
/*-{ | |||
if(e.blur) { | |||
e.focus(); |
@@ -15,7 +15,6 @@ | |||
*/ | |||
package com.vaadin.client.ui; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.componentlocator.ComponentLocator; | |||
@@ -36,7 +35,7 @@ public interface SubPartAware { | |||
* @return The element identified by subPart or null if the element could | |||
* not be found. | |||
*/ | |||
Element getSubPartElement(String subPart); | |||
com.google.gwt.user.client.Element getSubPartElement(String subPart); | |||
/** | |||
* Provides an identifier that identifies the element within the component. | |||
@@ -57,6 +56,6 @@ public interface SubPartAware { | |||
* @return An identifier that uniquely identifies {@code subElement} or null | |||
* if no identifier could be provided. | |||
*/ | |||
String getSubPartName(Element subElement); | |||
String getSubPartName(com.google.gwt.user.client.Element subElement); | |||
} |
@@ -19,7 +19,6 @@ import com.google.gwt.dom.client.DivElement; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.dom.client.Style; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -36,7 +35,7 @@ public class VAbsoluteLayout extends ComplexPanel { | |||
private DivElement marginElement; | |||
protected final Element canvas = DOM.createDiv(); | |||
protected final com.google.gwt.user.client.Element canvas = DOM.createDiv(); | |||
/** | |||
* Default constructor |
@@ -32,7 +32,6 @@ import com.google.gwt.event.dom.client.TouchStartHandler; | |||
import com.google.gwt.event.shared.EventHandler; | |||
import com.google.gwt.event.shared.GwtEvent; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -62,14 +61,16 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
Widget secondChild; | |||
private final Element wrapper = DOM.createDiv(); | |||
private final com.google.gwt.user.client.Element wrapper = DOM.createDiv(); | |||
private final Element firstContainer = DOM.createDiv(); | |||
private final com.google.gwt.user.client.Element firstContainer = DOM | |||
.createDiv(); | |||
private final Element secondContainer = DOM.createDiv(); | |||
private final com.google.gwt.user.client.Element secondContainer = DOM | |||
.createDiv(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element splitter = DOM.createDiv(); | |||
public final com.google.gwt.user.client.Element splitter = DOM.createDiv(); | |||
private boolean resizing; | |||
@@ -90,7 +91,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public List<String> componentStyleNames = Collections.emptyList(); | |||
private Element draggingCurtain; | |||
private com.google.gwt.user.client.Element draggingCurtain; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public ApplicationConnection client; | |||
@@ -113,7 +114,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
private TouchScrollHandler touchScrollHandler; | |||
protected Element scrolledContainer; | |||
protected com.google.gwt.user.client.Element scrolledContainer; | |||
protected int origScrollTop; | |||
@@ -570,7 +571,8 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
if (locked || !isEnabled()) { | |||
return; | |||
} | |||
final Element trg = event.getEventTarget().cast(); | |||
final com.google.gwt.user.client.Element trg = event.getEventTarget() | |||
.cast(); | |||
if (trg == splitter || trg == DOM.getChild(splitter, 0)) { | |||
resizing = true; | |||
DOM.setCapture(getElement()); |
@@ -23,7 +23,6 @@ import java.util.Set; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -292,8 +291,9 @@ public class VAccordion extends VTabsheetBase { | |||
private VCaption caption; | |||
private boolean open = false; | |||
private Element content = DOM.createDiv(); | |||
private Element captionNode = DOM.createDiv(); | |||
private com.google.gwt.user.client.Element content = DOM.createDiv(); | |||
private com.google.gwt.user.client.Element captionNode = DOM | |||
.createDiv(); | |||
private String styleName; | |||
public StackItem(UIDL tabUidl) { | |||
@@ -328,7 +328,7 @@ public class VAccordion extends VTabsheetBase { | |||
onSelectTab(this); | |||
} | |||
public Element getContainerElement() { | |||
public com.google.gwt.user.client.Element getContainerElement() { | |||
return content; | |||
} | |||
@@ -25,7 +25,6 @@ import java.util.List; | |||
import com.google.gwt.event.dom.client.ContextMenuEvent; | |||
import com.google.gwt.event.dom.client.ContextMenuHandler; | |||
import com.google.gwt.i18n.client.DateTimeFormat; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Composite; | |||
import com.google.gwt.user.client.ui.DockPanel; | |||
import com.google.gwt.user.client.ui.ScrollPanel; | |||
@@ -257,7 +256,7 @@ public class VCalendar extends Composite implements VHasDropHandler { | |||
* @param e | |||
* The element to apply the hack on | |||
*/ | |||
private native void blockSelect(Element e) | |||
private native void blockSelect(com.google.gwt.user.client.Element e) | |||
/*-{ | |||
e.onselectstart = function() { | |||
return false; |
@@ -43,7 +43,6 @@ import com.google.gwt.event.dom.client.MouseOutHandler; | |||
import com.google.gwt.event.dom.client.MouseUpEvent; | |||
import com.google.gwt.event.dom.client.MouseUpHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.Button; | |||
import com.google.gwt.user.client.ui.FlexTable; | |||
@@ -2032,7 +2031,7 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
private Date rangeEnd; | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (contains(nextMonth, subElement)) { | |||
return SUBPART_NEXT_MONTH; | |||
} else if (contains(prevMonth, subElement)) { | |||
@@ -2082,7 +2081,8 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
* @param subElement | |||
* @return true if {@code w} is a parent of subElement, false otherwise. | |||
*/ | |||
private boolean contains(Widget w, Element subElement) { | |||
private boolean contains(Widget w, | |||
com.google.gwt.user.client.Element subElement) { | |||
if (w == null || w.getElement() == null) { | |||
return false; | |||
} | |||
@@ -2091,7 +2091,7 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
} | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (SUBPART_NEXT_MONTH.equals(subPart)) { | |||
return nextMonth.getElement(); | |||
} | |||
@@ -2136,7 +2136,8 @@ public class VCalendarPanel extends FocusableFlexTable implements | |||
} | |||
if (SUBPART_MONTH_YEAR_HEADER.equals(subPart)) { | |||
return (Element) getCellFormatter().getElement(0, 2).getChild(0); | |||
return (com.google.gwt.user.client.Element) getCellFormatter() | |||
.getElement(0, 2).getChild(0); | |||
} | |||
return null; | |||
} |
@@ -19,7 +19,6 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.BrowserInfo; | |||
@@ -44,7 +43,7 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements | |||
public ApplicationConnection client; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element errorIndicatorElement; | |||
public com.google.gwt.user.client.Element errorIndicatorElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Icon icon; | |||
@@ -52,7 +51,7 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements | |||
public VCheckBox() { | |||
setStyleName(CLASSNAME); | |||
Element el = DOM.getFirstChild(getElement()); | |||
com.google.gwt.user.client.Element el = DOM.getFirstChild(getElement()); | |||
while (el != null) { | |||
DOM.sinkEvents(el, | |||
(DOM.getEventsSunk(el) | VTooltip.TOOLTIP_EVENTS)); | |||
@@ -91,9 +90,10 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements | |||
* | |||
* @return Element of the CheckBox itself | |||
*/ | |||
private Element getCheckBoxElement() { | |||
private com.google.gwt.user.client.Element getCheckBoxElement() { | |||
// FIXME: Would love to use a better way to access the checkbox element | |||
return (Element) getElement().getFirstChildElement(); | |||
return (com.google.gwt.user.client.Element) getElement() | |||
.getFirstChildElement(); | |||
} | |||
@Override |
@@ -43,7 +43,6 @@ import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.MenuBar; | |||
import com.google.gwt.user.client.ui.MenuItem; | |||
@@ -63,7 +62,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
private int top; | |||
private Element focusedElement; | |||
private com.google.gwt.user.client.Element focusedElement; | |||
private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor(100, | |||
new ScheduledCommand() { | |||
@@ -89,7 +88,8 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
addCloseHandler(new CloseHandler<PopupPanel>() { | |||
@Override | |||
public void onClose(CloseEvent<PopupPanel> event) { | |||
Element currentFocus = Util.getFocusedElement(); | |||
com.google.gwt.user.client.Element currentFocus = Util | |||
.getFocusedElement(); | |||
if (focusedElement != null | |||
&& (currentFocus == null | |||
|| menu.getElement().isOrHasChild(currentFocus) || RootPanel | |||
@@ -279,7 +279,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
} | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
int index = Integer.parseInt(subPart.substring(6)); | |||
// ApplicationConnection.getConsole().log( | |||
// "Searching element for selection index " + index); | |||
@@ -290,7 +290,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (getElement().isOrHasChild(subElement)) { | |||
com.google.gwt.dom.client.Element e = subElement; | |||
{ |
@@ -26,7 +26,6 @@ import com.google.gwt.dom.client.Style.BorderStyle; | |||
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.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -49,7 +48,7 @@ public class VCustomLayout extends ComplexPanel { | |||
public static final String CLASSNAME = "v-customlayout"; | |||
/** Location-name to containing element in DOM map */ | |||
private final HashMap<String, Element> locationToElement = new HashMap<String, Element>(); | |||
private final HashMap<String, com.google.gwt.user.client.Element> locationToElement = new HashMap<String, com.google.gwt.user.client.Element>(); | |||
/** Location-name to contained widget map */ | |||
final HashMap<String, Widget> locationToWidget = new HashMap<String, Widget>(); | |||
@@ -76,7 +75,7 @@ public class VCustomLayout extends ComplexPanel { | |||
private boolean htmlInitialized = false; | |||
private Element elementWithNativeResizeFunction; | |||
private com.google.gwt.user.client.Element elementWithNativeResizeFunction; | |||
private String height = ""; | |||
@@ -123,7 +122,8 @@ public class VCustomLayout extends ComplexPanel { | |||
} | |||
// If no given location is found in the layout, and exception is throws | |||
Element elem = locationToElement.get(location); | |||
com.google.gwt.user.client.Element elem = locationToElement | |||
.get(location); | |||
if (elem == null && hasTemplate()) { | |||
throw new IllegalArgumentException("No location " + location | |||
+ " found"); | |||
@@ -207,7 +207,7 @@ public class VCustomLayout extends ComplexPanel { | |||
} | |||
/** Collect locations from template */ | |||
private void scanForLocations(Element elem) { | |||
private void scanForLocations(com.google.gwt.user.client.Element elem) { | |||
final String location = elem.getAttribute("location"); | |||
if (!"".equals(location)) { | |||
@@ -247,7 +247,8 @@ public class VCustomLayout extends ComplexPanel { | |||
for (int i = 0; i < nodeList.getLength(); i++) { | |||
com.google.gwt.dom.client.ImageElement img = (ImageElement) nodeList | |||
.getItem(i); | |||
DOM.sinkEvents((Element) img.cast(), Event.ONLOAD); | |||
DOM.sinkEvents((com.google.gwt.user.client.Element) img.cast(), | |||
Event.ONLOAD); | |||
} | |||
} | |||
@@ -389,12 +390,14 @@ public class VCustomLayout extends ComplexPanel { | |||
} | |||
} | |||
private native void detachResizedFunction(Element element) | |||
private native void detachResizedFunction( | |||
com.google.gwt.user.client.Element element) | |||
/*-{ | |||
element.notifyChildrenOfSizeChange = null; | |||
}-*/; | |||
private native void publishResizedFunction(Element element) | |||
private native void publishResizedFunction( | |||
com.google.gwt.user.client.Element element) | |||
/*-{ | |||
var self = this; | |||
element.notifyChildrenOfSizeChange = $entry(function() { | |||
@@ -419,7 +422,7 @@ public class VCustomLayout extends ComplexPanel { | |||
* @return true if layout function exists and was run successfully, else | |||
* false. | |||
*/ | |||
public native boolean iLayoutJS(Element el) | |||
public native boolean iLayoutJS(com.google.gwt.user.client.Element el) | |||
/*-{ | |||
if(el && el.iLayoutJS) { | |||
try { |
@@ -28,7 +28,6 @@ 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.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -117,7 +116,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
transferable.setDragSource(getConnector()); | |||
ComponentConnector paintable = Util.findPaintable(client, | |||
(Element) event.getEventTarget().cast()); | |||
(com.google.gwt.user.client.Element) event.getEventTarget() | |||
.cast()); | |||
Widget widget = paintable.getWidget(); | |||
transferable.setData("component", paintable); | |||
VDragEvent dragEvent = VDragAndDropManager.get().startDrag( | |||
@@ -160,11 +160,11 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public ValueMap html5DataFlavors; | |||
private Element dragStartElement; | |||
private com.google.gwt.user.client.Element dragStartElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public void initDragStartMode() { | |||
Element div = getElement(); | |||
com.google.gwt.user.client.Element div = getElement(); | |||
if (dragStartMode == HTML5) { | |||
if (dragStartElement == null) { | |||
dragStartElement = getDragStartElement(); | |||
@@ -182,7 +182,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
} | |||
} | |||
protected Element getDragStartElement() { | |||
protected com.google.gwt.user.client.Element getDragStartElement() { | |||
return getElement(); | |||
} | |||
@@ -548,7 +548,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
return ConnectorMap.get(client).getConnector(this); | |||
} | |||
protected native void hookHtml5DragStart(Element el) | |||
protected native void hookHtml5DragStart( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var me = this; | |||
el.addEventListener("dragstart", $entry(function(ev) { | |||
@@ -561,7 +562,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
* | |||
* @param el | |||
*/ | |||
protected native void hookHtml5Events(Element el) | |||
protected native void hookHtml5Events(com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var me = this; | |||
@@ -18,16 +18,15 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.dom.client.AnchorElement; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.VConsole; | |||
public class VDragAndDropWrapperIE extends VDragAndDropWrapper { | |||
private AnchorElement anchor = null; | |||
@Override | |||
protected Element getDragStartElement() { | |||
protected com.google.gwt.user.client.Element getDragStartElement() { | |||
VConsole.log("IE get drag start element..."); | |||
Element div = getElement(); | |||
com.google.gwt.user.client.Element div = getElement(); | |||
if (dragStartMode == HTML5) { | |||
if (anchor == null) { | |||
anchor = Document.get().createAnchorElement(); | |||
@@ -36,7 +35,7 @@ public class VDragAndDropWrapperIE extends VDragAndDropWrapper { | |||
div.appendChild(anchor); | |||
} | |||
VConsole.log("IE get drag start element..."); | |||
return (Element) anchor.cast(); | |||
return (com.google.gwt.user.client.Element) anchor.cast(); | |||
} else { | |||
if (anchor != null) { | |||
div.removeChild(anchor); | |||
@@ -47,7 +46,8 @@ public class VDragAndDropWrapperIE extends VDragAndDropWrapper { | |||
} | |||
@Override | |||
protected native void hookHtml5DragStart(Element el) | |||
protected native void hookHtml5DragStart( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var me = this; | |||
@@ -57,7 +57,7 @@ public class VDragAndDropWrapperIE extends VDragAndDropWrapper { | |||
}-*/; | |||
@Override | |||
protected native void hookHtml5Events(Element el) | |||
protected native void hookHtml5Events(com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var me = this; | |||
@@ -21,7 +21,6 @@ import java.util.Iterator; | |||
import java.util.Map; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -37,7 +36,7 @@ public class VEmbedded extends HTML { | |||
public static String CLASSNAME = "v-embedded"; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element browserElement; | |||
public com.google.gwt.user.client.Element browserElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public String type; |
@@ -47,7 +47,6 @@ import com.google.gwt.event.logical.shared.CloseEvent; | |||
import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
@@ -209,9 +208,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final SuggestionMenu menu; | |||
private final Element up = DOM.createDiv(); | |||
private final Element down = DOM.createDiv(); | |||
private final Element status = DOM.createDiv(); | |||
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 boolean isPagingEnabled = true; | |||
@@ -233,7 +233,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
getElement().getStyle().setZIndex(Z_INDEX); | |||
final Element root = getContainerElement(); | |||
final com.google.gwt.user.client.Element root = getContainerElement(); | |||
up.setInnerHTML("<span>Prev</span>"); | |||
DOM.sinkEvents(up, Event.ONCLICK); | |||
@@ -484,7 +484,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
public void onBrowserEvent(Event event) { | |||
debug("VFS.SP: onBrowserEvent()"); | |||
if (event.getTypeInt() == Event.ONCLICK) { | |||
final Element target = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
if (target == up || target == DOM.getChild(up, 0)) { | |||
lazyPageScroller.scrollUp(); | |||
} else if (target == down || target == DOM.getChild(down, 0)) { | |||
@@ -556,8 +557,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
offsetHeight = getOffsetHeight(); | |||
final int desiredWidth = getMainWidth(); | |||
Element menuFirstChild = menu.getElement().getFirstChildElement() | |||
.cast(); | |||
com.google.gwt.user.client.Element menuFirstChild = menu | |||
.getElement().getFirstChildElement().cast(); | |||
int naturalMenuWidth = menuFirstChild.getOffsetWidth(); | |||
if (popupOuterPadding == -1) { | |||
@@ -853,7 +854,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
private static final String SUBPART_PREFIX = "item"; | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement( | |||
String subPart) { | |||
int index = Integer.parseInt(subPart.substring(SUBPART_PREFIX | |||
.length())); | |||
@@ -863,12 +865,13 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName( | |||
com.google.gwt.user.client.Element subElement) { | |||
if (!getElement().isOrHasChild(subElement)) { | |||
return null; | |||
} | |||
Element menuItemRoot = subElement; | |||
com.google.gwt.user.client.Element menuItemRoot = subElement; | |||
while (menuItemRoot != null | |||
&& !menuItemRoot.getTagName().equalsIgnoreCase("td")) { | |||
menuItemRoot = menuItemRoot.getParentElement().cast(); | |||
@@ -1822,7 +1825,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
*/ | |||
preventNextBlurEventInIE = false; | |||
Element focusedElement = Util.getIEFocusedElement(); | |||
com.google.gwt.user.client.Element focusedElement = Util | |||
.getIEFocusedElement(); | |||
if (getElement().isOrHasChild(focusedElement) | |||
|| suggestionPopup.getElement() | |||
.isOrHasChild(focusedElement)) { | |||
@@ -1983,7 +1987,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
} | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if ("textbox".equals(subPart)) { | |||
return tb.getElement(); | |||
} else if ("button".equals(subPart)) { | |||
@@ -1995,7 +1999,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (tb.getElement().isOrHasChild(subElement)) { | |||
return "textbox"; | |||
} else if (popupOpener.getElement().isOrHasChild(subElement)) { | |||
@@ -2017,7 +2021,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
} | |||
@Override | |||
public void bindAriaCaption(Element captionElement) { | |||
public void bindAriaCaption( | |||
com.google.gwt.user.client.Element captionElement) { | |||
AriaHelper.bindCaption(tb, captionElement); | |||
} | |||
} |
@@ -20,7 +20,6 @@ import com.google.gwt.event.dom.client.KeyDownEvent; | |||
import com.google.gwt.event.dom.client.KeyDownHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -38,13 +37,13 @@ public class VForm extends ComplexPanel implements KeyDownHandler { | |||
public Widget lo; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element legend = DOM.createLegend(); | |||
public com.google.gwt.user.client.Element legend = DOM.createLegend(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element caption = DOM.createSpan(); | |||
public com.google.gwt.user.client.Element caption = DOM.createSpan(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element desc = DOM.createDiv(); | |||
public com.google.gwt.user.client.Element desc = DOM.createDiv(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Icon icon; | |||
@@ -53,13 +52,13 @@ public class VForm extends ComplexPanel implements KeyDownHandler { | |||
public VErrorMessage errorMessage = new VErrorMessage(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element fieldContainer = DOM.createDiv(); | |||
public com.google.gwt.user.client.Element fieldContainer = DOM.createDiv(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element footerContainer = DOM.createDiv(); | |||
public com.google.gwt.user.client.Element footerContainer = DOM.createDiv(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element fieldSet = DOM.createFieldSet(); | |||
public com.google.gwt.user.client.Element fieldSet = DOM.createFieldSet(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Widget footer; | |||
@@ -139,7 +138,7 @@ public class VForm extends ComplexPanel implements KeyDownHandler { | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
@Override | |||
public void add(Widget child, Element container) { | |||
public void add(Widget child, com.google.gwt.user.client.Element container) { | |||
super.add(child, container); | |||
} | |||
} |
@@ -24,7 +24,6 @@ import com.google.gwt.aria.client.Roles; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.FlexTable; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
@@ -120,7 +119,7 @@ public class VFormLayout extends SimplePanel { | |||
} | |||
public void setMargins(MarginInfo margins) { | |||
Element margin = getElement(); | |||
com.google.gwt.user.client.Element margin = getElement(); | |||
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP, | |||
margins.hasTop()); | |||
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT, | |||
@@ -219,11 +218,11 @@ public class VFormLayout extends SimplePanel { | |||
private final ComponentConnector owner; | |||
private Element requiredFieldIndicator; | |||
private com.google.gwt.user.client.Element requiredFieldIndicator; | |||
private Icon icon; | |||
private Element captionText; | |||
private com.google.gwt.user.client.Element captionText; | |||
/** | |||
* | |||
@@ -355,7 +354,7 @@ public class VFormLayout extends SimplePanel { | |||
public class ErrorFlag extends HTML { | |||
private static final String CLASSNAME = VFormLayout.CLASSNAME | |||
+ "-error-indicator"; | |||
Element errorIndicatorElement; | |||
com.google.gwt.user.client.Element errorIndicatorElement; | |||
private ComponentConnector owner; | |||
@@ -25,7 +25,6 @@ import com.google.gwt.dom.client.Document; | |||
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.Element; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -216,7 +215,7 @@ public class VGridLayout extends ComplexPanel { | |||
void layoutCellsVertically() { | |||
int verticalSpacing = getVerticalSpacing(); | |||
LayoutManager layoutManager = LayoutManager.get(client); | |||
Element element = getElement(); | |||
com.google.gwt.user.client.Element element = getElement(); | |||
int paddingTop = layoutManager.getPaddingTop(element); | |||
int paddingBottom = layoutManager.getPaddingBottom(element); | |||
@@ -257,7 +256,7 @@ public class VGridLayout extends ComplexPanel { | |||
void layoutCellsHorizontally() { | |||
LayoutManager layoutManager = LayoutManager.get(client); | |||
Element element = getElement(); | |||
com.google.gwt.user.client.Element element = getElement(); | |||
int x = layoutManager.getPaddingLeft(element); | |||
int paddingRight = layoutManager.getPaddingRight(element); | |||
int horizontalSpacing = getHorizontalSpacing(); | |||
@@ -613,7 +612,8 @@ public class VGridLayout extends ComplexPanel { | |||
if (component.isRelativeWidth()) { | |||
slot.getWrapperElement().getStyle().setWidth(100, Unit.PCT); | |||
} | |||
Element slotWrapper = slot.getWrapperElement(); | |||
com.google.gwt.user.client.Element slotWrapper = slot | |||
.getWrapperElement(); | |||
getElement().appendChild(slotWrapper); | |||
Widget widget = component.getWidget(); | |||
@@ -666,7 +666,8 @@ public class VGridLayout extends ComplexPanel { | |||
* @return The Paintable which the element is a part of. Null if the element | |||
* belongs to the layout and not to a child. | |||
*/ | |||
public ComponentConnector getComponent(Element element) { | |||
public ComponentConnector getComponent( | |||
com.google.gwt.user.client.Element element) { | |||
return Util.getConnectorForElement(client, this, element); | |||
} | |||
@@ -19,7 +19,6 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.HTML; | |||
@@ -58,13 +57,14 @@ public class VLink extends HTML implements ClickHandler { | |||
public int targetHeight; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element errorIndicatorElement; | |||
public com.google.gwt.user.client.Element errorIndicatorElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element anchor = DOM.createAnchor(); | |||
public final com.google.gwt.user.client.Element anchor = DOM.createAnchor(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element captionElement = DOM.createSpan(); | |||
public final com.google.gwt.user.client.Element captionElement = DOM | |||
.createSpan(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Icon icon; | |||
@@ -120,7 +120,8 @@ public class VLink extends HTML implements ClickHandler { | |||
@Override | |||
public void onBrowserEvent(Event event) { | |||
final Element target = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
if (event.getTypeInt() == Event.ONLOAD) { | |||
Util.notifyParentOfSizeChange(this, true); | |||
} |
@@ -21,7 +21,6 @@ import com.google.gwt.dom.client.MediaElement; | |||
import com.google.gwt.dom.client.NodeList; | |||
import com.google.gwt.dom.client.SourceElement; | |||
import com.google.gwt.dom.client.Text; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
public abstract class VMediaBase extends Widget { | |||
@@ -82,7 +81,8 @@ public abstract class VMediaBase extends Widget { | |||
} | |||
public void addSource(String sourceUrl, String sourceType) { | |||
Element src = Document.get().createElement(SourceElement.TAG).cast(); | |||
com.google.gwt.user.client.Element src = Document.get() | |||
.createElement(SourceElement.TAG).cast(); | |||
src.setAttribute("src", sourceUrl); | |||
src.setAttribute("type", sourceType); | |||
media.appendChild(src); |
@@ -35,7 +35,6 @@ import com.google.gwt.event.logical.shared.CloseEvent; | |||
import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.HasHTML; | |||
@@ -90,7 +89,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
/** Widget fields **/ | |||
protected boolean subMenu; | |||
protected ArrayList<CustomMenuItem> items; | |||
protected Element containerElement; | |||
protected com.google.gwt.user.client.Element containerElement; | |||
protected VOverlay popup; | |||
protected VMenuBar visibleChildMenu; | |||
protected boolean menuVisible = false; | |||
@@ -271,7 +270,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
* Remove all the items in this menu | |||
*/ | |||
public void clearItems() { | |||
Element e = getContainerElement(); | |||
com.google.gwt.user.client.Element e = getContainerElement(); | |||
while (DOM.getChildCount(e) > 0) { | |||
DOM.removeChild(e, DOM.getChild(e, 0)); | |||
} | |||
@@ -284,7 +283,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
* @return | |||
*/ | |||
@Override | |||
public Element getContainerElement() { | |||
public com.google.gwt.user.client.Element getContainerElement() { | |||
return containerElement; | |||
} | |||
@@ -369,7 +368,8 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
return; | |||
} | |||
Element targetElement = DOM.eventGetTarget(e); | |||
com.google.gwt.user.client.Element targetElement = DOM | |||
.eventGetTarget(e); | |||
CustomMenuItem targetItem = null; | |||
for (int i = 0; i < items.size(); i++) { | |||
CustomMenuItem item = items.get(i); | |||
@@ -1500,7 +1500,7 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
private final String SUBPART_PREFIX = "item"; | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
int index = Integer | |||
.parseInt(subPart.substring(SUBPART_PREFIX.length())); | |||
CustomMenuItem item = getItems().get(index); | |||
@@ -1509,12 +1509,12 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (!getElement().isOrHasChild(subElement)) { | |||
return null; | |||
} | |||
Element menuItemRoot = subElement; | |||
com.google.gwt.user.client.Element menuItemRoot = subElement; | |||
while (menuItemRoot != null && menuItemRoot.getParentElement() != null | |||
&& menuItemRoot.getParentElement() != getElement()) { | |||
menuItemRoot = menuItemRoot.getParentElement().cast(); | |||
@@ -1538,7 +1538,8 @@ public class VMenuBar extends SimpleFocusablePanel implements | |||
* Element used in search | |||
* @return Menu item or null if not found | |||
*/ | |||
public CustomMenuItem getMenuItemWithElement(Element element) { | |||
public CustomMenuItem getMenuItemWithElement( | |||
com.google.gwt.user.client.Element element) { | |||
for (int i = 0; i < items.size(); i++) { | |||
CustomMenuItem item = items.get(i); | |||
if (DOM.isOrHasChild(item.getElement(), element)) { |
@@ -25,7 +25,6 @@ import com.google.gwt.aria.client.Roles; | |||
import com.google.gwt.core.client.GWT; | |||
import com.google.gwt.event.dom.client.KeyCodes; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
@@ -289,7 +288,7 @@ public class VNotification extends VOverlay { | |||
} | |||
public void setPosition(com.vaadin.shared.Position position) { | |||
final Element el = getElement(); | |||
final com.google.gwt.user.client.Element el = getElement(); | |||
DOM.setStyleAttribute(el, "top", ""); | |||
DOM.setStyleAttribute(el, "left", ""); | |||
DOM.setStyleAttribute(el, "bottom", ""); | |||
@@ -346,7 +345,7 @@ public class VNotification extends VOverlay { | |||
} | |||
} | |||
private void setOpacity(Element el, int opacity) { | |||
private void setOpacity(com.google.gwt.user.client.Element el, int opacity) { | |||
DOM.setStyleAttribute(el, "opacity", "" + (opacity / 100.0)); | |||
if (BrowserInfo.get().isIE()) { | |||
DOM.setStyleAttribute(el, "filter", "Alpha(opacity=" + opacity |
@@ -27,7 +27,6 @@ import com.google.gwt.dom.client.Style.Unit; | |||
import com.google.gwt.event.logical.shared.CloseEvent; | |||
import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
@@ -130,7 +129,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
/* | |||
* The shadow element for this overlay. | |||
*/ | |||
private Element shadow; | |||
private com.google.gwt.user.client.Element shadow; | |||
/* | |||
* The creator of this VOverlay (the widget that made the instance, not the | |||
@@ -482,7 +481,8 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
// Animate the size | |||
positionAndSize.setAnimationFromCenterProgress(progress); | |||
Element container = getElement().getParentElement().cast(); | |||
com.google.gwt.user.client.Element container = getElement() | |||
.getParentElement().cast(); | |||
if (isShadowEnabled()) { | |||
updateShadowPosition(progress, zIndex, positionAndSize); | |||
@@ -535,8 +535,9 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
} | |||
private void updateShimPosition(PositionAndSize positionAndSize) { | |||
updatePositionAndSize((Element) Element.as(getShimElement()), | |||
positionAndSize); | |||
updatePositionAndSize( | |||
(com.google.gwt.user.client.Element) com.google.gwt.user.client.Element | |||
.as(getShimElement()), positionAndSize); | |||
} | |||
/** | |||
@@ -551,7 +552,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
return info.isIE() && info.isBrowserVersionNewerOrEqual(8, 0); | |||
} | |||
private void updatePositionAndSize(Element e, | |||
private void updatePositionAndSize(com.google.gwt.user.client.Element e, | |||
PositionAndSize positionAndSize) { | |||
e.getStyle().setLeft(positionAndSize.getLeft(), Unit.PX); | |||
e.getStyle().setTop(positionAndSize.getTop(), Unit.PX); | |||
@@ -666,7 +667,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
* {@link ApplicationConnection} or another element if the current | |||
* {@link ApplicationConnection} cannot be determined. | |||
*/ | |||
public Element getOverlayContainer() { | |||
public com.google.gwt.user.client.Element getOverlayContainer() { | |||
ApplicationConnection ac = getApplicationConnection(); | |||
if (ac == null) { | |||
// could not figure out which one we belong to, styling will | |||
@@ -688,10 +689,11 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { | |||
* A reference to {@link ApplicationConnection} | |||
* @return The overlay container | |||
*/ | |||
public static Element getOverlayContainer(ApplicationConnection ac) { | |||
public static com.google.gwt.user.client.Element getOverlayContainer( | |||
ApplicationConnection ac) { | |||
String id = ac.getConfiguration().getRootPanelId(); | |||
id = id += "-overlays"; | |||
Element container = DOM.getElementById(id); | |||
com.google.gwt.user.client.Element container = DOM.getElementById(id); | |||
if (container == null) { | |||
container = DOM.createDiv(); | |||
container.setId(id); |
@@ -19,7 +19,6 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.dom.client.DivElement; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -39,19 +38,23 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, | |||
public String id; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element captionNode = DOM.createDiv(); | |||
public final com.google.gwt.user.client.Element captionNode = DOM | |||
.createDiv(); | |||
private final Element captionText = DOM.createSpan(); | |||
private final com.google.gwt.user.client.Element captionText = DOM | |||
.createSpan(); | |||
private Icon icon; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element bottomDecoration = DOM.createDiv(); | |||
public final com.google.gwt.user.client.Element bottomDecoration = DOM | |||
.createDiv(); | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element contentNode = DOM.createDiv(); | |||
public final com.google.gwt.user.client.Element contentNode = DOM | |||
.createDiv(); | |||
private Element errorIndicatorElement; | |||
private com.google.gwt.user.client.Element errorIndicatorElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public ShortcutActionHandler shortcutHandler; | |||
@@ -124,7 +127,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, | |||
} | |||
@Override | |||
protected Element getContainerElement() { | |||
protected com.google.gwt.user.client.Element getContainerElement() { | |||
return contentNode; | |||
} | |||
@@ -30,7 +30,6 @@ import com.google.gwt.event.logical.shared.CloseEvent; | |||
import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.i18n.client.DateTimeFormat; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
@@ -82,7 +81,7 @@ public class VPopupCalendar extends VTextualDate implements Field, | |||
private Label selectedDate; | |||
private Element descriptionForAssisitveDevicesElement; | |||
private com.google.gwt.user.client.Element descriptionForAssisitveDevicesElement; | |||
public VPopupCalendar() { | |||
super(); | |||
@@ -255,7 +254,8 @@ public class VPopupCalendar extends VTextualDate implements Field, | |||
} | |||
@Override | |||
public void bindAriaCaption(Element captionElement) { | |||
public void bindAriaCaption( | |||
com.google.gwt.user.client.Element captionElement) { | |||
if (captionElement == null) { | |||
captionId = null; | |||
} else { | |||
@@ -552,7 +552,7 @@ public class VPopupCalendar extends VTextualDate implements Field, | |||
private final String CALENDAR_TOGGLE_ID = "popupButton"; | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (subPart.equals(CALENDAR_TOGGLE_ID)) { | |||
return calendarToggle.getElement(); | |||
} | |||
@@ -561,7 +561,7 @@ public class VPopupCalendar extends VTextualDate implements Field, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (calendarToggle.getElement().isOrHasChild(subElement)) { | |||
return CALENDAR_TOGGLE_ID; | |||
} |
@@ -29,7 +29,6 @@ import com.google.gwt.event.logical.shared.CloseEvent; | |||
import com.google.gwt.event.logical.shared.CloseHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Focusable; | |||
import com.google.gwt.user.client.ui.HTML; | |||
@@ -179,7 +178,7 @@ public class VPopupView extends HTML implements Iterable<Widget> { | |||
super.onDetach(); | |||
} | |||
private static native void nativeBlur(Element e) | |||
private static native void nativeBlur(com.google.gwt.user.client.Element e) | |||
/*-{ | |||
if(e && e.blur) { | |||
e.blur(); | |||
@@ -204,7 +203,7 @@ public class VPopupView extends HTML implements Iterable<Widget> { | |||
private boolean hasHadMouseOver = false; | |||
private boolean hideOnMouseOut = true; | |||
private final Set<Element> activeChildren = new HashSet<Element>(); | |||
private final Set<com.google.gwt.user.client.Element> activeChildren = new HashSet<com.google.gwt.user.client.Element>(); | |||
private ShortcutActionHandler shortcutActionHandler; | |||
@@ -229,7 +228,8 @@ public class VPopupView extends HTML implements Iterable<Widget> { | |||
// to use ONMOUSEMOVE that doesn't target the popup | |||
@Override | |||
public boolean onEventPreview(Event event) { | |||
Element target = DOM.eventGetTarget(event); | |||
com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
boolean eventTargetsPopup = DOM.isOrHasChild(getElement(), target); | |||
int type = DOM.eventGetType(event); | |||
@@ -305,7 +305,7 @@ public class VPopupView extends HTML implements Iterable<Widget> { | |||
} | |||
// Notify children that have used the keyboard | |||
for (Element e : activeChildren) { | |||
for (com.google.gwt.user.client.Element e : activeChildren) { | |||
try { | |||
nativeBlur(e); | |||
} catch (Exception ignored) { | |||
@@ -356,7 +356,7 @@ public class VPopupView extends HTML implements Iterable<Widget> { | |||
} | |||
@Override | |||
public Element getContainerElement() { | |||
public com.google.gwt.user.client.Element getContainerElement() { | |||
return super.getContainerElement(); | |||
} | |||
@@ -18,7 +18,6 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.dom.client.Style.Unit; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.HasEnabled; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -37,8 +36,8 @@ import com.vaadin.shared.ui.progressindicator.ProgressBarState; | |||
*/ | |||
public class VProgressBar extends Widget implements HasEnabled { | |||
Element wrapper = DOM.createDiv(); | |||
Element indicator = DOM.createDiv(); | |||
com.google.gwt.user.client.Element wrapper = DOM.createDiv(); | |||
com.google.gwt.user.client.Element indicator = DOM.createDiv(); | |||
private boolean indeterminate = false; | |||
private float state = 0.0f; |
@@ -29,7 +29,6 @@ import com.google.gwt.event.dom.client.KeyPressHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.Composite; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
@@ -214,7 +213,8 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, | |||
* Detects space used by components paddings and borders. | |||
*/ | |||
private void detectExtraSizes() { | |||
Element clone = Util.cloneNode(getElement(), false); | |||
com.google.gwt.user.client.Element clone = Util.cloneNode(getElement(), | |||
false); | |||
DOM.setElementAttribute(clone, "id", ""); | |||
DOM.setStyleAttribute(clone, "visibility", "hidden"); | |||
DOM.setStyleAttribute(clone, "position", "absolute"); |
@@ -65,7 +65,6 @@ import com.google.gwt.regexp.shared.MatchResult; | |||
import com.google.gwt.regexp.shared.RegExp; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
@@ -488,7 +487,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
private final HashMap<Object, String> actionMap = new HashMap<Object, String>(); | |||
private String[] visibleColOrder; | |||
private boolean initialContentReceived = false; | |||
private Element scrollPositionElement; | |||
private com.google.gwt.user.client.Element scrollPositionElement; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean enabled; | |||
@@ -1914,7 +1913,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
super.onDetach(); | |||
// ensure that scrollPosElement will be detached | |||
if (scrollPositionElement != null) { | |||
final Element parent = DOM.getParent(scrollPositionElement); | |||
final com.google.gwt.user.client.Element parent = DOM | |||
.getParent(scrollPositionElement); | |||
if (parent != null) { | |||
DOM.removeChild(parent, scrollPositionElement); | |||
} | |||
@@ -2504,15 +2504,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
public class HeaderCell extends Widget { | |||
Element td = DOM.createTD(); | |||
com.google.gwt.user.client.Element td = DOM.createTD(); | |||
Element captionContainer = DOM.createDiv(); | |||
com.google.gwt.user.client.Element captionContainer = DOM.createDiv(); | |||
Element sortIndicator = DOM.createDiv(); | |||
com.google.gwt.user.client.Element sortIndicator = DOM.createDiv(); | |||
Element colResizeWidget = DOM.createDiv(); | |||
com.google.gwt.user.client.Element colResizeWidget = DOM.createDiv(); | |||
Element floatingCopyOfHeaderCell; | |||
com.google.gwt.user.client.Element floatingCopyOfHeaderCell; | |||
private boolean sortable = false; | |||
private final String cid; | |||
@@ -3214,14 +3214,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
HashMap<String, HeaderCell> availableCells = new HashMap<String, HeaderCell>(); | |||
Element div = DOM.createDiv(); | |||
Element hTableWrapper = DOM.createDiv(); | |||
Element hTableContainer = DOM.createDiv(); | |||
Element table = DOM.createTable(); | |||
Element headerTableBody = DOM.createTBody(); | |||
Element tr = DOM.createTR(); | |||
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(); | |||
private final Element columnSelector = DOM.createDiv(); | |||
private final com.google.gwt.user.client.Element columnSelector = DOM | |||
.createDiv(); | |||
private int focusedSlot = -1; | |||
@@ -3529,7 +3530,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
public void moveCell(int oldIndex, int newIndex) { | |||
final HeaderCell hCell = getHeaderCell(oldIndex); | |||
final Element cell = hCell.getElement(); | |||
final com.google.gwt.user.client.Element cell = hCell.getElement(); | |||
visibleCells.remove(oldIndex); | |||
DOM.removeChild(tr, cell); | |||
@@ -3562,13 +3563,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
private void focusSlot(int index) { | |||
removeSlotFocus(); | |||
if (index > 0) { | |||
Element child = tr.getChild(index - 1).getFirstChild().cast(); | |||
com.google.gwt.user.client.Element child = tr | |||
.getChild(index - 1).getFirstChild().cast(); | |||
child.setClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-resizer"); | |||
child.addClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-focus-slot-right"); | |||
} else { | |||
Element child = tr.getChild(index).getFirstChild().cast(); | |||
com.google.gwt.user.client.Element child = tr.getChild(index) | |||
.getFirstChild().cast(); | |||
child.setClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-resizer"); | |||
child.addClassName(VScrollTable.this.getStylePrimaryName() | |||
@@ -3582,12 +3585,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
return; | |||
} | |||
if (focusedSlot == 0) { | |||
Element child = tr.getChild(focusedSlot).getFirstChild().cast(); | |||
com.google.gwt.user.client.Element child = tr | |||
.getChild(focusedSlot).getFirstChild().cast(); | |||
child.setClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-resizer"); | |||
} else if (focusedSlot > 0) { | |||
Element child = tr.getChild(focusedSlot - 1).getFirstChild() | |||
.cast(); | |||
com.google.gwt.user.client.Element child = tr | |||
.getChild(focusedSlot - 1).getFirstChild().cast(); | |||
child.setClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-resizer"); | |||
} | |||
@@ -3775,8 +3779,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* A cell in the footer | |||
*/ | |||
public class FooterCell extends Widget { | |||
private final Element td = DOM.createTD(); | |||
private final Element captionContainer = DOM.createDiv(); | |||
private final com.google.gwt.user.client.Element td = DOM.createTD(); | |||
private final com.google.gwt.user.client.Element captionContainer = DOM | |||
.createDiv(); | |||
private char align = ALIGN_LEFT; | |||
private int width = -1; | |||
private float expandRatio = 0; | |||
@@ -4079,8 +4084,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
// value (greater of header and data | |||
// cols) | |||
final int hw = ((Element) getElement().getLastChild()) | |||
.getOffsetWidth() + getHeaderPadding(); | |||
final int hw = ((com.google.gwt.user.client.Element) getElement() | |||
.getLastChild()).getOffsetWidth() | |||
+ getHeaderPadding(); | |||
if (columnIndex < 0) { | |||
columnIndex = 0; | |||
for (Iterator<Widget> it = tHead.iterator(); it | |||
@@ -4134,12 +4140,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
ArrayList<Widget> visibleCells = new ArrayList<Widget>(); | |||
HashMap<String, FooterCell> availableCells = new HashMap<String, FooterCell>(); | |||
Element div = DOM.createDiv(); | |||
Element hTableWrapper = DOM.createDiv(); | |||
Element hTableContainer = DOM.createDiv(); | |||
Element table = DOM.createTable(); | |||
Element headerTableBody = DOM.createTBody(); | |||
Element tr = DOM.createTR(); | |||
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(); | |||
public TableFooter() { | |||
@@ -4400,7 +4406,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
*/ | |||
public void moveCell(int oldIndex, int newIndex) { | |||
final FooterCell hCell = getFooterCell(oldIndex); | |||
final Element cell = hCell.getElement(); | |||
final com.google.gwt.user.client.Element cell = hCell.getElement(); | |||
visibleCells.remove(oldIndex); | |||
DOM.removeChild(tr, cell); | |||
@@ -4431,13 +4437,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
*/ | |||
private boolean tBodyMeasurementsDone = false; | |||
Element preSpacer = DOM.createDiv(); | |||
Element postSpacer = DOM.createDiv(); | |||
com.google.gwt.user.client.Element preSpacer = DOM.createDiv(); | |||
com.google.gwt.user.client.Element postSpacer = DOM.createDiv(); | |||
Element container = DOM.createDiv(); | |||
com.google.gwt.user.client.Element container = DOM.createDiv(); | |||
TableSectionElement tBodyElement = Document.get().createTBodyElement(); | |||
Element table = DOM.createTable(); | |||
com.google.gwt.user.client.Element table = DOM.createTable(); | |||
private int firstRendered; | |||
private int lastRendered; | |||
@@ -4496,7 +4502,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
if (BrowserInfo.get().requiresTouchScrollDelegate()) { | |||
NodeList<Node> childNodes = container.getChildNodes(); | |||
for (int i = 0; i < childNodes.getLength(); i++) { | |||
Element item = (Element) childNodes.getItem(i); | |||
com.google.gwt.user.client.Element item = (com.google.gwt.user.client.Element) childNodes | |||
.getItem(i); | |||
item.getStyle().setProperty("webkitTransform", | |||
"translate3d(0,0,0)"); | |||
} | |||
@@ -4973,7 +4980,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
for (Widget row : renderedRows) { | |||
if (!(row instanceof VScrollTableGeneratedRow)) { | |||
TableRowElement tr = row.getElement().cast(); | |||
Element wrapperdiv = tr.getCells().getItem(columnIndex) | |||
com.google.gwt.user.client.Element wrapperdiv = tr | |||
.getCells().getItem(columnIndex) | |||
.getFirstChildElement().cast(); | |||
return wrapperdiv.getOffsetWidth(); | |||
} | |||
@@ -5078,7 +5086,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
while (rows.hasNext()) { | |||
final VScrollTableRow row = (VScrollTableRow) rows.next(); | |||
final Element td = DOM.getChild(row.getElement(), oldIndex); | |||
final com.google.gwt.user.client.Element td = DOM.getChild( | |||
row.getElement(), oldIndex); | |||
if (td != null) { | |||
DOM.removeChild(row.getElement(), td); | |||
@@ -5229,7 +5238,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
} | |||
protected void setCellWidth(int cellIx, int width) { | |||
final Element cell = DOM.getChild(getElement(), cellIx); | |||
final com.google.gwt.user.client.Element cell = DOM.getChild( | |||
getElement(), cellIx); | |||
Style wrapperStyle = cell.getFirstChildElement().getStyle(); | |||
int wrapperWidth = width; | |||
if (BrowserInfo.get().isWebkit() | |||
@@ -5384,7 +5394,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
protected void initCellWithText(String text, char align, | |||
String style, boolean textIsHTML, boolean sorted, | |||
String description, final TableCellElement td) { | |||
final Element container = DOM.createDiv(); | |||
final com.google.gwt.user.client.Element container = DOM | |||
.createDiv(); | |||
container.setClassName(VScrollTable.this.getStylePrimaryName() | |||
+ "-cell-wrapper"); | |||
@@ -5425,7 +5436,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
protected void updateCellStyleNames(TableCellElement td, | |||
String primaryStyleName) { | |||
Element container = td.getFirstChild().cast(); | |||
com.google.gwt.user.client.Element container = td | |||
.getFirstChild().cast(); | |||
container.setClassName(primaryStyleName + "-cell-wrapper"); | |||
/* | |||
@@ -5456,7 +5468,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
protected void initCellWithWidget(Widget w, char align, | |||
String style, boolean sorted, final TableCellElement td) { | |||
final Element container = DOM.createDiv(); | |||
final com.google.gwt.user.client.Element container = DOM | |||
.createDiv(); | |||
String className = VScrollTable.this.getStylePrimaryName() | |||
+ "-cell-content"; | |||
if (style != null && !style.equals("")) { | |||
@@ -5523,7 +5536,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* Whether the event is sent immediately | |||
* @return Whether a click event was sent | |||
*/ | |||
private boolean handleClickEvent(Event event, Element targetTdOrTr, | |||
private boolean handleClickEvent(Event event, | |||
com.google.gwt.user.client.Element targetTdOrTr, | |||
boolean immediate) { | |||
if (!client.hasEventListeners(VScrollTable.this, | |||
TableConstants.ITEM_CLICK_EVENT_ID)) { | |||
@@ -5558,7 +5572,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
com.google.gwt.dom.client.Element target) { | |||
TooltipInfo info = null; | |||
final Element targetTdOrTr = getTdOrTr((Element) target.cast()); | |||
final com.google.gwt.user.client.Element targetTdOrTr = getTdOrTr((com.google.gwt.user.client.Element) target | |||
.cast()); | |||
if (targetTdOrTr != null | |||
&& "td".equals(targetTdOrTr.getTagName().toLowerCase())) { | |||
TableCellElement td = (TableCellElement) targetTdOrTr | |||
@@ -5573,15 +5588,16 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
return info; | |||
} | |||
private Element getTdOrTr(Element target) { | |||
Element thisTrElement = getElement(); | |||
private com.google.gwt.user.client.Element getTdOrTr( | |||
com.google.gwt.user.client.Element target) { | |||
com.google.gwt.user.client.Element thisTrElement = getElement(); | |||
if (target == thisTrElement) { | |||
// This was a on the TR element | |||
return target; | |||
} | |||
// Iterate upwards until we find the TR element | |||
Element element = target; | |||
com.google.gwt.user.client.Element element = target; | |||
while (element != null | |||
&& element.getParentElement().cast() != thisTrElement) { | |||
element = element.getParentElement().cast(); | |||
@@ -5599,7 +5615,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
boolean touchEventHandled = false; | |||
if (enabled && hasNativeTouchScrolling) { | |||
final Element targetTdOrTr = getEventTargetTdOrTr(event); | |||
final com.google.gwt.user.client.Element targetTdOrTr = getEventTargetTdOrTr(event); | |||
final int type = event.getTypeInt(); | |||
switch (type) { | |||
@@ -5712,7 +5728,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
if (enabled && !touchEventHandled) { | |||
final int type = event.getTypeInt(); | |||
final Element targetTdOrTr = getEventTargetTdOrTr(event); | |||
final com.google.gwt.user.client.Element targetTdOrTr = getEventTargetTdOrTr(event); | |||
if (type == Event.ONCONTEXTMENU) { | |||
showContextMenu(event); | |||
if (enabled | |||
@@ -5832,7 +5848,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
// Remove IE text selection hack | |||
if (BrowserInfo.get().isIE()) { | |||
((Element) event.getEventTarget().cast()) | |||
((com.google.gwt.user.client.Element) event | |||
.getEventTarget().cast()) | |||
.setPropertyJSO("onselectstart", | |||
null); | |||
} | |||
@@ -5974,7 +5991,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
// Prevent default text selection in IE | |||
if (BrowserInfo.get().isIE()) { | |||
((Element) event.getEventTarget().cast()) | |||
((com.google.gwt.user.client.Element) event | |||
.getEventTarget().cast()) | |||
.setPropertyJSO( | |||
"onselectstart", | |||
getPreventTextSelectionIEHack()); | |||
@@ -6034,7 +6052,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
} | |||
protected void startRowDrag(Event event, final int type, | |||
Element targetTdOrTr) { | |||
com.google.gwt.user.client.Element targetTdOrTr) { | |||
VTransferable transferable = new VTransferable(); | |||
transferable.setDragSource(ConnectorMap.get(client) | |||
.getConnector(VScrollTable.this)); | |||
@@ -6055,17 +6073,20 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
// Create a drag image of ALL rows | |||
ev.createDragImage( | |||
(Element) scrollBody.tBodyElement.cast(), true); | |||
(com.google.gwt.user.client.Element) scrollBody.tBodyElement | |||
.cast(), true); | |||
// Hide rows which are not selected | |||
Element dragImage = ev.getDragImage(); | |||
com.google.gwt.user.client.Element dragImage = ev | |||
.getDragImage(); | |||
int i = 0; | |||
for (Iterator<Widget> iterator = scrollBody.iterator(); iterator | |||
.hasNext();) { | |||
VScrollTableRow next = (VScrollTableRow) iterator | |||
.next(); | |||
Element child = (Element) dragImage.getChild(i++); | |||
com.google.gwt.user.client.Element child = (com.google.gwt.user.client.Element) dragImage | |||
.getChild(i++); | |||
if (!rowKeyIsSelected(next.rowKey)) { | |||
child.getStyle().setVisibility(Visibility.HIDDEN); | |||
@@ -6090,8 +6111,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* @return TD or TR element that the event targets (the actual event | |||
* target is this element or a child of it) | |||
*/ | |||
private Element getEventTargetTdOrTr(Event event) { | |||
final Element eventTarget = event.getEventTarget().cast(); | |||
private com.google.gwt.user.client.Element getEventTargetTdOrTr( | |||
Event event) { | |||
final com.google.gwt.user.client.Element eventTarget = event | |||
.getEventTarget().cast(); | |||
Widget widget = Util.findWidget(eventTarget, null); | |||
if (widget != this) { | |||
@@ -6399,8 +6422,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
.getVisibleCellCount(); ix++) { | |||
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth(); | |||
} | |||
Util.setWidthExcludingPaddingAndBorder((Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
Util.setWidthExcludingPaddingAndBorder( | |||
(com.google.gwt.user.client.Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
} | |||
} | |||
@@ -7099,15 +7123,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
private void updateDropDetails(VDragEvent drag) { | |||
dropDetails = new TableDDDetails(); | |||
Element elementOver = drag.getElementOver(); | |||
com.google.gwt.user.client.Element elementOver = drag | |||
.getElementOver(); | |||
VScrollTableRow row = Util.findWidget(elementOver, getRowClass()); | |||
if (row != null) { | |||
dropDetails.overkey = row.rowKey; | |||
Element tr = row.getElement(); | |||
Element element = elementOver; | |||
com.google.gwt.user.client.Element tr = row.getElement(); | |||
com.google.gwt.user.client.Element element = elementOver; | |||
while (element != null && element.getParentElement() != tr) { | |||
element = (Element) element.getParentElement(); | |||
element = (com.google.gwt.user.client.Element) element | |||
.getParentElement(); | |||
} | |||
int childIndex = DOM.getChildIndex(tr, element); | |||
dropDetails.colkey = tHead.getHeaderCell(childIndex) | |||
@@ -7583,7 +7609,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
* ...and sometimes it sends blur events even though the focus | |||
* handler is still active. (#10464) | |||
*/ | |||
Element focusedElement = Util.getIEFocusedElement(); | |||
com.google.gwt.user.client.Element focusedElement = Util | |||
.getIEFocusedElement(); | |||
if (Util.getConnectorForElement(client, getParent(), focusedElement) == this | |||
&& focusedElement != null | |||
&& focusedElement != scrollBodyPanel.getFocusElement()) { | |||
@@ -7850,14 +7877,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
+ "\\[(\\d+)\\]"); | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (SUBPART_ROW_COL_REGEXP.test(subPart)) { | |||
MatchResult result = SUBPART_ROW_COL_REGEXP.exec(subPart); | |||
int rowIx = Integer.valueOf(result.getGroup(1)); | |||
int colIx = Integer.valueOf(result.getGroup(2)); | |||
VScrollTableRow row = scrollBody.getRowByRowIndex(rowIx); | |||
if (row != null) { | |||
Element rowElement = row.getElement(); | |||
com.google.gwt.user.client.Element rowElement = row | |||
.getElement(); | |||
if (colIx < rowElement.getChildCount()) { | |||
return rowElement.getChild(colIx).getFirstChild().cast(); | |||
} | |||
@@ -7892,7 +7920,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
Widget widget = Util.findWidget(subElement, null); | |||
if (widget instanceof HeaderCell) { | |||
return SUBPART_HEADER + "[" + tHead.visibleCells.indexOf(widget) |
@@ -28,7 +28,6 @@ import com.google.gwt.event.logical.shared.ValueChangeHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.HTML; | |||
@@ -80,17 +79,17 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
}; | |||
/* DOM element for slider's base */ | |||
private final Element base; | |||
private final com.google.gwt.user.client.Element base; | |||
private final int BASE_BORDER_WIDTH = 1; | |||
/* DOM element for slider's handle */ | |||
private final Element handle; | |||
private final com.google.gwt.user.client.Element handle; | |||
/* DOM element for decrement arrow */ | |||
private final Element smaller; | |||
private final com.google.gwt.user.client.Element smaller; | |||
/* DOM element for increment arrow */ | |||
private final Element bigger; | |||
private final com.google.gwt.user.client.Element bigger; | |||
/* Temporary dragging/animation variables */ | |||
private boolean dragging = false; | |||
@@ -199,7 +198,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
return; | |||
} | |||
final Element p = getElement().getParentElement().cast(); | |||
final com.google.gwt.user.client.Element p = getElement() | |||
.getParentElement().cast(); | |||
if (p.getPropertyInt(domProperty) > 50) { | |||
if (isVertical()) { | |||
setHeight(); | |||
@@ -214,7 +214,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
@Override | |||
public void execute() { | |||
final Element p = getElement().getParentElement().cast(); | |||
final com.google.gwt.user.client.Element p = getElement() | |||
.getParentElement().cast(); | |||
if (p.getPropertyInt(domProperty) > (MIN_SIZE + 5)) { | |||
if (isVertical()) { | |||
setHeight(); | |||
@@ -265,7 +266,8 @@ public class VSlider extends SimpleFocusablePanel implements Field, | |||
if (disabled || readonly) { | |||
return; | |||
} | |||
final Element targ = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element targ = DOM | |||
.eventGetTarget(event); | |||
if (DOM.eventGetType(event) == Event.ONMOUSEWHEEL) { | |||
processMouseWheelEvent(event); |
@@ -44,7 +44,6 @@ import com.google.gwt.event.dom.client.KeyDownHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
@@ -113,11 +112,11 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
+ "-focus"; | |||
private TabCaption tabCaption; | |||
Element td = getElement(); | |||
com.google.gwt.user.client.Element td = getElement(); | |||
private VCloseHandler closeHandler; | |||
private boolean enabledOnServer = true; | |||
private Element div; | |||
private com.google.gwt.user.client.Element div; | |||
private TabBar tabBar; | |||
private boolean hiddenOnServer = false; | |||
@@ -162,7 +161,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
} | |||
@Override | |||
protected Element getContainerElement() { | |||
protected com.google.gwt.user.client.Element getContainerElement() { | |||
// Attach caption element to div, not td | |||
return div; | |||
} | |||
@@ -311,7 +310,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
public static class TabCaption extends VCaption { | |||
private boolean closable = false; | |||
private Element closeButton; | |||
private com.google.gwt.user.client.Element closeButton; | |||
private Tab tab; | |||
TabCaption(Tab tab, ApplicationConnection client) { | |||
@@ -406,7 +405,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
return width; | |||
} | |||
public Element getCloseButton() { | |||
public com.google.gwt.user.client.Element getCloseButton() { | |||
return closeButton; | |||
} | |||
@@ -415,9 +414,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
static class TabBar extends ComplexPanel implements ClickHandler, | |||
VCloseHandler { | |||
private final Element tr = DOM.createTR(); | |||
private final com.google.gwt.user.client.Element tr = DOM.createTR(); | |||
private final Element spacerTd = DOM.createTD(); | |||
private final com.google.gwt.user.client.Element spacerTd = DOM | |||
.createTD(); | |||
private Tab selected; | |||
@@ -426,10 +426,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
TabBar(VTabsheet tabsheet) { | |||
this.tabsheet = tabsheet; | |||
Element el = DOM.createTable(); | |||
com.google.gwt.user.client.Element el = DOM.createTable(); | |||
Roles.getPresentationRole().set(el); | |||
Element tbody = DOM.createTBody(); | |||
com.google.gwt.user.client.Element tbody = DOM.createTBody(); | |||
DOM.appendChild(el, tbody); | |||
DOM.appendChild(tbody, tr); | |||
setStyleName(spacerTd, CLASSNAME + "-spacertd"); | |||
@@ -448,7 +448,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
getTabsheet().sendTabClosedEvent(tabIndex); | |||
} | |||
protected Element getContainerElement() { | |||
protected com.google.gwt.user.client.Element getContainerElement() { | |||
return tr; | |||
} | |||
@@ -477,8 +477,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
@Override | |||
public void onClick(ClickEvent event) { | |||
TabCaption caption = (TabCaption) event.getSource(); | |||
Element targetElement = event.getNativeEvent().getEventTarget() | |||
.cast(); | |||
com.google.gwt.user.client.Element targetElement = event | |||
.getNativeEvent().getEventTarget().cast(); | |||
// the tab should not be focused if the close button was clicked | |||
if (targetElement == caption.getCloseButton()) { | |||
return; | |||
@@ -644,7 +644,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
public static final String SCROLLER_CLASSNAME = "v-tabsheet-scroller"; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final Element tabs; // tabbar and 'scroller' container | |||
// tabbar and 'scroller' container | |||
public final com.google.gwt.user.client.Element tabs; | |||
Tab focusedTab; | |||
/** | |||
* The tabindex property (position in the browser's focus cycle.) Named like | |||
@@ -654,9 +655,12 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
private static final FocusImpl focusImpl = FocusImpl.getFocusImplForPanel(); | |||
private final Element scroller; // tab-scroller element | |||
private final Element scrollerNext; // tab-scroller next button element | |||
private final Element scrollerPrev; // tab-scroller prev button element | |||
// tab-scroller element | |||
private final com.google.gwt.user.client.Element scroller; | |||
// tab-scroller next button element | |||
private final com.google.gwt.user.client.Element scrollerNext; | |||
// tab-scroller prev button element | |||
private final com.google.gwt.user.client.Element scrollerPrev; | |||
/** | |||
* The index of the first visible tab (when scrolled) | |||
@@ -667,9 +671,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
/** 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 Element contentNode; | |||
public final com.google.gwt.user.client.Element contentNode; | |||
private final Element deco; | |||
private final com.google.gwt.user.client.Element deco; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean waitingForResponse; | |||
@@ -1127,8 +1131,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, | |||
} | |||
private boolean isClippedTabs() { | |||
return (tb.getOffsetWidth() - DOM.getElementPropertyInt((Element) tb | |||
.getContainerElement().getLastChild().cast(), "offsetWidth")) > getOffsetWidth() | |||
return (tb.getOffsetWidth() - DOM.getElementPropertyInt( | |||
(com.google.gwt.user.client.Element) tb.getContainerElement() | |||
.getLastChild().cast(), "offsetWidth")) > getOffsetWidth() | |||
- (isScrolledTabs() ? scroller.getOffsetWidth() : 0); | |||
} | |||
@@ -17,7 +17,6 @@ | |||
package com.vaadin.client.ui; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler; | |||
@@ -53,13 +52,13 @@ public class VTabsheetPanel extends ComplexPanel { | |||
*/ | |||
@Override | |||
public void add(Widget w) { | |||
Element el = createContainerElement(); | |||
com.google.gwt.user.client.Element el = createContainerElement(); | |||
DOM.appendChild(getElement(), el); | |||
super.add(w, el); | |||
} | |||
private Element createContainerElement() { | |||
Element el = DOM.createDiv(); | |||
private com.google.gwt.user.client.Element createContainerElement() { | |||
com.google.gwt.user.client.Element el = DOM.createDiv(); | |||
DOM.setStyleAttribute(el, "position", "absolute"); | |||
hide(el); | |||
touchScrollHandler.addElement(el); | |||
@@ -86,15 +85,15 @@ public class VTabsheetPanel extends ComplexPanel { | |||
* if <code>beforeIndex</code> is out of range | |||
*/ | |||
public void insert(Widget w, int beforeIndex) { | |||
Element el = createContainerElement(); | |||
com.google.gwt.user.client.Element el = createContainerElement(); | |||
DOM.insertChild(getElement(), el, beforeIndex); | |||
super.insert(w, el, beforeIndex, false); | |||
} | |||
@Override | |||
public boolean remove(Widget w) { | |||
Element child = w.getElement(); | |||
Element parent = null; | |||
com.google.gwt.user.client.Element child = w.getElement(); | |||
com.google.gwt.user.client.Element parent = null; | |||
if (child != null) { | |||
parent = DOM.getParent(child); | |||
} | |||
@@ -135,13 +134,13 @@ public class VTabsheetPanel extends ComplexPanel { | |||
unHide(DOM.getParent(visibleWidget.getElement())); | |||
} | |||
private void hide(Element e) { | |||
private void hide(com.google.gwt.user.client.Element e) { | |||
DOM.setStyleAttribute(e, "visibility", "hidden"); | |||
DOM.setStyleAttribute(e, "top", "-100000px"); | |||
DOM.setStyleAttribute(e, "left", "-100000px"); | |||
} | |||
private void unHide(Element e) { | |||
private void unHide(com.google.gwt.user.client.Element e) { | |||
DOM.setStyleAttribute(e, "top", "0px"); | |||
DOM.setStyleAttribute(e, "left", "0px"); | |||
DOM.setStyleAttribute(e, "visibility", ""); | |||
@@ -165,8 +164,8 @@ public class VTabsheetPanel extends ComplexPanel { | |||
width = minWidth; | |||
} | |||
Element wrapperDiv = (Element) visibleWidget.getElement() | |||
.getParentElement(); | |||
com.google.gwt.user.client.Element wrapperDiv = (com.google.gwt.user.client.Element) visibleWidget | |||
.getElement().getParentElement(); | |||
// width first | |||
getElement().getStyle().setPropertyPx("width", width); |
@@ -26,7 +26,6 @@ import com.google.gwt.event.dom.client.KeyCodes; | |||
import com.google.gwt.event.dom.client.KeyDownEvent; | |||
import com.google.gwt.event.dom.client.KeyDownHandler; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.TextBoxBase; | |||
@@ -87,7 +86,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
this(DOM.createInputText()); | |||
} | |||
protected VTextField(Element node) { | |||
protected VTextField(com.google.gwt.user.client.Element node) { | |||
super(node); | |||
setStyleName(CLASSNAME); | |||
addChangeHandler(this); | |||
@@ -241,7 +240,8 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
} | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public native void attachCutEventListener(Element el) | |||
public native void attachCutEventListener( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var me = this; | |||
el.oncut = $entry(function() { | |||
@@ -249,7 +249,8 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
}); | |||
}-*/; | |||
protected native void detachCutEventListener(Element el) | |||
protected native void detachCutEventListener( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
el.oncut = null; | |||
}-*/; | |||
@@ -469,7 +470,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
return !"off".equals(wrap); | |||
} | |||
private native void addOnInputListener(Element el) | |||
private native void addOnInputListener(com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var self = this; | |||
el.oninput = $entry(function() { | |||
@@ -477,7 +478,8 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, | |||
}); | |||
}-*/; | |||
private native void removeOnInputListener(Element el) | |||
private native void removeOnInputListener( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
el.oninput = null; | |||
}-*/; |
@@ -25,7 +25,6 @@ import com.google.gwt.event.dom.client.ChangeEvent; | |||
import com.google.gwt.event.dom.client.ChangeHandler; | |||
import com.google.gwt.event.dom.client.FocusEvent; | |||
import com.google.gwt.event.dom.client.FocusHandler; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.TextBox; | |||
import com.vaadin.client.Focusable; | |||
import com.vaadin.client.LocaleNotLoadedException; | |||
@@ -164,7 +163,8 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, | |||
} | |||
@Override | |||
public void bindAriaCaption(Element captionElement) { | |||
public void bindAriaCaption( | |||
com.google.gwt.user.client.Element captionElement) { | |||
AriaHelper.bindCaption(text, captionElement); | |||
} | |||
@@ -364,7 +364,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, | |||
private final String TEXTFIELD_ID = "field"; | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (subPart.equals(TEXTFIELD_ID)) { | |||
return text.getElement(); | |||
} | |||
@@ -373,7 +373,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (text.getElement().isOrHasChild(subElement)) { | |||
return TEXTFIELD_ID; | |||
} |
@@ -46,7 +46,6 @@ import com.google.gwt.event.dom.client.KeyPressEvent; | |||
import com.google.gwt.event.dom.client.KeyPressHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
@@ -237,14 +236,15 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
if (event.getTypeInt() == Event.ONMOUSEDOWN) { | |||
// Prevent default text selection in IE | |||
if (BrowserInfo.get().isIE()) { | |||
((Element) event.getEventTarget().cast()).setPropertyJSO( | |||
"onselectstart", applyDisableTextSelectionIEHack()); | |||
((com.google.gwt.user.client.Element) event.getEventTarget() | |||
.cast()).setPropertyJSO("onselectstart", | |||
applyDisableTextSelectionIEHack()); | |||
} | |||
} else if (event.getTypeInt() == Event.ONMOUSEUP) { | |||
// Remove IE text selection hack | |||
if (BrowserInfo.get().isIE()) { | |||
((Element) event.getEventTarget().cast()).setPropertyJSO( | |||
"onselectstart", null); | |||
((com.google.gwt.user.client.Element) event.getEventTarget() | |||
.cast()).setPropertyJSO("onselectstart", null); | |||
} | |||
} else if (event.getTypeInt() == Event.ONKEYUP) { | |||
if (selectionHasChanged) { | |||
@@ -338,7 +338,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
} | |||
private String findCurrentMouseOverKey(Element elementOver) { | |||
private String findCurrentMouseOverKey( | |||
com.google.gwt.user.client.Element elementOver) { | |||
TreeNode treeNode = Util.findWidget(elementOver, TreeNode.class); | |||
return treeNode == null ? null : treeNode.key; | |||
} | |||
@@ -516,9 +517,9 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean childrenLoaded; | |||
Element nodeCaptionDiv; | |||
com.google.gwt.user.client.Element nodeCaptionDiv; | |||
protected Element nodeCaptionSpan; | |||
protected com.google.gwt.user.client.Element nodeCaptionSpan; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public FlowPanel childNodeContainer; | |||
@@ -691,7 +692,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
public void onBrowserEvent(Event event) { | |||
super.onBrowserEvent(event); | |||
final int type = DOM.eventGetType(event); | |||
final Element target = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
if (type == Event.ONLOAD && target == icon.getElement()) { | |||
iconLoaded.trigger(); | |||
@@ -892,7 +894,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
nodeCaptionDiv = DOM.createDiv(); | |||
DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME | |||
+ "-caption"); | |||
Element wrapper = DOM.createDiv(); | |||
com.google.gwt.user.client.Element wrapper = DOM.createDiv(); | |||
wrapper.setId(labelId); | |||
wrapper.setAttribute("for", treeItemId); | |||
@@ -2060,7 +2062,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
* .lang.String) | |||
*/ | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if ("fe".equals(subPart)) { | |||
if (BrowserInfo.get().isOpera() && focusedNode != null) { | |||
return focusedNode.getElement(); | |||
@@ -2113,7 +2115,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
* .gwt.user.client.Element) | |||
*/ | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
// Supported identifiers: | |||
// | |||
// n[index]/n[index]/n[index]{/expand} | |||
@@ -2222,7 +2224,8 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, | |||
} | |||
@Override | |||
public void bindAriaCaption(Element captionElement) { | |||
public void bindAriaCaption( | |||
com.google.gwt.user.client.Element captionElement) { | |||
AriaHelper.bindCaption(body, captionElement); | |||
} | |||
} |
@@ -33,7 +33,6 @@ import com.google.gwt.dom.client.Style.Visibility; | |||
import com.google.gwt.dom.client.TableCellElement; | |||
import com.google.gwt.event.dom.client.KeyCodes; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ComputedStyle; | |||
@@ -170,8 +169,8 @@ public class VTreeTable extends VScrollTable { | |||
protected boolean addTreeSpacer(UIDL rowUidl) { | |||
if (cellShowsTreeHierarchy(getElement().getChildCount() - 1)) { | |||
Element container = (Element) getElement().getLastChild() | |||
.getFirstChild(); | |||
com.google.gwt.user.client.Element container = (com.google.gwt.user.client.Element) getElement() | |||
.getLastChild().getFirstChild(); | |||
if (rowUidl.hasAttribute("icon")) { | |||
// icons are in first content cell in TreeTable | |||
@@ -262,7 +261,8 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
private int getCellWidthFromDom(int cellIndex) { | |||
final Element cell = DOM.getChild(getElement(), cellIndex); | |||
final com.google.gwt.user.client.Element cell = DOM.getChild( | |||
getElement(), cellIndex); | |||
String w = cell.getStyle().getProperty("width"); | |||
if (w == null || "".equals(w) || !w.endsWith("px")) { | |||
return -1; | |||
@@ -420,8 +420,9 @@ public class VTreeTable extends VScrollTable { | |||
.getVisibleCellCount(); ix++) { | |||
spanWidth += tHead.getHeaderCell(ix).getOffsetWidth(); | |||
} | |||
Util.setWidthExcludingPaddingAndBorder((Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
Util.setWidthExcludingPaddingAndBorder( | |||
(com.google.gwt.user.client.Element) getElement() | |||
.getChild(cellIx), spanWidth, 13, false); | |||
} | |||
} | |||
@@ -523,7 +524,7 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
private void copyTRBackgroundsToTDs(VScrollTableRow row) { | |||
Element tr = row.getElement(); | |||
com.google.gwt.user.client.Element tr = row.getElement(); | |||
ComputedStyle cs = new ComputedStyle(tr); | |||
String backgroundAttachment = cs | |||
.getProperty("backgroundAttachment"); | |||
@@ -532,7 +533,8 @@ public class VTreeTable extends VScrollTable { | |||
String backgroundImage = cs.getProperty("backgroundImage"); | |||
String backgroundOrigin = cs.getProperty("backgroundOrigin"); | |||
for (int ix = 0; ix < tr.getChildCount(); ix++) { | |||
Element td = tr.getChild(ix).cast(); | |||
com.google.gwt.user.client.Element td = tr.getChild(ix) | |||
.cast(); | |||
if (!elementHasBackground(td)) { | |||
td.getStyle().setProperty("backgroundAttachment", | |||
backgroundAttachment); | |||
@@ -548,7 +550,8 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
} | |||
private boolean elementHasBackground(Element element) { | |||
private boolean elementHasBackground( | |||
com.google.gwt.user.client.Element element) { | |||
ComputedStyle cs = new ComputedStyle(element); | |||
String clr = cs.getProperty("backgroundColor"); | |||
String img = cs.getProperty("backgroundImage"); | |||
@@ -567,9 +570,10 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
private void restoreStyleForTDsInRow(VScrollTableRow row) { | |||
Element tr = row.getElement(); | |||
com.google.gwt.user.client.Element tr = row.getElement(); | |||
for (int ix = 0; ix < tr.getChildCount(); ix++) { | |||
Element td = tr.getChild(ix).cast(); | |||
com.google.gwt.user.client.Element td = tr.getChild(ix) | |||
.cast(); | |||
td.getStyle().clearProperty("backgroundAttachment"); | |||
td.getStyle().clearProperty("backgroundClip"); | |||
td.getStyle().clearProperty("backgroundColor"); | |||
@@ -615,8 +619,8 @@ public class VTreeTable extends VScrollTable { | |||
private class RowExpandAnimation extends Animation { | |||
private final List<VScrollTableRow> rows; | |||
private Element cloneDiv; | |||
private Element cloneTable; | |||
private com.google.gwt.user.client.Element cloneDiv; | |||
private com.google.gwt.user.client.Element cloneTable; | |||
private AnimationPreparator preparator; | |||
/** | |||
@@ -641,7 +645,7 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
private void cloneAndAppendRow(VScrollTableRow row) { | |||
Element clonedTR = null; | |||
com.google.gwt.user.client.Element clonedTR = null; | |||
clonedTR = row.getElement().cloneNode(true).cast(); | |||
clonedTR.getStyle().setVisibility(Visibility.VISIBLE); | |||
cloneTable.appendChild(clonedTR); | |||
@@ -663,8 +667,10 @@ public class VTreeTable extends VScrollTable { | |||
} | |||
private void insertAnimatingDiv() { | |||
Element tableBody = getElement().cast(); | |||
Element tableBodyParent = tableBody.getParentElement().cast(); | |||
com.google.gwt.user.client.Element tableBody = getElement() | |||
.cast(); | |||
com.google.gwt.user.client.Element tableBodyParent = tableBody | |||
.getParentElement().cast(); | |||
tableBodyParent.insertAfter(cloneDiv, tableBody); | |||
} | |||
@@ -709,25 +715,27 @@ public class VTreeTable extends VScrollTable { | |||
resetCellWrapperDivsDisplayProperty(row); | |||
row.removeStyleName("v-table-row-animating"); | |||
} | |||
Element tableBodyParent = (Element) getElement() | |||
com.google.gwt.user.client.Element tableBodyParent = (com.google.gwt.user.client.Element) getElement() | |||
.getParentElement(); | |||
tableBodyParent.removeChild(cloneDiv); | |||
} | |||
private void setCellWrapperDivsToDisplayNone(VScrollTableRow row) { | |||
Element tr = row.getElement(); | |||
com.google.gwt.user.client.Element tr = row.getElement(); | |||
for (int ix = 0; ix < tr.getChildCount(); ix++) { | |||
getWrapperDiv(tr, ix).getStyle().setDisplay(Display.NONE); | |||
} | |||
} | |||
private Element getWrapperDiv(Element tr, int tdIx) { | |||
Element td = tr.getChild(tdIx).cast(); | |||
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(); | |||
return td.getChild(0).cast(); | |||
} | |||
private void resetCellWrapperDivsDisplayProperty(VScrollTableRow row) { | |||
Element tr = row.getElement(); | |||
com.google.gwt.user.client.Element tr = row.getElement(); | |||
for (int ix = 0; ix < tr.getChildCount(); ix++) { | |||
getWrapperDiv(tr, ix).getStyle().clearProperty("display"); | |||
} |
@@ -33,7 +33,6 @@ import com.google.gwt.event.dom.client.MouseDownEvent; | |||
import com.google.gwt.event.dom.client.MouseDownHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.ListBox; | |||
@@ -569,20 +568,20 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
private static final String SUBPART_REMOVE_BUTTON = "remove"; | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (SUBPART_OPTION_SELECT.equals(subPart)) { | |||
return options.getElement(); | |||
} else if (subPart.startsWith(SUBPART_OPTION_SELECT_ITEM)) { | |||
String idx = subPart.substring(SUBPART_OPTION_SELECT_ITEM.length()); | |||
return (Element) options.getElement().getChild( | |||
Integer.parseInt(idx)); | |||
return (com.google.gwt.user.client.Element) options.getElement() | |||
.getChild(Integer.parseInt(idx)); | |||
} else if (SUBPART_SELECTION_SELECT.equals(subPart)) { | |||
return selections.getElement(); | |||
} else if (subPart.startsWith(SUBPART_SELECTION_SELECT_ITEM)) { | |||
String idx = subPart.substring(SUBPART_SELECTION_SELECT_ITEM | |||
.length()); | |||
return (Element) selections.getElement().getChild( | |||
Integer.parseInt(idx)); | |||
return (com.google.gwt.user.client.Element) selections.getElement() | |||
.getChild(Integer.parseInt(idx)); | |||
} else if (optionsCaption != null | |||
&& SUBPART_LEFT_CAPTION.equals(subPart)) { | |||
return optionsCaption.getElement(); | |||
@@ -599,7 +598,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (optionsCaption != null | |||
&& optionsCaption.getElement().isOrHasChild(subElement)) { | |||
return SUBPART_LEFT_CAPTION; |
@@ -25,7 +25,6 @@ import com.google.gwt.dom.client.FormElement; | |||
import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.FileUpload; | |||
@@ -153,7 +152,8 @@ public class VUpload extends SimplePanel { | |||
setStyleName(CLASSNAME); | |||
} | |||
private static native void setEncoding(Element form, String encoding) | |||
private static native void setEncoding( | |||
com.google.gwt.user.client.Element form, String encoding) | |||
/*-{ | |||
form.enctype = encoding; | |||
// For IE8 | |||
@@ -172,12 +172,14 @@ public class VUpload extends SimplePanel { | |||
setStyleName(getElement(), CLASSNAME + "-immediate", immediate); | |||
} | |||
private static native void fireNativeClick(Element element) | |||
private static native void fireNativeClick( | |||
com.google.gwt.user.client.Element element) | |||
/*-{ | |||
element.click(); | |||
}-*/; | |||
private static native void fireNativeBlur(Element element) | |||
private static native void fireNativeBlur( | |||
com.google.gwt.user.client.Element element) | |||
/*-{ | |||
element.blur(); | |||
}-*/; |
@@ -19,7 +19,6 @@ package com.vaadin.client.ui; | |||
import com.google.gwt.dom.client.Document; | |||
import com.google.gwt.dom.client.Style.Unit; | |||
import com.google.gwt.dom.client.VideoElement; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.Util; | |||
public class VVideo extends VMediaBase { | |||
@@ -42,7 +41,8 @@ public class VVideo extends VMediaBase { | |||
* | |||
* @param el | |||
*/ | |||
private native void updateDimensionsWhenMetadataLoaded(Element el) | |||
private native void updateDimensionsWhenMetadataLoaded( | |||
com.google.gwt.user.client.Element el) | |||
/*-{ | |||
var self = this; | |||
el.addEventListener('loadedmetadata', $entry(function(e) { |
@@ -46,7 +46,6 @@ import com.google.gwt.event.dom.client.ScrollHandler; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Event.NativePreviewEvent; | |||
import com.google.gwt.user.client.Event.NativePreviewHandler; | |||
@@ -91,15 +90,15 @@ public class VWindow extends VWindowOverlay implements | |||
public static final int Z_INDEX = 10000; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element contents; | |||
public com.google.gwt.user.client.Element contents; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element header; | |||
public com.google.gwt.user.client.Element header; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element footer; | |||
public com.google.gwt.user.client.Element footer; | |||
private Element resizeBox; | |||
private com.google.gwt.user.client.Element resizeBox; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public final FocusableScrollPanel contentPanel = new FocusableScrollPanel(); | |||
@@ -121,10 +120,10 @@ public class VWindow extends VWindowOverlay implements | |||
private int origH; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element closeBox; | |||
public com.google.gwt.user.client.Element closeBox; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public Element maximizeRestoreBox; | |||
public com.google.gwt.user.client.Element maximizeRestoreBox; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public ApplicationConnection client; | |||
@@ -152,11 +151,11 @@ public class VWindow extends VWindowOverlay implements | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean resizeLazy = false; | |||
private Element modalityCurtain; | |||
private Element draggingCurtain; | |||
private Element resizingCurtain; | |||
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 headerText; | |||
private com.google.gwt.user.client.Element headerText; | |||
private boolean closable = true; | |||
@@ -164,8 +163,8 @@ public class VWindow extends VWindowOverlay implements | |||
private String assistivePrefix; | |||
private String assistivePostfix; | |||
private Element topTabStop; | |||
private Element bottomTabStop; | |||
private com.google.gwt.user.client.Element topTabStop; | |||
private com.google.gwt.user.client.Element bottomTabStop; | |||
private NativePreviewHandler topEventBlocker; | |||
private NativePreviewHandler bottomEventBlocker; | |||
@@ -188,7 +187,7 @@ public class VWindow extends VWindowOverlay implements | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean immediate; | |||
private Element wrapper; | |||
private com.google.gwt.user.client.Element wrapper; | |||
/** For internal use only. May be removed or replaced in the future. */ | |||
public boolean visibilityChangesDisabled; | |||
@@ -330,7 +329,7 @@ public class VWindow extends VWindowOverlay implements | |||
} | |||
} | |||
protected Element getModalityCurtain() { | |||
protected com.google.gwt.user.client.Element getModalityCurtain() { | |||
if (modalityCurtain == null) { | |||
modalityCurtain = DOM.createDiv(); | |||
modalityCurtain.setClassName(CLASSNAME + "-modalitycurtain"); | |||
@@ -683,7 +682,7 @@ public class VWindow extends VWindowOverlay implements | |||
} | |||
private void fixIE8FocusCaptureIssue() { | |||
Element e = DOM.createInputText(); | |||
com.google.gwt.user.client.Element e = DOM.createInputText(); | |||
Style elemStyle = e.getStyle(); | |||
elemStyle.setPosition(Position.ABSOLUTE); | |||
elemStyle.setTop(-10, Unit.PX); | |||
@@ -773,7 +772,7 @@ public class VWindow extends VWindowOverlay implements | |||
} | |||
} | |||
private Element getDraggingCurtain() { | |||
private com.google.gwt.user.client.Element getDraggingCurtain() { | |||
if (draggingCurtain == null) { | |||
draggingCurtain = createCurtain(); | |||
draggingCurtain.setClassName(CLASSNAME + "-draggingCurtain"); | |||
@@ -782,7 +781,7 @@ public class VWindow extends VWindowOverlay implements | |||
return draggingCurtain; | |||
} | |||
private Element getResizingCurtain() { | |||
private com.google.gwt.user.client.Element getResizingCurtain() { | |||
if (resizingCurtain == null) { | |||
resizingCurtain = createCurtain(); | |||
resizingCurtain.setClassName(CLASSNAME + "-resizingCurtain"); | |||
@@ -791,8 +790,8 @@ public class VWindow extends VWindowOverlay implements | |||
return resizingCurtain; | |||
} | |||
private Element createCurtain() { | |||
Element curtain = DOM.createDiv(); | |||
private com.google.gwt.user.client.Element createCurtain() { | |||
com.google.gwt.user.client.Element curtain = DOM.createDiv(); | |||
DOM.setStyleAttribute(curtain, "position", "absolute"); | |||
DOM.setStyleAttribute(curtain, "top", "0px"); | |||
@@ -930,7 +929,7 @@ public class VWindow extends VWindowOverlay implements | |||
} | |||
@Override | |||
protected Element getContainerElement() { | |||
protected com.google.gwt.user.client.Element getContainerElement() { | |||
// in GWT 1.5 this method is used in PopupPanel constructor | |||
if (contents == null) { | |||
return super.getContainerElement(); | |||
@@ -946,7 +945,8 @@ public class VWindow extends VWindowOverlay implements | |||
final int type = event.getTypeInt(); | |||
final Element target = DOM.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
if (resizing || resizeBox == target) { | |||
onResizeEvent(event); | |||
@@ -1255,7 +1255,8 @@ public class VWindow extends VWindowOverlay implements | |||
return true; | |||
} | |||
final Element target = event.getEventTarget().cast(); | |||
final com.google.gwt.user.client.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 | |||
@@ -1373,7 +1374,7 @@ public class VWindow extends VWindowOverlay implements | |||
"All values in parameter description need to be non-null"); | |||
} | |||
Element element = ((ComponentConnector) connectors[index]) | |||
com.google.gwt.user.client.Element element = ((ComponentConnector) connectors[index]) | |||
.getWidget().getElement(); | |||
AriaHelper.ensureHasId(element); | |||
ids[index] = Id.of(element); |
@@ -17,7 +17,6 @@ | |||
package com.vaadin.client.ui; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -38,12 +37,12 @@ public class VWindowOverlay extends VOverlay { | |||
* {@link ApplicationConnection} cannot be determined. | |||
*/ | |||
@Override | |||
public Element getOverlayContainer() { | |||
public com.google.gwt.user.client.Element getOverlayContainer() { | |||
ApplicationConnection ac = getApplicationConnection(); | |||
if (ac == null) { | |||
return super.getOverlayContainer(); | |||
} else { | |||
Element overlayContainer = getOverlayContainer(ac); | |||
com.google.gwt.user.client.Element overlayContainer = getOverlayContainer(ac); | |||
return overlayContainer; | |||
} | |||
} | |||
@@ -58,10 +57,11 @@ public class VWindowOverlay extends VOverlay { | |||
* A reference to {@link ApplicationConnection} | |||
* @return The overlay container | |||
*/ | |||
public static Element getOverlayContainer(ApplicationConnection ac) { | |||
public static com.google.gwt.user.client.Element getOverlayContainer( | |||
ApplicationConnection ac) { | |||
String id = ac.getConfiguration().getRootPanelId(); | |||
id = id += "-window-overlays"; | |||
Element container = DOM.getElementById(id); | |||
com.google.gwt.user.client.Element container = DOM.getElementById(id); | |||
if (container == null) { | |||
container = DOM.createDiv(); | |||
container.setId(id); |
@@ -17,7 +17,6 @@ package com.vaadin.client.ui.absolutelayout; | |||
import java.util.List; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ComponentConnector; | |||
import com.vaadin.client.ConnectorHierarchyChangeEvent; | |||
import com.vaadin.client.DirectionalManagedLayout; | |||
@@ -46,7 +45,8 @@ public class AbsoluteLayoutConnector extends | |||
this) { | |||
@Override | |||
protected ComponentConnector getChildComponent(Element element) { | |||
protected ComponentConnector getChildComponent( | |||
com.google.gwt.user.client.Element element) { | |||
return getConnectorForElement(element); | |||
} | |||
@@ -92,7 +92,8 @@ public class AbsoluteLayoutConnector extends | |||
* @return The Paintable which the element is a part of. Null if the element | |||
* belongs to the layout and not to a child. | |||
*/ | |||
protected ComponentConnector getConnectorForElement(Element element) { | |||
protected ComponentConnector getConnectorForElement( | |||
com.google.gwt.user.client.Element element) { | |||
return Util.getConnectorForElement(getConnection(), getWidget(), | |||
element); | |||
} |
@@ -20,7 +20,6 @@ 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.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
/** | |||
@@ -38,7 +37,8 @@ public class AriaHelper { | |||
* @param captionElements | |||
* Element with of caption to bind | |||
*/ | |||
public static void bindCaption(Widget widget, Element captionElement) { | |||
public static void bindCaption(Widget widget, | |||
com.google.gwt.user.client.Element captionElement) { | |||
assert widget != null : "Valid Widget required"; | |||
if (widget instanceof HandlesAriaCaption) { | |||
@@ -102,7 +102,8 @@ public class AriaHelper { | |||
* @param required | |||
* boolean, true when the element is required | |||
*/ | |||
public static void handleInputRequired(Element element, boolean required) { | |||
public static void handleInputRequired( | |||
com.google.gwt.user.client.Element element, boolean required) { | |||
if (required) { | |||
Roles.getTextboxRole().setAriaRequiredProperty(element, required); | |||
} else { | |||
@@ -138,7 +139,8 @@ public class AriaHelper { | |||
* @param invalid | |||
* boolean, true when the element input has an error | |||
*/ | |||
public static void handleInputInvalid(Element element, boolean invalid) { | |||
public static void handleInputInvalid( | |||
com.google.gwt.user.client.Element element, boolean invalid) { | |||
if (invalid) { | |||
Roles.getTextboxRole().setAriaInvalidState(element, | |||
InvalidValue.TRUE); | |||
@@ -155,7 +157,7 @@ public class AriaHelper { | |||
* Element to check | |||
* @return String with the id of the element | |||
*/ | |||
public static String ensureHasId(Element element) { | |||
public static String ensureHasId(com.google.gwt.user.client.Element element) { | |||
assert element != null : "Valid Element required"; | |||
String id = element.getId(); | |||
@@ -177,8 +179,8 @@ public class AriaHelper { | |||
* @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(Element element, | |||
boolean assistiveOnly) { | |||
public static void setVisibleForAssistiveDevicesOnly( | |||
com.google.gwt.user.client.Element element, boolean assistiveOnly) { | |||
if (assistiveOnly) { | |||
element.addClassName(ASSISTIVE_DEVICE_ONLY_STYLE); | |||
} else { |
@@ -16,8 +16,6 @@ | |||
package com.vaadin.client.ui.aria; | |||
import com.google.gwt.user.client.Element; | |||
/** | |||
* Some Widgets need to handle the caption handling for WAI-ARIA themselfs, as | |||
* for example the required ids need to be set in a specific way. In such a | |||
@@ -35,5 +33,5 @@ public interface HandlesAriaCaption { | |||
* @param captionElement | |||
* Element of the caption | |||
*/ | |||
void bindAriaCaption(Element captionElement); | |||
void bindAriaCaption(com.google.gwt.user.client.Element captionElement); | |||
} |
@@ -28,7 +28,6 @@ import com.google.gwt.dom.client.NativeEvent; | |||
import com.google.gwt.event.dom.client.ContextMenuEvent; | |||
import com.google.gwt.i18n.client.DateTimeFormat; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
@@ -286,7 +285,8 @@ public class CalendarConnector extends AbstractComponentConnector implements | |||
*/ | |||
DateCell cell = (DateCell) widget; | |||
int slotIndex = DOM.getChildIndex( | |||
cell.getElement(), (Element) ne | |||
cell.getElement(), | |||
(com.google.gwt.user.client.Element) ne | |||
.getEventTarget().cast()); | |||
DateCellSlot slot = cell.getSlot(slotIndex); | |||
return CalendarConnector.this.getActionsBetween( | |||
@@ -420,7 +420,8 @@ public class CalendarConnector extends AbstractComponentConnector implements | |||
@Override | |||
public TooltipInfo getTooltipInfo(com.google.gwt.dom.client.Element element) { | |||
TooltipInfo tooltipInfo = null; | |||
Widget w = Util.findWidget((Element) element, null); | |||
Widget w = Util.findWidget( | |||
(com.google.gwt.user.client.Element) element, null); | |||
if (w instanceof HasTooltipKey) { | |||
tooltipInfo = GWT.create(TooltipInfo.class); | |||
String title = tooltips.get(((HasTooltipKey) w).getTooltipKey()); |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.client.ui.calendar.schedule.dd; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.ui.calendar.CalendarConnector; | |||
import com.vaadin.client.ui.calendar.schedule.SimpleDayCell; | |||
@@ -37,7 +36,7 @@ public class CalendarMonthDropHandler extends CalendarDropHandler { | |||
super(connector); | |||
} | |||
private Element currentTargetElement; | |||
private com.google.gwt.user.client.Element currentTargetElement; | |||
private SimpleDayCell currentTargetDay; | |||
/* |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.client.ui.calendar.schedule.dd; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.client.ui.calendar.CalendarConnector; | |||
import com.vaadin.client.ui.calendar.schedule.DateCell; | |||
@@ -109,8 +108,9 @@ public class CalendarWeekDropHandler extends CalendarDropHandler { | |||
com.google.gwt.user.client.Element todayBarElement = null; | |||
if (calendarConnector.getWidget().getWeekGrid().hasToday()) { | |||
todayBarElement = (Element) calendarConnector.getWidget() | |||
.getWeekGrid().getDateCellOfToday().getTodaybarElement(); | |||
todayBarElement = (com.google.gwt.user.client.Element) calendarConnector | |||
.getWidget().getWeekGrid().getDateCellOfToday() | |||
.getTodaybarElement(); | |||
} | |||
// drops are not allowed in: |
@@ -22,7 +22,6 @@ import com.google.gwt.event.dom.client.MouseMoveEvent; | |||
import com.google.gwt.event.dom.client.MouseMoveHandler; | |||
import com.google.gwt.event.dom.client.MouseUpEvent; | |||
import com.google.gwt.event.dom.client.MouseUpHandler; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.AbsolutePanel; | |||
import com.google.gwt.user.client.ui.FocusPanel; | |||
import com.google.gwt.user.client.ui.HTML; | |||
@@ -191,7 +190,7 @@ public class VColorPickerGradient extends FocusPanel implements | |||
} | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
public com.google.gwt.user.client.Element getSubPartElement(String subPart) { | |||
if (subPart.equals(CLICKLAYER_ID)) { | |||
return clicklayer.getElement(); | |||
} | |||
@@ -200,7 +199,7 @@ public class VColorPickerGradient extends FocusPanel implements | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
public String getSubPartName(com.google.gwt.user.client.Element subElement) { | |||
if (clicklayer.getElement().isOrHasChild(subElement)) { | |||
return CLICKLAYER_ID; | |||
} |
@@ -19,7 +19,6 @@ import com.google.gwt.event.dom.client.ClickEvent; | |||
import com.google.gwt.event.dom.client.ClickHandler; | |||
import com.google.gwt.event.dom.client.HasClickHandlers; | |||
import com.google.gwt.event.shared.HandlerRegistration; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.AbsolutePanel; | |||
import com.google.gwt.user.client.ui.Grid; | |||
import com.google.gwt.user.client.ui.HTMLTable.Cell; | |||
@@ -94,9 +93,10 @@ public class VColorPickerGrid extends AbsolutePanel implements ClickHandler, | |||
if (changedColor.length == changedX.length | |||
&& changedX.length == changedY.length) { | |||
for (int c = 0; c < changedColor.length; c++) { | |||
Element element = grid.getCellFormatter().getElement( | |||
Integer.parseInt(changedX[c]), | |||
Integer.parseInt(changedY[c])); | |||
com.google.gwt.user.client.Element element = grid | |||
.getCellFormatter().getElement( | |||
Integer.parseInt(changedX[c]), | |||
Integer.parseInt(changedY[c])); | |||
element.getStyle().setProperty("background", | |||
changedColor[c]); | |||
} |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.client.ui.csslayout; | |||
import com.google.gwt.dom.client.Style; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.ComponentConnector; | |||
@@ -46,7 +45,8 @@ public class CssLayoutConnector extends AbstractLayoutConnector { | |||
this) { | |||
@Override | |||
protected ComponentConnector getChildComponent(Element element) { | |||
protected ComponentConnector getChildComponent( | |||
com.google.gwt.user.client.Element element) { | |||
return Util.getConnectorForElement(getConnection(), getWidget(), | |||
element); | |||
} |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.client.ui.dd; | |||
import com.google.gwt.dom.client.NativeEvent; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Window; | |||
import com.vaadin.client.Util; | |||
import com.vaadin.shared.ui.dd.HorizontalDropLocation; | |||
@@ -24,22 +23,25 @@ import com.vaadin.shared.ui.dd.VerticalDropLocation; | |||
public class DDUtil { | |||
public static VerticalDropLocation getVerticalDropLocation(Element element, | |||
NativeEvent event, double topBottomRatio) { | |||
public static VerticalDropLocation getVerticalDropLocation( | |||
com.google.gwt.user.client.Element element, NativeEvent event, | |||
double topBottomRatio) { | |||
int offsetHeight = element.getOffsetHeight(); | |||
return getVerticalDropLocation(element, offsetHeight, event, | |||
topBottomRatio); | |||
} | |||
public static VerticalDropLocation getVerticalDropLocation(Element element, | |||
int offsetHeight, NativeEvent event, double topBottomRatio) { | |||
public static VerticalDropLocation getVerticalDropLocation( | |||
com.google.gwt.user.client.Element element, int offsetHeight, | |||
NativeEvent event, double topBottomRatio) { | |||
int clientY = Util.getTouchOrMouseClientY(event); | |||
return getVerticalDropLocation(element, offsetHeight, clientY, | |||
topBottomRatio); | |||
} | |||
public static VerticalDropLocation getVerticalDropLocation(Element element, | |||
int offsetHeight, int clientY, double topBottomRatio) { | |||
public static VerticalDropLocation getVerticalDropLocation( | |||
com.google.gwt.user.client.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 | |||
@@ -58,7 +60,8 @@ public class DDUtil { | |||
} | |||
public static HorizontalDropLocation getHorizontalDropLocation( | |||
Element element, NativeEvent event, double leftRightRatio) { | |||
com.google.gwt.user.client.Element element, NativeEvent event, | |||
double leftRightRatio) { | |||
int clientX = Util.getTouchOrMouseClientX(event); | |||
// Event coordinates are relative to the viewport, element absolute |
@@ -24,7 +24,6 @@ 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.Element; | |||
import com.vaadin.client.BrowserInfo; | |||
import com.vaadin.client.Util; | |||
@@ -50,7 +49,7 @@ public class VDragEvent { | |||
private HashMap<String, Object> dropDetails = new HashMap<String, Object>(); | |||
private Element elementOver; | |||
private com.google.gwt.user.client.Element elementOver; | |||
VDragEvent(VTransferable t, NativeEvent startEvent) { | |||
transferable = t; | |||
@@ -94,7 +93,7 @@ public class VDragEvent { | |||
* | |||
* @return the element in {@link VDropHandler} on which mouse cursor is on | |||
*/ | |||
public Element getElementOver() { | |||
public com.google.gwt.user.client.Element getElementOver() { | |||
if (elementOver != null) { | |||
return elementOver; | |||
} else if (currentGwtEvent != null) { | |||
@@ -103,7 +102,7 @@ public class VDragEvent { | |||
return null; | |||
} | |||
public void setElementOver(Element targetElement) { | |||
public void setElementOver(com.google.gwt.user.client.Element targetElement) { | |||
elementOver = targetElement; | |||
} | |||
@@ -122,7 +121,7 @@ public class VDragEvent { | |||
* | |||
* @param node | |||
*/ | |||
public void setDragImage(Element node) { | |||
public void setDragImage(com.google.gwt.user.client.Element node) { | |||
setDragImage(node, DEFAULT_OFFSET, DEFAULT_OFFSET); | |||
} | |||
@@ -151,7 +150,8 @@ public class VDragEvent { | |||
* @param offsetY | |||
* the vertical offset of drag image from mouse cursor | |||
*/ | |||
public void setDragImage(Element element, int offsetX, int offsetY) { | |||
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); | |||
@@ -161,8 +161,9 @@ public class VDragEvent { | |||
* @return the current Element used as a drag image (aka drag proxy) or null | |||
* if drag image is not currently set for this drag operation. | |||
*/ | |||
public Element getDragImage() { | |||
return (Element) VDragAndDropManager.get().getDragElement(); | |||
public com.google.gwt.user.client.Element getDragImage() { | |||
return (com.google.gwt.user.client.Element) VDragAndDropManager.get() | |||
.getDragElement(); | |||
} | |||
/** | |||
@@ -173,8 +174,10 @@ public class VDragEvent { | |||
* if true, proxy image is aligned to start event, else next to | |||
* mouse cursor | |||
*/ | |||
public void createDragImage(Element element, boolean alignImageToEvent) { | |||
Element cloneNode = (Element) element.cloneNode(true); | |||
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); | |||
if (BrowserInfo.get().isIE()) { | |||
if (cloneNode.getTagName().toLowerCase().equals("tr")) { | |||
TableElement table = Document.get().createTableElement(); |
@@ -25,7 +25,6 @@ import com.google.gwt.dom.client.NodeList; | |||
import com.google.gwt.dom.client.ObjectElement; | |||
import com.google.gwt.dom.client.Style; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.Paintable; | |||
@@ -78,13 +77,13 @@ public class EmbeddedConnector extends AbstractComponentConnector implements | |||
getWidget().type = uidl.getStringAttribute("type"); | |||
if (getWidget().type.equals("image")) { | |||
getWidget().addStyleName(VEmbedded.CLASSNAME + "-image"); | |||
Element el = null; | |||
com.google.gwt.user.client.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) { | |||
Element e = (Element) n; | |||
com.google.gwt.user.client.Element e = (com.google.gwt.user.client.Element) n; | |||
if (e.getTagName().equals("IMG")) { | |||
el = e; | |||
} |
@@ -17,7 +17,6 @@ package com.vaadin.client.ui.gridlayout; | |||
import java.util.Map.Entry; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.ComponentConnector; | |||
@@ -49,7 +48,8 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector | |||
this) { | |||
@Override | |||
protected ComponentConnector getChildComponent(Element element) { | |||
protected ComponentConnector getChildComponent( | |||
com.google.gwt.user.client.Element element) { | |||
return getWidget().getComponent(element); | |||
} | |||
@@ -20,14 +20,14 @@ 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.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.VCaption; | |||
import com.vaadin.shared.ui.AlignmentInfo; | |||
public abstract class VLayoutSlot { | |||
private final Element wrapper = Document.get().createDivElement().cast(); | |||
private final com.google.gwt.user.client.Element wrapper = Document.get() | |||
.createDivElement().cast(); | |||
private AlignmentInfo alignment; | |||
private VCaption caption; | |||
@@ -288,7 +288,7 @@ public abstract class VLayoutSlot { | |||
return isVertical ? isRelativeHeight() : isRelativeWidth(); | |||
} | |||
public Element getWrapperElement() { | |||
public com.google.gwt.user.client.Element getWrapperElement() { | |||
return wrapper; | |||
} | |||
@@ -39,7 +39,6 @@ import java.util.List; | |||
import com.google.gwt.core.client.Scheduler; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.PopupListener; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
@@ -73,7 +72,7 @@ import com.vaadin.client.ui.VOverlay; | |||
@Deprecated | |||
public class MenuBar extends Widget implements PopupListener { | |||
private final Element body; | |||
private final com.google.gwt.user.client.Element body; | |||
private final ArrayList<MenuItem> items = new ArrayList<MenuItem>(); | |||
private MenuBar parentMenu; | |||
private PopupPanel popup; | |||
@@ -98,18 +97,18 @@ public class MenuBar extends Widget implements PopupListener { | |||
public MenuBar(boolean vertical) { | |||
super(); | |||
final Element table = DOM.createTable(); | |||
final com.google.gwt.user.client.Element table = DOM.createTable(); | |||
body = DOM.createTBody(); | |||
DOM.appendChild(table, body); | |||
if (!vertical) { | |||
final Element tr = DOM.createTR(); | |||
final com.google.gwt.user.client.Element tr = DOM.createTR(); | |||
DOM.appendChild(body, tr); | |||
} | |||
this.vertical = vertical; | |||
final Element outer = DOM.createDiv(); | |||
final com.google.gwt.user.client.Element outer = DOM.createDiv(); | |||
DOM.appendChild(outer, table); | |||
setElement(outer); | |||
@@ -124,7 +123,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* the item to be added | |||
*/ | |||
public void addItem(MenuItem item) { | |||
Element tr; | |||
com.google.gwt.user.client.Element tr; | |||
if (vertical) { | |||
tr = DOM.createTR(); | |||
DOM.appendChild(body, tr); | |||
@@ -211,7 +210,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* Removes all menu items from this menu bar. | |||
*/ | |||
public void clearItems() { | |||
final Element container = getItemContainerElement(); | |||
final com.google.gwt.user.client.Element container = getItemContainerElement(); | |||
while (DOM.getChildCount(container) > 0) { | |||
DOM.removeChild(container, DOM.getChild(container, 0)); | |||
} | |||
@@ -284,7 +283,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
return; | |||
} | |||
final Element container = getItemContainerElement(); | |||
final com.google.gwt.user.client.Element container = getItemContainerElement(); | |||
DOM.removeChild(container, DOM.getChild(container, idx)); | |||
items.remove(idx); | |||
} | |||
@@ -411,9 +410,10 @@ public class MenuBar extends Widget implements PopupListener { | |||
// If the event target is part of the parent menu, suppress | |||
// the | |||
// event altogether. | |||
final Element target = DOM.eventGetTarget(event); | |||
final Element parentMenuElement = item.getParentMenu() | |||
.getElement(); | |||
final com.google.gwt.user.client.Element target = DOM | |||
.eventGetTarget(event); | |||
final com.google.gwt.user.client.Element parentMenuElement = item | |||
.getParentMenu().getElement(); | |||
if (DOM.isOrHasChild(parentMenuElement, target)) { | |||
return false; | |||
} | |||
@@ -491,7 +491,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
} | |||
} | |||
private MenuItem findItem(Element hItem) { | |||
private MenuItem findItem(com.google.gwt.user.client.Element hItem) { | |||
for (int i = 0; i < items.size(); ++i) { | |||
final MenuItem item = items.get(i); | |||
if (DOM.isOrHasChild(item.getElement(), hItem)) { | |||
@@ -502,7 +502,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
return null; | |||
} | |||
private Element getItemContainerElement() { | |||
private com.google.gwt.user.client.Element getItemContainerElement() { | |||
if (vertical) { | |||
return body; | |||
} else { |
@@ -18,7 +18,6 @@ package com.vaadin.client.ui.orderedlayout; | |||
import java.util.List; | |||
import com.google.gwt.dom.client.Style.Unit; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ApplicationConnection; | |||
import com.vaadin.client.ComponentConnector; | |||
@@ -60,7 +59,8 @@ public abstract class AbstractOrderedLayoutConnector extends | |||
this) { | |||
@Override | |||
protected ComponentConnector getChildComponent(Element element) { | |||
protected ComponentConnector getChildComponent( | |||
com.google.gwt.user.client.Element element) { | |||
return Util.getConnectorForElement(getConnection(), getWidget(), | |||
element); | |||
} | |||
@@ -98,16 +98,18 @@ public abstract class AbstractOrderedLayoutConnector extends | |||
public void onElementResize(ElementResizeEvent e) { | |||
// Get all needed element references | |||
Element captionElement = (Element) e.getElement().cast(); | |||
com.google.gwt.user.client.Element captionElement = (com.google.gwt.user.client.Element) e | |||
.getElement().cast(); | |||
// Caption position determines if the widget element is the first or | |||
// last child inside the caption wrap | |||
CaptionPosition pos = getWidget().getCaptionPositionFromElement( | |||
(Element) captionElement.getParentElement().cast()); | |||
(com.google.gwt.user.client.Element) captionElement | |||
.getParentElement().cast()); | |||
// The default is the last child | |||
Element widgetElement = captionElement.getParentElement() | |||
.getLastChild().cast(); | |||
com.google.gwt.user.client.Element widgetElement = captionElement | |||
.getParentElement().getLastChild().cast(); | |||
// ...but if caption position is bottom or right, the widget is the | |||
// first child | |||
@@ -614,7 +616,8 @@ public abstract class AbstractOrderedLayoutConnector extends | |||
for (ComponentConnector child : getChildComponents()) { | |||
Widget childWidget = child.getWidget(); | |||
Slot slot = getWidget().getSlot(childWidget); | |||
Element captionElement = slot.getCaptionElement(); | |||
com.google.gwt.user.client.Element captionElement = slot | |||
.getCaptionElement(); | |||
CaptionPosition captionPosition = slot.getCaptionPosition(); | |||
int pixelHeight = layoutManager.getOuterHeight(childWidget |
@@ -22,7 +22,6 @@ 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.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
@@ -49,13 +48,13 @@ public final class Slot extends SimplePanel { | |||
public static final String SLOT_CLASSNAME = "v-slot"; | |||
private Element spacer; | |||
private Element captionWrap; | |||
private Element caption; | |||
private Element captionText; | |||
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 Icon icon; | |||
private Element errorIcon; | |||
private Element requiredIcon; | |||
private com.google.gwt.user.client.Element errorIcon; | |||
private com.google.gwt.user.client.Element requiredIcon; | |||
private ElementResizeListener captionResizeListener; | |||
@@ -72,7 +71,7 @@ public final class Slot extends SimplePanel { | |||
@Override | |||
public void onElementResize(ElementResizeEvent e) { | |||
Element caption = getCaptionElement(); | |||
com.google.gwt.user.client.Element caption = getCaptionElement(); | |||
if (caption != null) { | |||
Util.forceIE8Redraw(caption); | |||
} | |||
@@ -332,7 +331,7 @@ public final class Slot extends SimplePanel { | |||
* | |||
* @return | |||
*/ | |||
public Element getSpacingElement() { | |||
public com.google.gwt.user.client.Element getSpacingElement() { | |||
return spacer; | |||
} | |||
@@ -465,7 +464,8 @@ public final class Slot extends SimplePanel { | |||
// Caption wrappers | |||
Widget widget = getWidget(); | |||
final Element focusedElement = Util.getFocusedElement(); | |||
final com.google.gwt.user.client.Element focusedElement = Util | |||
.getFocusedElement(); | |||
// By default focus will not be lost | |||
boolean focusLost = false; | |||
if (captionText != null || icon != null || error != null || required) { | |||
@@ -581,7 +581,8 @@ public final class Slot extends SimplePanel { | |||
if (focusLost) { | |||
// Find out what element is currently focused. | |||
Element currentFocus = Util.getFocusedElement(); | |||
com.google.gwt.user.client.Element currentFocus = Util | |||
.getFocusedElement(); | |||
if (currentFocus != null | |||
&& currentFocus.equals(Document.get().getBody())) { | |||
// Focus has moved to BodyElement and should be moved back to | |||
@@ -629,7 +630,7 @@ public final class Slot extends SimplePanel { | |||
/** | |||
* Get the slots caption element | |||
*/ | |||
public Element getCaptionElement() { | |||
public com.google.gwt.user.client.Element getCaptionElement() { | |||
return caption; | |||
} | |||
@@ -725,7 +726,7 @@ public final class Slot extends SimplePanel { | |||
* @see com.google.gwt.user.client.ui.SimplePanel#getContainerElement() | |||
*/ | |||
@Override | |||
protected Element getContainerElement() { | |||
protected com.google.gwt.user.client.Element getContainerElement() { | |||
if (captionWrap == null) { | |||
return getElement(); | |||
} else { |
@@ -25,7 +25,6 @@ import com.google.gwt.dom.client.Style.Visibility; | |||
import com.google.gwt.regexp.shared.MatchResult; | |||
import com.google.gwt.regexp.shared.RegExp; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.RequiresResize; | |||
import com.google.gwt.user.client.ui.Widget; | |||
@@ -49,7 +48,7 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
private Map<Widget, Slot> widgetToSlot = new HashMap<Widget, Slot>(); | |||
private Element expandWrapper; | |||
private com.google.gwt.user.client.Element expandWrapper; | |||
private LayoutManager layoutManager; | |||
@@ -143,7 +142,8 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
* {@inheritDoc} | |||
*/ | |||
@Override | |||
protected void insert(Widget child, Element container, int beforeIndex, | |||
protected void insert(Widget child, | |||
com.google.gwt.user.client.Element container, int beforeIndex, | |||
boolean domInsert) { | |||
// Validate index; adjust if the widget is already a child of this | |||
// panel. | |||
@@ -221,7 +221,7 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
* The element of the widget ( Same as getWidget().getElement() ) | |||
* @return | |||
*/ | |||
public Slot getSlot(Element widgetElement) { | |||
public Slot getSlot(com.google.gwt.user.client.Element widgetElement) { | |||
for (Map.Entry<Widget, Slot> entry : widgetToSlot.entrySet()) { | |||
if (entry.getKey().getElement() == widgetElement) { | |||
return entry.getValue(); | |||
@@ -258,7 +258,8 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
* | |||
* @return The caption position | |||
*/ | |||
public CaptionPosition getCaptionPositionFromElement(Element captionWrap) { | |||
public CaptionPosition getCaptionPositionFromElement( | |||
com.google.gwt.user.client.Element captionWrap) { | |||
RegExp captionPositionRegexp = RegExp.compile("v-caption-on-(\\S+)"); | |||
// Get caption position from the classname | |||
@@ -281,9 +282,10 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
* @param caption | |||
* The caption element | |||
*/ | |||
public void updateCaptionOffset(Element caption) { | |||
public void updateCaptionOffset(com.google.gwt.user.client.Element caption) { | |||
Element captionWrap = caption.getParentElement().cast(); | |||
com.google.gwt.user.client.Element captionWrap = caption | |||
.getParentElement().cast(); | |||
Style captionWrapStyle = captionWrap.getStyle(); | |||
captionWrapStyle.clearPaddingTop(); | |||
@@ -413,7 +415,7 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
// Give each expanded child its own share | |||
for (Slot slot : widgetToSlot.values()) { | |||
Element slotElement = slot.getElement(); | |||
com.google.gwt.user.client.Element slotElement = slot.getElement(); | |||
slotElement.removeAttribute("aria-hidden"); | |||
Style slotStyle = slotElement.getStyle(); | |||
@@ -481,7 +483,8 @@ public class VAbstractOrderedLayout extends FlowPanel { | |||
lastExpandSize = -1; | |||
while (expandWrapper.getChildCount() > 0) { | |||
Element el = expandWrapper.getChild(0).cast(); | |||
com.google.gwt.user.client.Element el = expandWrapper.getChild( | |||
0).cast(); | |||
getElement().appendChild(el); | |||
if (vertical) { | |||
el.getStyle().clearHeight(); |
@@ -23,7 +23,6 @@ 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.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.vaadin.client.ComponentConnector; | |||
@@ -97,7 +96,8 @@ public abstract class AbstractSplitPanelConnector extends | |||
@Override | |||
protected boolean shouldFireEvent(DomEvent<?> event) { | |||
Element target = event.getNativeEvent().getEventTarget().cast(); | |||
com.google.gwt.user.client.Element target = event.getNativeEvent() | |||
.getEventTarget().cast(); | |||
if (!getWidget().splitter.isOrHasChild(target)) { | |||
return false; | |||
} | |||
@@ -106,7 +106,7 @@ public abstract class AbstractSplitPanelConnector extends | |||
} | |||
@Override | |||
protected Element getRelativeToElement() { | |||
protected com.google.gwt.user.client.Element getRelativeToElement() { | |||
return getWidget().splitter; | |||
} | |||
@@ -35,7 +35,6 @@ import com.google.gwt.event.logical.shared.ResizeHandler; | |||
import com.google.gwt.http.client.URL; | |||
import com.google.gwt.user.client.Command; | |||
import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.History; | |||
import com.google.gwt.user.client.Timer; | |||
@@ -170,7 +169,8 @@ public class UIConnector extends AbstractSingleComponentContainerConnector | |||
@Override | |||
public void onScroll(ScrollEvent event) { | |||
Element element = getWidget().getElement(); | |||
com.google.gwt.user.client.Element element = getWidget() | |||
.getElement(); | |||
int newScrollTop = element.getScrollTop(); | |||
int newScrollLeft = element.getScrollLeft(); | |||
if (newScrollTop != lastSentScrollTop |
@@ -16,7 +16,6 @@ | |||
package com.vaadin.tests.minitutorials.v7a2; | |||
import com.google.gwt.user.client.Element; | |||
import com.vaadin.client.ui.AbstractComponentConnector; | |||
import com.vaadin.client.ui.SimpleManagedLayout; | |||
import com.vaadin.client.ui.layout.ElementResizeEvent; | |||
@@ -50,7 +49,8 @@ public class MyPickerConnector extends AbstractComponentConnector implements | |||
@Override | |||
protected void init() { | |||
Element button = getWidget().getWidget(1).getElement(); | |||
com.google.gwt.user.client.Element button = getWidget().getWidget(1) | |||
.getElement(); | |||
getLayoutManager().addElementResizeListener(button, listener); | |||
getLayoutManager().registerDependency(this, button); | |||
@@ -58,7 +58,8 @@ public class MyPickerConnector extends AbstractComponentConnector implements | |||
@Override | |||
public void onUnregister() { | |||
Element button = getWidget().getWidget(1).getElement(); | |||
com.google.gwt.user.client.Element button = getWidget().getWidget(1) | |||
.getElement(); | |||
getLayoutManager().removeElementResizeListener(button, listener); | |||
getLayoutManager().unregisterDependency(this, button); | |||
@@ -66,7 +67,8 @@ public class MyPickerConnector extends AbstractComponentConnector implements | |||
@Override | |||
public void layout() { | |||
Element button = getWidget().getWidget(1).getElement(); | |||
com.google.gwt.user.client.Element button = getWidget().getWidget(1) | |||
.getElement(); | |||
int buttonWidth = getLayoutManager().getOuterWidth(button); | |||
buttonWidth -= getLayoutManager().getMarginRight(button); | |||
getWidget().adjustButtonSpace(buttonWidth); |