Example usage for com.vaadin.ui.themes ValoTheme TABSHEET_CENTERED_TABS

List of usage examples for com.vaadin.ui.themes ValoTheme TABSHEET_CENTERED_TABS

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme TABSHEET_CENTERED_TABS.

Prototype

String TABSHEET_CENTERED_TABS

To view the source code for com.vaadin.ui.themes ValoTheme TABSHEET_CENTERED_TABS.

Click Source Link

Document

Center the tabs inside the tab bar.

Usage

From source file:dhbw.clippinggorilla.userinterface.windows.PreferencesWindow.java

public PreferencesWindow(User user) {
    //setHeight("480px");
    //setWidth("720px");

    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setWidth("100%");
    windowContent.setHeight("100%");
    windowContent.setMargin(new MarginInfo(true, false, false, false));

    TabSheet preferencesCategories = new TabSheet();
    preferencesCategories.setWidth("100%");
    preferencesCategories.setHeight("100%");
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_ICONS_ON_TOP);
    preferencesCategories.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    windowContent.addComponent(preferencesCategories);
    windowContent.setExpandRatio(preferencesCategories, 1f);

    preferencesCategories.addComponent(buildUserTab(user));
    preferencesCategories.addComponent(buildClippingsTab(user));
    preferencesCategories.addComponent(buildSupportTab(user));
    preferencesCategories.setSelectedTab(0);

    windowContent.addComponent(buildFooter(user));

    setContent(windowContent);/*from   w  w  w  . j  av a 2s.c  o  m*/
    setModal(true);
    addCloseShortcut(KeyCode.ENTER, null);
    setResizable(false);
    setClosable(false);
    setHeight("480px");
    setWidth("720px");
}

From source file:org.vaadin.addon.twitter.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    Responsive.makeResponsive(this);
    CssLayout info = new CssLayout();
    info.setStyleName("tw-docs");
    info.addComponent(markdown.get(0));/*w  w w  .  j a v a  2 s  . c o m*/

    TabSheet tabSheet = new TabSheet();
    tabSheet.setStyleName("tw-demo-tab");
    tabSheet.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    tabSheet.setSizeFull();
    tabSheet.addTab(new TimelineDemo()).setCaption("Timeline");
    tabSheet.addTab(new TweetDemo()).setCaption("Single Tweet");
    tabSheet.addTab(new ButtonDemo(TweetButton.Type.Follow)).setCaption("Follow Button");
    tabSheet.addTab(new ButtonDemo(TweetButton.Type.Share)).setCaption("Share Button");
    tabSheet.addTab(new ButtonDemo(TweetButton.Type.Hashtag)).setCaption("Hashtag Button");
    tabSheet.addTab(new ButtonDemo(TweetButton.Type.Mention)).setCaption("Mention Button");
    tabSheet.addSelectedTabChangeListener(event -> {
        Component old = info.getComponent(0);
        Component newComp = markdown.get(tabSheet.getTabPosition(tabSheet.getTab(tabSheet.getSelectedTab())));
        info.replaceComponent(old, newComp);
    });
    final MHorizontalLayout layout = new MHorizontalLayout(info, tabSheet).withExpand(info, 4)
            .withExpand(tabSheet, 6).withFullWidth().withFullHeight().withMargin(false).withSpacing(true);
    setContent(new MPanel(layout).withFullWidth().withFullHeight().withStyleName(ValoTheme.PANEL_WELL,
            "root-container"));

}

From source file:org.vaadin.spinkit.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();//from   w  w w .  j  a  v  a 2  s. c  o m
    tabSheet.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    tabSheet.addTab(spinnersContainer()).setCaption("Spinners");
    tabSheet.addTab(spinnerSizesContainer()).setCaption("Sizes");
    tabSheet.addTab(spinnersContainer("greenspin")).setCaption("Themed Spinners");
    tabSheet.addTab(new RichText().withMarkDown(getClass().getResourceAsStream("source.md")))
            .setCaption("Source code");
    //layout.addComponent(tabSheet);
    //layout.expand(tabSheet);
    RichText info = new RichText().withMarkDown(getClass().getResourceAsStream("about.md"));

    MVerticalLayout layout = new MVerticalLayout().withMargin(true).with(info).expand(tabSheet).withFullHeight()
            .withFullWidth();

    //layout.setExpandRatio(info, 1);
    //layout.setExpandRatio(tabSheet, 4);

    setContent(layout);
}

From source file:ui.Desktop.java

License:Apache License

public Desktop(Integer userId, String language) {
    top = new VerticalList(userId, language);
    String translation = Translator.getTranslation("Desktop", language);
    addTab(top, translation);/*from ww w  .ja  v  a 2 s .c om*/
    setStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    tabs = new HashMap<>();
}

From source file:ui.tabsheet.WelcomeTabSheet.java

public WelcomeTabSheet(Integer userId, String language) {
    setSizeFull();//from w ww  .j  a v  a 2s. c o  m
    addTab(new HorizontalLayout(), "Users");
    addTab(new HorizontalLayout(), "Partners");
    addTab(new HorizontalLayout(), "Contact");
    setStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
}