Example usage for com.vaadin.ui TabSheet setStyleName

List of usage examples for com.vaadin.ui TabSheet setStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui TabSheet setStyleName.

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:de.fatalix.bookery.view.admin.AdminView.java

License:Open Source License

@PostConstruct
private void postInit() {
    TabSheet tabSheet = new TabSheet();
    tabSheet.setStyleName("admin-screen");
    tabSheet.addTab(createServerSettings(), "Server Settings");
    tabSheet.addTab(createUserManagement(), "User Management");
    tabSheet.addTab(batchJobsLayout, "Batch Jobs");
    this.setCompositionRoot(tabSheet);
}

From source file:eu.eco2clouds.portal.page.ExperimentLayout.java

License:Apache License

public void render() {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();/* w w w  . jav a2  s.  com*/

    /* sheet on experiment details*/
    VerticalLayout detailsSheet = new VerticalLayout();
    detailsSheet.setSpacing(true);
    detailsSheet.setMargin(true);
    detailsSheet.setSizeFull();

    detailsSheet.addComponent(new ExperimentDetails(experiment));

    detailsSheet.addComponent(new ResourceTable());

    /* sheet reporting experiment energy */
    VerticalLayout ecoReportSheet = new VerticalLayout();
    ecoReportSheet.setSpacing(true);
    ecoReportSheet.setMargin(false);
    ecoReportSheet.setSizeFull();
    ecoReportSheet.addComponent(new EcoReport());

    /* sheet reporting adaptation actions */
    VerticalLayout adaptationActionSheet = new VerticalLayout();
    adaptationActionSheet.setSpacing(true);
    adaptationActionSheet.setMargin(false);
    adaptationActionSheet.setSizeFull();
    adaptationActionSheet.addComponent(new AdaptationReport());

    /* sheet reporting experiment energy */
    /*VerticalLayout recommendationReportSheet = new VerticalLayout();
     recommendationReportSheet.setSpacing(true);
     recommendationReportSheet.setMargin(false);
     recommendationReportSheet.setSizeFull();
     recommendationReportSheet.addComponent(new RecommendationReport());*/

    tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL);

    tabSheet.addTab(detailsSheet, "Details");
    tabSheet.addTab(ecoReportSheet, "Eco Report");
    tabSheet.addTab(adaptationActionSheet, "Adaptation Report");
    //tabSheet.addTab(recommendationReportSheet, "Recommendation Report");

    this.addComponent(tabSheet);

    Label space = new Label("");
    this.addComponent(space);
    Label version = new Label("<hr/>ECO2Clouds Portal v." + E2CPortal.VERSION
            + " - (c) ECO2Clouds project 2012-2014 (<a href='http://www.eco2clouds.eu' target='_blank'>http://www.eco2clouds.eu</a>)",
            ContentMode.HTML);
    this.addComponent(version);

    this.setExpandRatio(tabSheet, 2.0f);

}

From source file:module.pandabox.presentation.PandaBox.java

License:Open Source License

Layout getTabsheetPreviews() {
    Layout grid = getPreviewLayout("Tab sheets");

    TabSheet tabs = new DemoTabsheet(false);
    grid.addComponent(tabs);// ww w.  j  a v a 2s  .  co m

    tabs = new DemoTabsheet(true);
    grid.addComponent(tabs);

    tabs = new DemoTabsheet(false);
    tabs.setStyleName("borderless");
    grid.addComponent(tabs);

    tabs = new DemoTabsheet(true);
    tabs.setStyleName("borderless open-only-closable");
    grid.addComponent(tabs);

    return grid;
}

From source file:org.eclipse.hawkbit.ui.rollout.rollout.AddUpdateRolloutWindowLayout.java

License:Open Source License

private TabSheet createGroupDefinitionTabs() {
    final TabSheet tabSheet = new TabSheet();
    tabSheet.setId(UIComponentIdProvider.ROLLOUT_GROUPS);
    tabSheet.setWidth(850, Unit.PIXELS);
    tabSheet.setHeight(300, Unit.PIXELS);
    tabSheet.setStyleName(SPUIStyleDefinitions.ROLLOUT_GROUPS);

    final TabSheet.Tab simpleTab = tabSheet.addTab(createSimpleGroupDefinitionTab(),
            i18n.getMessage("caption.rollout.tabs.simple"));
    simpleTab.setId(UIComponentIdProvider.ROLLOUT_SIMPLE_TAB);

    final TabSheet.Tab advancedTab = tabSheet.addTab(defineGroupsLayout,
            i18n.getMessage("caption.rollout.tabs.advanced"));
    advancedTab.setId(UIComponentIdProvider.ROLLOUT_ADVANCED_TAB);

    tabSheet.addSelectedTabChangeListener(event -> validateGroups());

    return tabSheet;
}

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));//from  w  w w  .ja va 2  s .c  om

    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.arborgraph.demo.DemoApplication.java

License:Open Source License

@SuppressWarnings("serial")
@Override/* w  ww .  jav  a2  s .c o m*/
public void init() {
    VerticalLayout aboutLayout = new VerticalLayout();
    aboutLayout.setSizeFull();
    aboutLayout.addComponent(new Label(getBlah(), Label.CONTENT_XHTML));

    final ArborGraph graph = new ArborGraph();
    graph.setSizeFull();

    Button exampleGraphButton = new Button("Show Example", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(getDemoBranch());
        }
    });

    Label orLabel = new Label("<i>or</i>", Label.CONTENT_XHTML);
    orLabel.setSizeUndefined();

    final TextField jsonTextfield = new TextField();
    jsonTextfield.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    jsonTextfield.setNullRepresentation("");

    Button jsonBranchButton = new Button("Display Json Branch", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(jsonTextfield.getValue().toString());
        }
    });

    Label helpLabel = getHelpLabel(getBranchExplanation());

    HorizontalLayout graphButtonLayout = new HorizontalLayout();
    graphButtonLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    graphButtonLayout.setSpacing(true);
    graphButtonLayout.setMargin(false, false, true, false);
    graphButtonLayout.addComponent(exampleGraphButton);
    graphButtonLayout.addComponent(orLabel);
    graphButtonLayout.setComponentAlignment(orLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonBranchButton);
    graphButtonLayout.addComponent(helpLabel);
    graphButtonLayout.setComponentAlignment(helpLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonTextfield);
    graphButtonLayout.setExpandRatio(jsonTextfield, .9f);

    VerticalLayout graphLayout = new VerticalLayout();
    graphLayout.setSizeFull();
    graphLayout.setMargin(true, false, false, false);
    graphLayout.setSpacing(true);
    graphLayout.addComponent(graphButtonLayout);
    graphLayout.addComponent(graph);
    graphLayout.setExpandRatio(graph, .9f);

    TabSheet tabSheet = new TabSheet();
    tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL);
    tabSheet.setSizeFull();
    tabSheet.addTab(aboutLayout, "About");
    tabSheet.addTab(graphLayout, "Graph");

    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setMargin(true);
    mainLayout.addComponent(tabSheet);
    mainLayout.setExpandRatio(tabSheet, .9f);

    Window mainWindow = new Window("Arbor-Vaadin");
    mainWindow.setSizeFull();
    mainWindow.setContent(mainLayout);

    setTheme("arbor");

    setMainWindow(mainWindow);
}

From source file:ru.codeinside.gses.webui.Workplace.java

License:Mozilla Public License

public Workplace(String login, Set<Role> roles, boolean production) {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();/*from   w ww  . ja va  2 s. c  om*/
    tabSheet.setStyleName(Reindeer.TABSHEET_BORDERLESS);
    tabSheet.setCloseHandler(new DelegateCloseHandler());

    if (!production) {
        new MemoryUsage(tabSheet);
    }

    UserInfoPanel.addClosableToTabSheet(tabSheet, login);

    if (roles.contains(Role.Executor)) {
        TabChanger archiveChanger = new TabChanger(tabSheet);
        archiveChanger.set(ArchiveFactory.create(), "?");

        TabChanger executorChanger = new TabChanger(tabSheet);
        executorChanger.set(ExecutorFactory.create(executorChanger, tabSheet), "?");
    }

    if (roles.contains(Role.Declarant)) {
        new TabChanger(tabSheet).set(DeclarantFactory.create(), " ?");
    }

    if (roles.contains(Role.Supervisor) || roles.contains(Role.SuperSupervisor)) {
        new TabChanger(tabSheet).set(new SupervisorWorkplace(), " ??");
    }

    if (roles.contains(Role.SuperSupervisor)) {
        new TabChanger(tabSheet).set(new TaskManager(), "?? ??");
    }

    if (roles.contains(Role.Manager)) {
        new TabChanger(tabSheet).set(new ManagerWorkplace(), " ");
    }

    if (roles.contains(Role.Executor) || roles.contains(Role.Declarant) || roles.contains(Role.Supervisor)
            || roles.contains(Role.SuperSupervisor)) {
        SmevTasksPanel smevTasksPanel = new SmevTasksPanel();
        tabSheet.addTab(smevTasksPanel, "  ");
        tabSheet.addListener(smevTasksPanel);
    }

    setCompositionRoot(tabSheet);

    setSizeFull();
}