All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bklab.flow.base.SubMenuBaseFactory Maven / Gradle / Ivy

There is a newer version: 22.0.1
Show newest version
package org.bklab.flow.base;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.contextmenu.ContextMenuBase;
import com.vaadin.flow.component.contextmenu.MenuItemBase;
import com.vaadin.flow.component.contextmenu.SubMenuBase;

import java.util.function.Supplier;

@SuppressWarnings("unchecked")
public interface SubMenuBaseFactory, I extends MenuItemBase, S extends SubMenuBase, E extends SubMenuBaseFactory> extends Supplier {

    default E add(Component... add) {
        get().add(add);
        return (E) this;
    }

    default E remove(Component... remove) {
        get().remove(remove);
        return (E) this;
    }

    default E removeAll() {
        get().removeAll();
        return (E) this;
    }

    default E componentAtIndex(int index, Component component) {
        get().addComponentAtIndex(index, component);
        return (E) this;
    }

    default E item(Component item) {
        get().addItem(item);
        return (E) this;
    }

    default E item(String item) {
        get().addItem(item);
        return (E) this;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy