com.github.fluorumlabs.disconnect.vaadin.Tabs 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.vaadin.constants.Orientation;
import com.github.fluorumlabs.disconnect.vaadin.elements.TabsElement;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasElementMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasListMixin;
import com.github.fluorumlabs.disconnect.vaadin.mixins.HasThemableMixin;
import com.github.fluorumlabs.disconnect.vaadin.types.ThemeVariant;
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 js.extras.JsEnum;
import javax.annotation.Nullable;
/**
* <vaadin-tabs>
is a Web Component for easy switching between different views.
*
* <vaadin-tabs selected="4">
* <vaadin-tab>Page 1</vaadin-tab>
* <vaadin-tab>Page 2</vaadin-tab>
* <vaadin-tab>Page 3</vaadin-tab>
* <vaadin-tab>Page 4</vaadin-tab>
* </vaadin-tabs>
*
* Styling
* The following shadow DOM parts are available for styling:
*
*
*
* Part name Description
*
*
* back-button
Button for moving the scroll back
* tabs
The tabs container
* forward-button
Button for moving the scroll forward
*
*
* The following state attributes are available for styling:
*
*
*
* Attribute Description Part name
*
*
* orientation
Tabs disposition, valid values are horizontal
and
* vertical
. :host
* overflow
It's set to start
, end
, none or both
* . :host
*
*
* See
* ThemableMixin – how to apply styles for shadow parts
*/
@WebComponent
public class Tabs extends AbstractComponent implements HasElementMixin,
HasListMixin,
HasThemableMixin,
HasStyle, HasComponents> {
public Tabs() {
super(TabsElement.TAGNAME());
}
/**
* Set tabs disposition. Possible values are horizontal|vertical
*/
@Nullable
public Orientation orientation() {
return getNode().getOrientation();
}
/**
* Set tabs disposition. Possible values are horizontal|vertical
*/
public Tabs orientation(Orientation orientation) {
getNode().setOrientation(orientation);
return this;
}
/**
* The index of the selected tab.
*/
public int selected() {
return getNode().getSelected();
}
/**
* The index of the selected tab.
*/
public Tabs selected(int selected) {
getNode().setSelected(selected);
return this;
}
public abstract static class Variant extends ThemeVariant {
public static final Variant CENTERED = JsEnum.of("centered");
public static final Variant SMALL = JsEnum.of("small");
public static final Variant MINIMAL = JsEnum.of("minimal");
public static final Variant HIDE_SCROLL_BUTTONS = JsEnum.of("hide-scroll-buttons");
public static final Variant EQUAL_WIDTH_TABS = JsEnum.of("equal-width-tabs");
}
}