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

com.vaadin.server.UICreateEvent Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Vaadin Framework 7
 *
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */

package com.vaadin.server;

import com.vaadin.ui.UI;

/**
 * Contains data used by various methods in {@link UIProvider} for determining
 * information about a new UI that is about to be created.
 *
 * @author Vaadin Ltd
 * @since 7.0.0
 */
public class UICreateEvent extends UIProviderEvent {

    private final Class uiClass;
    private final Integer uiId;

    /**
     * Creates a new UI create event for a given VaadinRequest and UI class but
     * without a UI id.
     *
     * @param request
     *            the request for which the UI will be created
     * @param uiClass
     *            the UI class that will be created
     */
    public UICreateEvent(VaadinRequest request, Class uiClass) {
        this(request, uiClass, null);
    }

    /**
     * Creates a new UI create event for a given VaadinRequest, UI class and UI
     * id
     *
     * @param request
     *            the request for which the UI will be created
     * @param uiClass
     *            the UI class that will be created
     * @param uiId
     *            the id reserved for the UI; or null if no id has
     *            yet been allocated.
     */
    public UICreateEvent(VaadinRequest request, Class uiClass,
            Integer uiId) {
        super(request);
        this.uiClass = uiClass;
        this.uiId = uiId;
    }

    /**
     * Gets the UI class that will be created.
     *
     * @return the UI class
     */
    public Class getUIClass() {
        return uiClass;
    }

    /**
     * Gets the id of the UI about to be created. This might be
     * null if the id has not yet been determined.
     * 

* The UI id is generally only available in * {@link UIProvider#createInstance(UICreateEvent)} * * @return the UI id; or null if the UI id is not yet known. */ public Integer getUiId() { return uiId; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy