use of com.vaadin.flow.component.Component in project flow by vaadin.
the class GeneratedVaadinFormItem method remove.
/**
* Removes the given child components from this component.
*
* @param components
* The components to remove.
* @throws IllegalArgumentException
* if any of the components is not a child of this component.
*/
protected void remove(Component... components) {
for (Component component : components) {
if (getElement().equals(component.getElement().getParent())) {
component.getElement().removeAttribute("slot");
getElement().removeChild(component.getElement());
} else {
throw new IllegalArgumentException("The given component (" + component + ") is not a child of this component");
}
}
}
use of com.vaadin.flow.component.Component in project flow by vaadin.
the class GeneratedVaadinNotificationContainer method addToBottomStretch.
/**
* Adds the given components as children of this component at the slot
* 'bottom-stretch'.
*
* @param components
* The components to add.
* @see <a
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot">MDN
* page about slots</a>
* @see <a
* href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">Spec
* website about slots</a>
*/
protected void addToBottomStretch(Component... components) {
for (Component component : components) {
component.getElement().setAttribute("slot", "bottom-stretch");
getElement().appendChild(component.getElement());
}
}
use of com.vaadin.flow.component.Component in project flow by vaadin.
the class GeneratedVaadinNotificationContainer method addToMiddle.
/**
* Adds the given components as children of this component at the slot
* 'middle'.
*
* @param components
* The components to add.
* @see <a
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot">MDN
* page about slots</a>
* @see <a
* href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">Spec
* website about slots</a>
*/
protected void addToMiddle(Component... components) {
for (Component component : components) {
component.getElement().setAttribute("slot", "middle");
getElement().appendChild(component.getElement());
}
}
use of com.vaadin.flow.component.Component in project flow by vaadin.
the class GeneratedVaadinNotificationContainer method addToTopCenter.
/**
* Adds the given components as children of this component at the slot
* 'top-center'.
*
* @param components
* The components to add.
* @see <a
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot">MDN
* page about slots</a>
* @see <a
* href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">Spec
* website about slots</a>
*/
protected void addToTopCenter(Component... components) {
for (Component component : components) {
component.getElement().setAttribute("slot", "top-center");
getElement().appendChild(component.getElement());
}
}
use of com.vaadin.flow.component.Component in project flow by vaadin.
the class GeneratedVaadinNotificationContainer method addToBottomCenter.
/**
* Adds the given components as children of this component at the slot
* 'bottom-center'.
*
* @param components
* The components to add.
* @see <a
* href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot">MDN
* page about slots</a>
* @see <a
* href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">Spec
* website about slots</a>
*/
protected void addToBottomCenter(Component... components) {
for (Component component : components) {
component.getElement().setAttribute("slot", "bottom-center");
getElement().appendChild(component.getElement());
}
}
Aggregations