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

com.github.fluorumlabs.disconnect.vaadin.Item Maven / Gradle / Ivy

The newest version!
package com.github.fluorumlabs.disconnect.vaadin;

import com.github.fluorumlabs.disconnect.core.annotations.WebComponent;
import com.github.fluorumlabs.disconnect.vaadin.elements.ItemElement;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasItemMixin;
import com.github.fluorumlabs.disconnect.zero.component.AbstractComponent;
import com.github.fluorumlabs.disconnect.zero.component.Component;
import com.github.fluorumlabs.disconnect.zero.component.HasComponents;
import com.github.fluorumlabs.disconnect.zero.component.HasStyle;

/**
 * <vaadin-item> is a Web Component providing layout for items in tabs and menus.
 *
 * 
  <vaadin-item>
 *     Item content
 *   </vaadin-item>
 * 
*

Selectable

* <vaadin-item> has the selected property and the corresponding state attribute. * Currently, the component sets the selected to false, when disabled property is set to true. * But other than that, the <vaadin-item> does not switch selection by itself. * In general, it is the wrapper component, like <vaadin-list-box>, which should update * the selected property on the items, e. g. on mousedown or when Enter / Spacebar is pressed. * *

Styling

* The following shadow DOM parts are available for styling: * * * * * * * * *
Part nameDescription
contentThe element that wraps the slot
* The following state attributes are available for styling: * * * * * * * * * * * * *
AttributeDescriptionPart name
disabledSet to a disabled item:host
focusedSet when the element is focused:host
focus-ringSet when the element is keyboard focused:host
selectedSet when the item is selected:host
activeSet when mousedown or enter/spacebar pressed:host
*/ @WebComponent public class Item extends AbstractComponent implements HasItemMixin, HasStyle, HasComponents> { public Item() { super(ItemElement.TAGNAME()); } /** * Submittable string value. The default value is the trimmed text content of the element. */ public String value() { return getNode().getValue(); } /** * Submittable string value. The default value is the trimmed text content of the element. */ public Item value(String value) { getNode().setValue(value); return this; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy