Search in sources :

Example 76 with Element

use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.

the class CubaFieldGroupLayoutComponentSlot method onBrowserEvent.

@Override
public void onBrowserEvent(Event event) {
    if (DOM.eventGetType(event) == Event.ONCLICK) {
        Element target = Element.as(event.getEventTarget());
        ComponentConnector componentConnector = Util.findConnectorFor(getWidget());
        if (target == contextHelpIndicatorElement && componentConnector instanceof HasContextHelpConnector) {
            HasContextHelpConnector connector = (HasContextHelpConnector) componentConnector;
            if (hasContextHelpIconListeners(componentConnector.getState())) {
                connector.contextHelpIconClick(event);
            }
        }
    }
}
Also used : HasContextHelpConnector(com.vaadin.client.ui.HasContextHelpConnector) ComponentConnector(com.vaadin.client.ComponentConnector) Element(com.google.gwt.dom.client.Element)

Example 77 with Element

use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.

the class CubaFieldGroupLayoutComponentSlot method createRightCaption.

protected Element createRightCaption() {
    Element rightCaption = DOM.createDiv();
    getLayoutManager().registerDependency((ManagedLayout) getChild().getParent(), rightCaption);
    rightCaption.setClassName(VCaption.CLASSNAME);
    rightCaption.addClassName(INDICATORS_CLASSNAME);
    rightCaption.getStyle().setDisplay(Style.Display.INLINE_BLOCK);
    rightCaption.getStyle().setPosition(Style.Position.ABSOLUTE);
    return rightCaption;
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 78 with Element

use of com.google.gwt.dom.client.Element in project cuba by cuba-platform.

the class CubaFileUploadProgressWindow method fixIE8FocusCaptureIssue.

private void fixIE8FocusCaptureIssue() {
    Element e = DOM.createInputText();
    Style elemStyle = e.getStyle();
    elemStyle.setPosition(Style.Position.ABSOLUTE);
    elemStyle.setTop(-10, Style.Unit.PX);
    elemStyle.setWidth(0, Style.Unit.PX);
    elemStyle.setHeight(0, Style.Unit.PX);
    contentPanel.getElement().appendChild(e);
    e.focus();
    contentPanel.getElement().removeChild(e);
}
Also used : Element(com.google.gwt.dom.client.Element) ComputedStyle(com.vaadin.client.ComputedStyle) Style(com.google.gwt.dom.client.Style)

Example 79 with Element

use of com.google.gwt.dom.client.Element in project openremote by openremote.

the class AssetBrowserImpl method showAndSelectNode.

@Override
public void showAndSelectNode(String[] path, BrowserTreeNode treeNode, boolean scrollIntoView) {
    List<BrowserTreeNode> selectedPath = new AssetTree.AssetIdSearch().resolvePath(Arrays.asList(path), assetTree.getRootTreeNode());
    if (selectedPath.size() > 0) {
        BrowserTreeNode selectedNode = selectedPath.get(selectedPath.size() - 1);
        assetTree.getTreeViewModel().getSelectionModel().setSelected(selectedNode, true);
        if (!scrollIntoView)
            return;
        // We place the selected asset in the middle of the tree container
        elemental.dom.Element treeElement = (elemental.dom.Element) assetTree.getElement();
        elemental.dom.Element assetElement = treeElement.querySelector(AssetTreeCell.CELL_ID_SELECTOR(treeNode));
        int offsetTop = 0;
        if (assetElement != null && assetElement.getOffsetParent() != null) {
            elemental.dom.Element el = assetElement.getOffsetParent();
            do {
                offsetTop += el.getOffsetTop();
            } while ((el = el.getOffsetParent()) != null);
            Element treeContainerElement = assetTreeContainer.getElement();
            treeContainerElement.setAttribute("tabindex", "1");
            int middleOffset = offsetTop - treeContainerElement.getClientHeight() / 2 - treeContainerElement.getOffsetTop();
            treeContainerElement.setScrollTop(middleOffset);
        }
    }
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 80 with Element

use of com.google.gwt.dom.client.Element in project opennms by OpenNMS.

the class MapQuestMapPanel method initializeMap.

/**
 * <p>initializeMap</p>
 */
private void initializeMap() {
    m_map = MQATileMap.newInstance(m_mapHolder.getElement());
    m_map.addControl(MQALargeZoomControl.newInstance());
    m_map.setZoomLevel(1);
    m_map.setCenter(MQALatLng.newInstance("0,0"));
    m_map.addMoveEndHandler(new MoveEndHandler() {

        @Override
        public void onMoveEnd(final MoveEndEvent event) {
            m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
        }
    });
    m_map.addClickHandler(new com.googlecode.gwtmapquest.transaction.event.ClickHandler() {

        @Override
        public void onClicked(final com.googlecode.gwtmapquest.transaction.event.ClickEvent event) {
            m_clickCounter.incrementCounter(event.getLL());
        }
    });
    m_map.addDblClickHandler(new DblClickHandler() {

        @Override
        public void onDblClicked(DblClickEvent event) {
            m_clickCounter.incrementCounter(event.getLL());
        }
    });
    m_map.addZoomEndHandler(new ZoomEndHandler() {

        @Override
        public void onZoomEnd(ZoomEndEvent event) {
            m_eventBus.fireEvent(new MapPanelBoundsChangedEvent(getBounds()));
        }
    });
    m_map.addShapeAddedHandler(new ShapeAddedHandler() {

        @Override
        public void onShapeAdded(ShapeAddedEvent event) {
            Element mqPoiDiv = DOM.getElementById("mqpoidiv");
            Element markerElement = Element.as(mqPoiDiv.getLastChild());
            updatePOILayer(markerElement);
        }
    });
    Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            syncMapSizeWithParent();
        }
    });
}
Also used : DblClickEvent(com.googlecode.gwtmapquest.transaction.event.DblClickEvent) MapPanelBoundsChangedEvent(org.opennms.features.poller.remote.gwt.client.events.MapPanelBoundsChangedEvent) ShapeAddedHandler(com.googlecode.gwtmapquest.transaction.event.ShapeAddedHandler) Element(com.google.gwt.dom.client.Element) MoveEndEvent(com.googlecode.gwtmapquest.transaction.event.MoveEndEvent) ZoomEndEvent(com.googlecode.gwtmapquest.transaction.event.ZoomEndEvent) MoveEndHandler(com.googlecode.gwtmapquest.transaction.event.MoveEndHandler) ResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent) ShapeAddedEvent(com.googlecode.gwtmapquest.transaction.event.ShapeAddedEvent) DblClickHandler(com.googlecode.gwtmapquest.transaction.event.DblClickHandler) ResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler) ZoomEndHandler(com.googlecode.gwtmapquest.transaction.event.ZoomEndHandler)

Aggregations

Element (com.google.gwt.dom.client.Element)340 DivElement (com.google.gwt.dom.client.DivElement)19 TableRowElement (com.google.gwt.dom.client.TableRowElement)19 NativeEvent (com.google.gwt.dom.client.NativeEvent)16 Test (org.junit.Test)14 EventTarget (com.google.gwt.dom.client.EventTarget)11 SVGSVGElement (elemental.svg.SVGSVGElement)11 InputElement (com.google.gwt.dom.client.InputElement)10 Node (com.google.gwt.dom.client.Node)9 TableCellElement (com.google.gwt.dom.client.TableCellElement)9 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)8 AnchorElement (com.google.gwt.dom.client.AnchorElement)8 ImageElement (com.google.gwt.dom.client.ImageElement)8 LabelElement (com.google.gwt.dom.client.LabelElement)8 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)8 Image (com.google.gwt.user.client.ui.Image)8 SpanElement (com.google.gwt.dom.client.SpanElement)7 Style (com.google.gwt.dom.client.Style)7 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)7 Widget (com.google.gwt.user.client.ui.Widget)7