/** * Adds the given components to the UI. * <p> * The components' elements are attached to the UI element (the body tag). * * @param components * the components to add */ // Overridden just to mention UI and <body> in the javadocs @Override public void add(Component... components) { HasComponents.super.add(components); }
/** * Add the given text as children of this component. * * @param text * the text to add */ default void add(String text) { add(new Text(text)); }
@Override public void compose(C content, G source) { // remove all components content.removeAll(); // add components source.getComponents().forEach(component -> content.add(component)); }