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

com.github.fluorumlabs.disconnect.vaadin.RadioButton 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.polymer.mixins.HasGestureEventListeners;
import com.github.fluorumlabs.disconnect.polymer.types.BooleanPropertyChangeEvent;
import com.github.fluorumlabs.disconnect.vaadin.elements.RadioButtonElement;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasControlStateMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasElementMixin;
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;
import com.github.fluorumlabs.disconnect.zero.observable.ObservableEvent;
import js.web.dom.Event;

import javax.annotation.Nullable;

/**
 * <vaadin-radio-button> is a Web Component for radio buttons.
 *
 * 
<vaadin-radio-button value="foo">Foo</vaadin-radio-button>
 * 
*

Styling

* The following shadow DOM parts are available for styling: * * * * * * * * * *
Part nameDescription
radioThe radio button element
labelThe label content element
* The following state attributes are available for styling: * * * * * * * * * * * * *
AttributeDescriptionPart name
disabledSet when the radio button is disabled.:host
focus-ringSet when the radio button is focused using the keyboard * .:host
focusedSet when the radio button is focused.:host
checkedSet when the radio button is checked.:host
emptySet when there is no label provided.label
* See * ThemableMixin – how to apply styles for shadow parts */ @WebComponent public class RadioButton extends AbstractComponent implements HasElementMixin, HasControlStateMixin, HasGestureEventListeners, HasStyle, HasComponents> { public RadioButton() { super(RadioButtonElement.TAGNAME()); } /** * Name of the element. */ @Nullable public String name() { return getNode().getName(); } /** * Name of the element. */ public RadioButton name(String name) { getNode().setName(name); return this; } /** * True if the radio button is checked. */ public boolean checked() { return getNode().isChecked(); } /** * True if the radio button is checked. */ public RadioButton checked(boolean checked) { getNode().setChecked(checked); return this; } /** * The value for this element. */ @Nullable public String value() { return getNode().getValue(); } /** * The value for this element. */ public RadioButton value(String value) { getNode().setValue(value); return this; } /** * Fired when the user toggles the radio button. */ public ObservableEvent changeEvent() { return createEvent("change"); } /** * Fired when the checked property changes. */ public ObservableEvent checkedChangedEvent() { return createEvent("checked-changed"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy