com.github.fluorumlabs.disconnect.vaadin.RadioButton Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of disconnect-vaadin Show documentation
Show all versions of disconnect-vaadin Show documentation
Vaadin components bindings for Disconnect Zero
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 name Description
*
*
* radio
The radio button element
* label
The label content element
*
*
* The following state attributes are available for styling:
*
*
*
* Attribute Description Part name
*
*
* disabled
Set when the radio button is disabled. :host
* focus-ring
Set when the radio button is focused using the keyboard
* . :host
* focused
Set when the radio button is focused. :host
* checked
Set when the radio button is checked. :host
* empty
Set 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");
}
}