Search in sources :

Example 41 with Element

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

the class CalendarEventGenerator method getWidget.

@Override
public Grid getWidget() {
    if (table != null) {
        return table;
    }
    datePicker1.setValue(new Date());
    datePicker2.setValue(new Date());
    table = new Grid(10, 2);
    table.setText(0, 0, "All day event");
    table.setWidget(0, 1, fullDay);
    table.setText(1, 0, "Event title");
    table.setWidget(1, 1, eventName);
    table.setText(2, 0, "Start date");
    table.setWidget(2, 1, datePicker1);
    table.setText(3, 0, "Time");
    table.setWidget(3, 1, timePicker1);
    table.setText(4, 0, "End date");
    table.setWidget(4, 1, datePicker2);
    table.setText(5, 0, "Time");
    table.setWidget(5, 1, timePicker2);
    table.setText(6, 0, "Time zone");
    table.setWidget(6, 1, timeZones);
    table.setText(7, 0, "Daylight savings");
    table.setWidget(7, 1, summerTime);
    table.setText(8, 0, "Location");
    table.setWidget(8, 1, location);
    table.setText(9, 0, "Description");
    table.setWidget(9, 1, description);
    table.getRowFormatter().getElement(3).setId(FULL_DAY_ONLY_IDS[0]);
    table.getRowFormatter().getElement(5).setId(FULL_DAY_ONLY_IDS[1]);
    table.getRowFormatter().getElement(6).setId(FULL_DAY_ONLY_IDS[2]);
    table.getRowFormatter().getElement(7).setId(FULL_DAY_ONLY_IDS[3]);
    fullDay.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            CheckBox cb = (CheckBox) event.getSource();
            for (String s : FULL_DAY_ONLY_IDS) {
                Element element = DOM.getElementById(s);
                String style = cb.getValue() ? "none" : "";
                element.getStyle().setProperty("display", style);
            }
        }
    });
    return table;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) CheckBox(com.google.gwt.user.client.ui.CheckBox) Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Element(com.google.gwt.dom.client.Element) Date(java.util.Date)

Example 42 with Element

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

the class Generator method showErrorMessage.

private static void showErrorMessage(String error) {
    Element errorElement = DOM.getElementById("errorMessageID");
    errorElement.setInnerHTML(error);
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 43 with Element

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

the class Generator method eraseErrorMessage.

private static void eraseErrorMessage() {
    Element errorElement = DOM.getElementById("errorMessageID");
    errorElement.setInnerHTML(" ");
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 44 with Element

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

the class VTopologyComponent method vertexDragStartHandler.

private Handler<GWTVertex> vertexDragStartHandler() {
    return new Handler<GWTVertex>() {

        @Override
        public void call(GWTVertex vertex, int index) {
            NativeEvent event = D3.getEvent();
            Element draggableElement = Element.as(event.getEventTarget()).getParentElement();
            D3 selection = null;
            boolean isSelected = draggableElement.getAttribute("class").equals("vertex selected");
            if (isSelected) {
                selection = D3.d3().selectAll(GWTVertex.SELECTED_VERTEX_CLASS_NAME);
            } else {
                selection = D3.d3().select(Element.as(event.getEventTarget()).getParentElement());
            }
            m_dragObject = new DragObject(VTopologyComponent.this.m_topologyView, draggableElement, m_topologyView.getSVGViewPort(), selection);
            D3.getEvent().preventDefault();
            D3.getEvent().stopPropagation();
        }
    };
}
Also used : SVGGElement(org.opennms.features.topology.app.internal.gwt.client.svg.SVGGElement) Element(com.google.gwt.dom.client.Element) DragObject(org.opennms.features.topology.app.internal.gwt.client.handler.DragObject) MarqueeSelectHandler(org.opennms.features.topology.app.internal.gwt.client.handler.MarqueeSelectHandler) PanHandler(org.opennms.features.topology.app.internal.gwt.client.handler.PanHandler) Handler(org.opennms.features.topology.app.internal.gwt.client.d3.D3Events.Handler) NativeEvent(com.google.gwt.dom.client.NativeEvent) D3(org.opennms.features.topology.app.internal.gwt.client.d3.D3)

Example 45 with Element

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

the class CommitBox method setParents.

private void setParents(JsArray<CommitInfo> commits) {
    setVisible(firstParent, true);
    TableRowElement next = firstParent;
    TableRowElement previous = null;
    for (CommitInfo c : Natives.asList(commits)) {
        if (next == firstParent) {
            CopyableLabel copyLabel = getCommitLabel(c);
            parentCommits.add(copyLabel);
            setWebLinks(parentWebLinks, c);
        } else {
            next.appendChild(DOM.createTD());
            Element td1 = DOM.createTD();
            td1.appendChild(getCommitLabel(c).getElement());
            next.appendChild(td1);
            FlowPanel linksPanel = new FlowPanel();
            linksPanel.addStyleName(style.parentWebLink());
            setWebLinks(linksPanel, c);
            Element td2 = DOM.createTD();
            td2.appendChild(linksPanel.getElement());
            next.appendChild(td2);
            previous.getParentElement().insertAfter(next, previous);
        }
        previous = next;
        next = DOM.createTR().cast();
    }
}
Also used : TableRowElement(com.google.gwt.dom.client.TableRowElement) TableRowElement(com.google.gwt.dom.client.TableRowElement) Element(com.google.gwt.dom.client.Element) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) CommitInfo(com.google.gerrit.client.info.ChangeInfo.CommitInfo) CopyableLabel(com.google.gwtexpui.clippy.client.CopyableLabel)

Aggregations

Element (com.google.gwt.dom.client.Element)207 DivElement (com.google.gwt.dom.client.DivElement)14 Test (org.junit.Test)13 TableRowElement (com.google.gwt.dom.client.TableRowElement)11 SVGSVGElement (elemental.svg.SVGSVGElement)11 InputElement (com.google.gwt.dom.client.InputElement)9 NativeEvent (com.google.gwt.dom.client.NativeEvent)9 EventTarget (com.google.gwt.dom.client.EventTarget)8 Node (com.google.gwt.dom.client.Node)8 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)8 Image (com.google.gwt.user.client.ui.Image)8 PatchMethod (com.googlecode.gwt.test.patchers.PatchMethod)8 AnchorElement (com.google.gwt.dom.client.AnchorElement)7 ImageElement (com.google.gwt.dom.client.ImageElement)7 LabelElement (com.google.gwt.dom.client.LabelElement)7 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)7 JsArrayString (com.google.gwt.core.client.JsArrayString)6 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)6 ImageResource (com.google.gwt.resources.client.ImageResource)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6