use of com.vaadin.flow.component.html.Div in project flow by vaadin.
the class ShadowRootView method onShow.
@Override
protected void onShow() {
Div div = new Div();
div.getElement().setAttribute("id", "test-element");
add(div);
ShadowRoot shadowRoot = div.getElement().attachShadow();
Element shadowDiv = ElementFactory.createDiv();
shadowDiv.setText("Div inside shadow DOM");
shadowDiv.setAttribute("id", "shadow-div");
shadowRoot.appendChild(shadowDiv);
Element shadowLabel = ElementFactory.createLabel("Label inside shadow DOM");
shadowLabel.setAttribute("id", "shadow-label");
shadowRoot.appendChild(shadowLabel);
NativeButton removeChild = new NativeButton("Remove the last child from the shadow root", event -> shadowRoot.removeChild(shadowLabel));
removeChild.setId("remove");
add(removeChild);
}
use of com.vaadin.flow.component.html.Div in project flow by vaadin.
the class SynchronizedPropertyView method addSimpleSync.
private void addSimpleSync() {
add(new Text("Synchronized on 'change' event"));
Div label = new Div();
label.setId("syncOnChangeLabel");
InputSync syncOnChange = new InputSync(label, "change");
syncOnChange.setId("syncOnChange");
add(syncOnChange);
add(label);
}
use of com.vaadin.flow.component.html.Div in project flow by vaadin.
the class SynchronizedPropertyView method addSyncOnKeyup.
private void addSyncOnKeyup() {
Div label;
add(new Text("Synchronized on 'keyup' event"));
label = new Div();
label.setId("syncOnKeyUpLabel");
InputSync syncOnKeyUp = new InputSync(label, "keyup");
syncOnKeyUp.setId("syncOnKeyUp");
add(syncOnKeyUp);
add(label);
}
use of com.vaadin.flow.component.html.Div in project flow by vaadin.
the class ClearNodeChildrenView method addDivTo.
private void addDivTo(HasComponents container) {
Div div = new Div();
div.setText("Server div " + (container.getElement().getChildCount() + 1));
div.addAttachListener(evt -> message.setText(message.getText() + "\nDiv '" + div.getText() + "' attached."));
div.addDetachListener(evt -> message.setText(message.getText() + "\nDiv '" + div.getText() + "' detached."));
container.add(div);
}
use of com.vaadin.flow.component.html.Div in project flow by vaadin.
the class PolymerDefaultPropertyValueView method createEmailValue.
private void createEmailValue(PolymerDefaultPropertyValue template) {
Div div = new Div();
div.setText(template.getEmail());
div.setId("email-value");
add(div);
}
Aggregations