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

org.bklab.flow.factory.DialogFactory Maven / Gradle / Ivy

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

import com.vaadin.flow.component.AttachEvent;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.ComponentEventListener;
import com.vaadin.flow.component.DetachEvent;
import com.vaadin.flow.component.dialog.Dialog;
import com.vaadin.flow.component.dialog.GeneratedVaadinDialog;
import org.bklab.flow.FlowFactory;
import org.bklab.flow.base.HasComponentsFactory;
import org.bklab.flow.base.HasSizeFactory;

public class DialogFactory extends FlowFactory
        implements HasComponentsFactory, HasSizeFactory {

    public DialogFactory() {
        this(new Dialog());
    }

    public DialogFactory(Component... components) {
        this(new Dialog(components));
    }

    public DialogFactory(Dialog component) {
        super(component);
    }

    public DialogFactory add(Component... add) {
        get().add(add);
        return this;
    }

    public DialogFactory remove(Component... remove) {
        get().remove(remove);
        return this;
    }

    public DialogFactory close() {
        get().close();
        return this;
    }

    public DialogFactory open() {
        get().open();
        return this;
    }

    public DialogFactory removeAll() {
        get().removeAll();
        return this;
    }

    public DialogFactory attachListener(ComponentEventListener attachListener) {
        get().addAttachListener(attachListener);
        return this;
    }

    public DialogFactory detachListener(ComponentEventListener detachListener) {
        get().addDetachListener(detachListener);
        return this;
    }

    public DialogFactory height(String height) {
        get().setHeight(height);
        return this;
    }

    public DialogFactory width(String width) {
        get().setWidth(width);
        return this;
    }

    public DialogFactory opened(boolean opened) {
        get().setOpened(opened);
        return this;
    }

    public DialogFactory resizeListener(ComponentEventListener listener) {
        get().addResizeListener(listener);
        return this;
    }

    public DialogFactory modal(boolean modal) {
        get().setModal(modal);
        return this;
    }

    public DialogFactory resizable(boolean resizable) {
        get().setResizable(resizable);
        return this;
    }

    public DialogFactory closeOnEsc(boolean closeOnEsc) {
        get().setCloseOnEsc(closeOnEsc);
        return this;
    }

    public DialogFactory draggable(boolean draggable) {
        get().setDraggable(draggable);
        return this;
    }

    public DialogFactory closeOnOutsideClick(boolean closeOnOutsideClick) {
        get().setCloseOnOutsideClick(closeOnOutsideClick);
        return this;
    }

    public DialogFactory dialogCloseActionListener(ComponentEventListener listener) {
        get().addDialogCloseActionListener(listener);
        return this;
    }

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

    public DialogFactory openedChangeListener(ComponentEventListener> listener) {
        get().addOpenedChangeListener(listener);
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy