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

com.github.fluorumlabs.disconnect.vaadin.Tabs 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.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 nameDescription
back-buttonButton for moving the scroll back
tabsThe tabs container
forward-buttonButton for moving the scroll forward
* The following state attributes are available for styling: * * * * * * * * * *
AttributeDescriptionPart name
orientationTabs disposition, valid values are horizontal and * vertical.:host
overflowIt'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"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy