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

com.vaadin.flow.component.listbox.VaadinItem Maven / Gradle / Ivy

There is a newer version: 24.5.5
Show newest version
/**
 * Copyright 2000-2024 Vaadin Ltd.
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  {@literal }  for the full
 * license.
 */
package com.vaadin.flow.component.listbox;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasComponents;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.JsModule;
import com.vaadin.flow.component.dependency.NpmPackage;
import com.vaadin.flow.data.binder.HasItemsAndComponents.ItemComponent;

/**
 * Server-side component for the {@code vaadin-item} element, used to represent
 * individual items in a {@link ListBox}.
 *
 * @author Vaadin Ltd
 *
 * @param 
 *            type of the item represented by this component
 */
@Tag("vaadin-item")
@NpmPackage(value = "@vaadin/vaadin-item", version = "2.3.0")
@JsModule("@vaadin/vaadin-item/src/vaadin-item.js")
class VaadinItem extends Component
        implements ItemComponent, HasComponents {

    private final T item;

    /**
     * Constructs the component with the given item rendered as a String.
     *
     * @param item
     *            the item to be displayed by this component
     */
    public VaadinItem(T item) {
        this.item = item;
    }

    @Override
    public T getItem() {
        return item;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy