use of com.vaadin.flow.component.html.NativeButton in project flow by vaadin.
the class HelloWorldUI method init.
@Override
protected void init(VaadinRequest request) {
NativeButton b = new NativeButton("Hello", e -> {
add(new Text("Hello!"));
});
add(b);
}
use of com.vaadin.flow.component.html.NativeButton in project flow by vaadin.
the class PushView method onAttach.
@Override
protected void onAttach(AttachEvent attachEvent) {
super.onAttach(attachEvent);
UI ui = attachEvent.getUI();
// Fallback transport is forced to websocket so that we either get a
// websocket connection or no push connection at all
ui.getPushConfiguration().setFallbackTransport(Transport.WEBSOCKET);
add(new NativeButton("Say hello", e -> {
add(new Paragraph("Hello"));
new Thread(new SayWorld(ui)).start();
}));
}
use of com.vaadin.flow.component.html.NativeButton in project flow by vaadin.
the class MemoryLeakUI method init.
@Override
protected void init(VaadinRequest request) {
NativeButton button = new NativeButton("Hello", e -> add(new Text("Hello")));
button.setId("hello");
add(button);
}
use of com.vaadin.flow.component.html.NativeButton in project flow by vaadin.
the class EventListenersView method onShow.
@Override
protected void onShow() {
AtomicInteger count = new AtomicInteger();
NativeButton button = new NativeButton("Click me");
button.setId("click");
button.addClickListener(evt -> {
int value = count.incrementAndGet();
Label label = new Label(String.valueOf(value));
label.addClassName("count");
add(label);
add(button);
});
add(button);
}
use of com.vaadin.flow.component.html.NativeButton in project flow by vaadin.
the class InMemoryChildrenView method onShow.
@Override
protected void onShow() {
Label label = new Label();
label.setId("in-memory");
label.setText("In memory element");
getElement().appendVirtualChild(label.getElement());
getElement().getNode().runWhenAttached(ui -> ui.getPage().executeJavaScript("window.inMemoryConnector.init($0, $1)", getElement(), label));
Div target = new Div();
target.setId("target");
add(target);
NativeButton button = new NativeButton("Add copy of in-memory element to the target", event -> getElement().callFunction("useInMemoryElement", target));
button.setId("copy");
add(button);
}
Aggregations