Search in sources :

Example 86 with Element

use of com.google.gwt.dom.client.Element in project drools-wb by kiegroup.

the class RadarMenuViewImpl method setup.

@PostConstruct
public void setup() {
    radarCanvas.add(radarLayer);
    radarMenuDropdown.setTitle(translationService.getTranslation(GuidedDecisionTableErraiConstants.RowContextMenuViewImpl_Title));
    visibleBounds.setDraggable(true);
    visibleBounds.addNodeDragMoveHandler(new NodeDragMoveHandler() {

        @Override
        public void onNodeDragMove(final NodeDragMoveEvent event) {
            presenter.onDragVisibleBounds(visibleBounds.getX(), visibleBounds.getY());
        }
    });
    visibleBounds.setFillColor(ColorName.GRAY);
    visibleBounds.setAlpha(0.25);
    visibleBounds.setLocation(new Point2D((RADAR_WIDTH - visibleBounds.getWidth()) / 2, (RADAR_HEIGHT - visibleBounds.getHeight()) / 2));
    radarLayer.add(visibleBounds);
    radarCanvas.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (eventTargetsPopup(event.getNativeEvent(), radarMenu)) {
                event.stopPropagation();
                event.preventDefault();
            }
        }

        private boolean eventTargetsPopup(final NativeEvent event, final Element element) {
            final EventTarget target = event.getEventTarget();
            if (Element.is(target)) {
                return element.isOrHasChild(Element.as(target));
            }
            return false;
        }
    });
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Point2D(com.ait.lienzo.client.core.types.Point2D) NodeDragMoveHandler(com.ait.lienzo.client.core.event.NodeDragMoveHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ButtonElement(com.google.gwt.dom.client.ButtonElement) LIElement(com.google.gwt.dom.client.LIElement) Element(com.google.gwt.dom.client.Element) NodeDragMoveEvent(com.ait.lienzo.client.core.event.NodeDragMoveEvent) EventTarget(com.google.gwt.dom.client.EventTarget) NativeEvent(com.google.gwt.dom.client.NativeEvent) PostConstruct(javax.annotation.PostConstruct)

Example 87 with Element

use of com.google.gwt.dom.client.Element in project kie-wb-common by kiegroup.

the class ShowcaseEntryPoint method hideLoadingPopup.

// Fade out the "Loading application" pop-up
private void hideLoadingPopup() {
    final Element e = RootPanel.get("loading").getElement();
    new Animation() {

        @Override
        protected void onUpdate(double progress) {
            e.getStyle().setOpacity(1.0 - progress);
        }

        @Override
        protected void onComplete() {
            e.getStyle().setVisibility(Style.Visibility.HIDDEN);
        }
    }.run(500);
}
Also used : Element(com.google.gwt.dom.client.Element) Animation(com.google.gwt.animation.client.Animation)

Example 88 with Element

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

the class CubaLinkWidget method setRel.

public void setRel(String rel) {
    Element element = getElement().getFirstChildElement();
    element.setAttribute("rel", rel);
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 89 with Element

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

the class EnterKeyDownHandler method onKeyDown.

@Override
public void onKeyDown(GridKeyDownEvent event) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        if (isCellContainingComponent(event.getFocusedCell())) {
            // if the ENTER key-event's propagation is not stopped it would
            // be propagated to the newly focused component, which e.g. in the
            // case of a button leads to an immediate button press
            event.preventDefault();
            event.stopPropagation();
            Element componentElement = extractComponentElement(event.getFocusedCell());
            WidgetUtil.focus(componentElement);
            focusInputField(componentElement);
        }
    }
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 90 with Element

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

the class CubaSourceCodeEditorWidget method setEnabled.

@Override
public void setEnabled(boolean enabled) {
    super.setEnabled(enabled);
    super.setReadOnly(!enabled || readOnly);
    if (editor != null) {
        Element textAreaElement = getTextAreaElement();
        if (enabled) {
            textAreaElement.removeAttribute("disabled");
        } else {
            textAreaElement.setAttribute("disabled", "disabled");
        }
        updateTabIndex();
    }
}
Also used : Element(com.google.gwt.dom.client.Element)

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