Search in sources :

Example 11 with Div

use of com.vaadin.flow.component.html.Div in project flow by vaadin.

the class TitleView method onShow.

@Override
protected void onShow() {
    removeAll();
    Div titleView = new Div();
    titleView.setText("Title view");
    titleView.setId("annotated");
    add(titleView);
}
Also used : Div(com.vaadin.flow.component.html.Div)

Example 12 with Div

use of com.vaadin.flow.component.html.Div in project flow by vaadin.

the class DependenciesLoadingBaseView method createDiv.

private Div createDiv(String id, String text) {
    Div div = new Div();
    div.setId(id);
    div.setText(text);
    return div;
}
Also used : Div(com.vaadin.flow.component.html.Div)

Example 13 with Div

use of com.vaadin.flow.component.html.Div in project flow by vaadin.

the class ScrollView method createSpacerDiv.

static Div createSpacerDiv(int heightPx) {
    Div spacer = new Div();
    spacer.setHeight(heightPx + "px");
    return spacer;
}
Also used : Div(com.vaadin.flow.component.html.Div)

Example 14 with Div

use of com.vaadin.flow.component.html.Div in project flow by vaadin.

the class LockingUI method init.

@Override
protected void init(VaadinRequest request) {
    message = new Div();
    message.setId("message");
    message.setText("default");
    NativeButton lockButton = new NativeButton("Lock UI for too long");
    lockButton.addClickListener(e -> {
        setHeartBeats();
        message.setText(LOCKING_ENDED);
    });
    NativeButton checkButton = new NativeButton("Test communication", e -> message.setText(ALL_OK));
    lockButton.setId("lock");
    checkButton.setId("check");
    add(lockButton, checkButton, message);
}
Also used : Div(com.vaadin.flow.component.html.Div) NativeButton(com.vaadin.flow.component.html.NativeButton)

Example 15 with Div

use of com.vaadin.flow.component.html.Div in project flow by vaadin.

the class BasicPollUI method init.

@Override
protected void init(VaadinRequest request) {
    super.init(request);
    getElement().insertChild(0, pollInterval);
    getElement().insertChild(0, pollCounter);
    setPollInterval(500);
    addPollListener(e -> {
        pollCounter.setText("Polls received: " + (++pollCount));
    });
    NativeButton stopPolling = new NativeButton("Stop polling", e -> {
        setPollInterval(-1);
        updatePollIntervalText();
    });
    stopPolling.setId(STOP_POLLING_BUTTON);
    NativeButton startPolling = new NativeButton("Start polling", e -> {
        setPollInterval(500);
        updatePollIntervalText();
    });
    startPolling.setId(START_POLLING_BUTTON);
    spacer();
    getElement().appendChild(new Div(startPolling, stopPolling).getElement());
    updatePollIntervalText();
}
Also used : Div(com.vaadin.flow.component.html.Div) NativeButton(com.vaadin.flow.component.html.NativeButton)

Aggregations

Div (com.vaadin.flow.component.html.Div)30 NativeButton (com.vaadin.flow.component.html.NativeButton)7 Text (com.vaadin.flow.component.Text)6 Element (com.vaadin.flow.dom.Element)4 HasComponents (com.vaadin.flow.component.HasComponents)3 EventHandler (com.vaadin.flow.component.polymertemplate.EventHandler)3 Input (com.vaadin.flow.component.html.Input)2 ShadowRoot (com.vaadin.flow.dom.ShadowRoot)2 HasText (com.vaadin.flow.component.HasText)1 H3 (com.vaadin.flow.component.html.H3)1 Hr (com.vaadin.flow.component.html.Hr)1 Label (com.vaadin.flow.component.html.Label)1 Span (com.vaadin.flow.component.html.Span)1 Style (com.vaadin.flow.dom.Style)1 NameField (com.vaadin.flow.uitest.ui.CompositeView.NameField)1