Search in sources :

Example 31 with Element

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

the class ProjectClasspathViewImpl method createButtons.

private void createButtons() {
    doneButton = createPrimaryButton(localization.buttonDone(), "window-edit-configurations-close", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            delegate.onDoneClicked();
        }
    });
    addButtonToFooter(doneButton);
    Element dummyFocusElement = DOM.createSpan();
    dummyFocusElement.setTabIndex(0);
    getFooter().getElement().appendChild(dummyFocusElement);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) SpanElement(com.google.gwt.dom.client.SpanElement) Element(com.google.gwt.dom.client.Element)

Example 32 with Element

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

the class ExpandEditorAction method createCustomComponent.

@Override
public Widget createCustomComponent(Presentation presentation) {
    if (buttonPanel != null) {
        return buttonPanel;
    }
    final Element tooltip = DOM.createSpan();
    tooltip.setInnerHTML(constant.actionExpandEditorTitle());
    buttonPanel = new FlowPanel();
    buttonPanel.addStyleName(resources.coreCss().editorFullScreen());
    button = new FlowPanel();
    button.getElement().setInnerHTML(FontAwesome.EXPAND);
    button.addDomHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            toggleExpand();
        }
    }, ClickEvent.getType());
    buttonPanel.add(button);
    buttonPanel.getElement().appendChild(tooltip);
    buttonPanel.addDomHandler(new MouseOverHandler() {

        @Override
        public void onMouseOver(MouseOverEvent event) {
            final Element panel = event.getRelativeElement();
            tooltip.getStyle().setProperty("top", (panel.getAbsoluteTop() + panel.getOffsetHeight() + 9) + "px");
            tooltip.getStyle().setProperty("right", (Document.get().getClientWidth() - panel.getAbsoluteRight() - 2) + "px");
        }
    }, MouseOverEvent.getType());
    return buttonPanel;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Element(com.google.gwt.dom.client.Element) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) MouseOverEvent(com.google.gwt.event.dom.client.MouseOverEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) MouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)

Example 33 with Element

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

the class ResetToCommitViewImpl method addDescription.

/**
     * Add description to radio button title.
     *
     * @param radioItem
     *         radio button
     * @param description
     *         description to add
     */
private void addDescription(RadioButton radioItem, String description) {
    Element descElement = DOM.createSpan();
    descElement.setInnerText(" " + description);
    descElement.getStyle().setColor("#888");
    radioItem.getElement().appendChild(descElement);
}
Also used : Element(com.google.gwt.dom.client.Element)

Example 34 with Element

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

the class IncrementalFindReportStatusObserver method update.

/**
     *
     * Checks if {@code statusMessage} is incremental find message.
     * In case if this is true than create or update simple UI to display
     * message content, otherwise skip this message.
     *
     * @param statusMessage
     *         editor status message.
     */
@Override
public void update(StatusMessage statusMessage) {
    String message = statusMessage.getMessage();
    boolean isIncrementalFindMessage = message.startsWith("Incremental find:") | message.startsWith("Reverse Incremental find:");
    if (!message.isEmpty() && !isIncrementalFindMessage) {
        return;
    }
    Element editorElem = editorWidget.asWidget().getElement();
    Element findDiv = createFindDiv(message);
    setStyle(message, findDiv);
    editorElem.appendChild(findDiv);
    if (isNullOrEmpty(message) && findDiv != null) {
        editorElem.removeChild(findDiv);
        this.findDiv = null;
    }
}
Also used : DivElement(elemental.html.DivElement) Element(com.google.gwt.dom.client.Element)

Example 35 with Element

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

the class IncrementalFindReportStatusObserver method createFindDiv.

private Element createFindDiv(String message) {
    if (findDiv == null) {
        findDiv = Elements.createDivElement();
        Text messageNode = Elements.createTextNode(message);
        findDiv.appendChild(messageNode);
    }
    findDiv.getFirstChild().setTextContent(message);
    return (Element) findDiv;
}
Also used : DivElement(elemental.html.DivElement) Element(com.google.gwt.dom.client.Element) Text(elemental.dom.Text)

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