Example usage for com.vaadin.ui TabSheet TabSheet

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

Introduction

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

Prototype

public TabSheet() 

Source Link

Document

Constructs a new TabSheet.

Usage

From source file:de.uni_tuebingen.qbic.qbicmainportlet.SampleView.java

License:Open Source License

/**
 * init this view. builds the layout skeleton Menubar Description and others Statisitcs Experiment
 * Table Graph//  ww w  . j  ava 2 s.c  o  m
 */
void initView() {
    setResponsive(true);
    setWidth(100, Unit.PERCENTAGE);

    sampview_content = new VerticalLayout();
    sampview_content.setMargin(new MarginInfo(true, true, false, false));
    sampview_content.setResponsive(true);

    sampview_tab = new TabSheet();
    sampview_tab.setResponsive(true);
    sampview_tab.setWidth(100, Unit.PERCENTAGE);
    sampview_tab.addStyleName(ValoTheme.TABSHEET_FRAMED);
    sampview_tab.addStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    sampview_tab.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    header = "";

    datasetComponent = new DatasetComponent(datahandler, state, resourceUrl);
    changeMetaDataComponent = new ChangeMetadataComponent(datahandler, state, resourceUrl);

    sampview_tab.addTab(initDescription()).setIcon(FontAwesome.INFO_CIRCLE);
    // sampview_tab.addTab(initStatistics()).setIcon(FontAwesome.BAR_CHART_O);
    sampview_tab.addTab(datasetComponent).setIcon(FontAwesome.DATABASE);
    initNoteComponent();
    sampview_tab.addTab(innerNotesComponent).setIcon(FontAwesome.PENCIL);

    sampview_tab.setImmediate(true);

    sampview_tab.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        /**
         * 
         */
        private static final long serialVersionUID = 6899763427531265769L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {

            if (event.getTabSheet().getSelectedTab().getCaption().equals("Datasets")) {
                datasetComponent.updateUI(navigateToLabel, getCurrentBean().getId());
            }
        }
    });

    sampview_content.addComponent(sampview_tab);
    this.addComponent(sampview_content);
}

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);/* w w w  .ja  va  2  s  .c  o  m*/
    setModal(true);
    addCloseShortcut(KeyCode.ENTER, null);
    setResizable(false);
    setClosable(false);
    setHeight("480px");
    setWidth("720px");
}

From source file:edu.kit.dama.ui.admin.DataManagerSettingsPanel.java

License:Apache License

private void buildMainComponentContainer() {
    String id = "mainComponent";
    LOGGER.debug(new StringBuilder("Building ").append(DEBUG_ID_PREFIX).append(id).append(" ...").toString());

    mainComponentContainer = new TabSheet();
    mainComponentContainer.setId(new StringBuilder(DEBUG_ID_PREFIX).append(id).toString());
    mainComponentContainer.setSizeFull();

    // Add tab for user administration
    mainComponentContainer.addTab(getUserAdministrationTab(), "User Administration",
            new ThemeResource(IconContainer.USERS));
    mainComponentContainer.addTab(getGroupAdministrationTab(), "Group Administration",
            new ThemeResource(IconContainer.GROUPS));
    mainComponentContainer.addTab(getAccessPointConfigurationTab(), "Staging Access Points",
            new ThemeResource(IconContainer.ACCESS_POINT));
    mainComponentContainer.addTab(getProcessorConfigurationTab(), "Staging Processors",
            new ThemeResource(IconContainer.STAGING_PROCESSOR));
    mainComponentContainer.addTab(getExecutionEnvironmentConfigurationTab(), "Execution Environments",
            new ThemeResource(IconContainer.EXECUTION_ENVIRONMENT));
    mainComponentContainer.addTab(getDataWorkflowConfigurationTab(), "Data Workflow Tasks",
            new ThemeResource(IconContainer.DATA_WORKFLOW));
    mainComponentContainer.addTab(getJobScheduleConfigurationTab(), "Job Scheduling",
            new ThemeResource(IconContainer.JOB_SCHEDULE));
    // Add listener for tab change
    mainComponentContainer.addSelectedTabChangeListener((TabSheet.SelectedTabChangeEvent event) -> {
        if (!event.getTabSheet().getSelectedTab().isEnabled()) {
            UIComponentTools.showError("You are not authorized to access or modify these settings.");
            return;
        }//from w  ww.  j av a 2s  . c o m
        if (event.getTabSheet().getSelectedTab().equals(userAdministrationTab)) {
            userAdministrationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(groupAdministrationTab)) {
            groupAdministrationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(accessPointConfigurationTab)) {
            accessPointConfigurationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(processorConfigurationTab)) {
            processorConfigurationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(dataWorkflowConfigurationTab)) {
            dataWorkflowConfigurationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(executionEnvironmentConfigurationTab)) {
            executionEnvironmentConfigurationTab.update();
        } else if (event.getTabSheet().getSelectedTab().equals(jobScheduleConfigurationTab)) {
            jobScheduleConfigurationTab.update();
        }

        if (!event.getTabSheet().getSelectedTab().isEnabled()) {
            //check again and show error if privileges have changed...in that case recommend a reload
            UIComponentTools.showError(
                    "You are not authorized to access or modify these settings. Please reload the page.");
        }
    });

    mainLayout = new VerticalLayout(mainComponentContainer);
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);
    mainLayout.setSizeFull();
}

From source file:edu.kit.dama.ui.simon.panel.SimonMainPanel.java

License:Apache License

/**
 * Build the main layout including the update of all probes.
 *///from  w w  w . j av a2s  . co m
private void buildMainLayout() {
    tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    mainLayout = new VerticalLayout(tabSheet);
    mainLayout.setSizeFull();
    mainLayout.setMargin(true);
    reload();
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.MediaSubWindow.java

License:Open Source License

public MediaSubWindow(Resource res) {
    setCaption("Action Plan Image");
    setModal(true);/*w  w w. j  a  v  a2s  .  c  o  m*/
    setWidth("640px");
    setHeight("480px");

    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();
    setContent(tabs);

    Panel pan = new Panel();
    tabs.addTab(pan, "Fit Window");
    pan.setSizeFull();

    VerticalLayout layout = new VerticalLayout();
    pan.setContent(layout);
    layout.setSizeFull();
    layout.addStyleName("m-background-lightgrey");
    layout.setMargin(false);

    image = new ScaleImage();
    image.setSizeFull();
    image.setSource(res);

    layout.addComponent(image);
    layout.setComponentAlignment(image, Alignment.MIDDLE_CENTER);
    layout.setExpandRatio(image, 1.0f);

    tabs.addTab(buildNestedImage(res), "Actual Size");
}

From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public GameDesignPanel(boolean readonly) {
    this.allReadOnly = readonly;
    addStyleName("m-marginleft-25");

    STATEKEY = getClass().getSimpleName();

    mainVL = new VerticalLayout();
    setContent(mainVL);//from   w ww.  j  a v a2s  .com
    mainVL.setWidth("100%");

    tabSh = new TabSheet();
    tabPanels = new ArrayList<Component>();

    tabPanels.add(globPan = new GlobalEditPanel(this));
    Move m = Move.getCurrentMoveTL();
    tabPanels.add(roundsPan = new RoundsEditPanel(m, this));
    tabPanels.add(phasesPan = new PhasesEditPanel(m, this));

    roundsPan.addMoveListener(phasesPan);

    setWidth("100%");
    setHeight("100%");
}

From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public GlobalEditPanel(GameDesignGlobals globs) {
    setWidth("100%");

    tabSh = new TabSheet();

    tabPanels.add(booleansPan = new BooleansGameDesignPanel(globs));
    tabPanels.add(linksPan = new GameLinksGameDesignPanel(globs));
    tabPanels.add(headerPan = new HeaderFooterGameDesignPanel(globs));

    if (Game.getTL().isActionPlansEnabled())
        tabPanels.add(aplansPan = new ActionPlansGameDesignPanel(globs));

    tabPanels.add(mapPan = new MapGameDesignPanel(globs));
    tabPanels.add(reportsPan = new ReportsGameDesignPanel(globs));
    tabPanels.add(scorePan = new ScoringGameDesignPanel(globs));
    tabPanels.add(cacPan = new CACcardGameDesignPanel(globs));
}

From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public RoundsEditPanel(Move editMove, GameDesignGlobals globs) {
    this.moveBeingEdited = editMove;
    setWidth("100%");

    tabSh = new TabSheet();

    tabPanels.add(titlesPan = new TitlesGameDesignPanel(editMove, globs));
    tabPanels.add(topCardsPan = new TopCardsGameDesignPanel(editMove, globs));
    tabPanels.add(subCardsPan = new SubCardsGameDesignPanel(editMove, globs));
    // this is not understandable to users, nor very functional
    //tabPanels.add(seedCardsPan = new SeedCardsGameDesignPanel(editMove, globs));
    tabPanels.add(chaptersPan = new ActionPlanChaptersGameDesignPanel(editMove, globs));
}

From source file:edu.nps.moves.mmowgli.modules.administration.GameDesignPanel.java

License:Open Source License

@SuppressWarnings("serial")
@HibernateSessionThreadLocalConstructor/*from   w  ww  .  j a  v  a  2 s  .  c  o m*/
public PhasesEditPanel(Move move, GameDesignGlobals globs) {
    this.moveBeingEdited = move;
    setWidth("100%");
    setSpacing(true);
    phaseBeingEdited = moveBeingEdited.getCurrentMovePhase();
    tabSh = new TabSheet();

    tabPanels.add(titlePan = new PhaseTitlesGameDesignPanel(phaseBeingEdited, auxListener, globs));
    tabPanels.add(signupPan = new SignupHTMLGameDesignPanel(phaseBeingEdited, auxListener, globs));
    tabPanels.add(loginPan = new LoginSignupGameDesignPanel(phaseBeingEdited, auxListener, globs));
    tabPanels.add(welcomePan = new WelcomeScreenGameDesignPanel(phaseBeingEdited, auxListener, globs));
    tabPanels.add(call2ActionPan = new CallToActionGameDesignPanel(phaseBeingEdited, auxListener, globs));

    Label lab;
    addComponent(lab = new Label());
    lab.setHeight("5px");

    HorizontalLayout topHL = new HorizontalLayout();
    topHL.setSpacing(true);

    topHL.addComponent(lab = new Label());
    lab.setWidth("1px");
    topHL.setExpandRatio(lab, 0.5f);
    topHL.addComponent(topLevelLabel = new Label());
    setTopLabelText(moveBeingEdited);
    topLevelLabel.setSizeUndefined();
    topHL.addComponent(phaseSelector = new PhaseSelector(null, Move.getCurrentMoveTL()));
    phaseSelector.addValueChangeListener(new PhaseComboListener());

    topHL.addComponent(
            runningPhaseWarningLabel = new HtmlLabel("<font color='red'><i>Active game phase!</i></font>"));
    runningPhaseWarningLabel.setSizeUndefined();
    runningPhaseWarningLabel.setVisible(AbstractGameBuilderPanel.isRunningPhaseTL(phaseBeingEdited));

    topHL.addComponent(newPhaseButt = new NativeButton("Add new phase to round"));
    newPhaseButt.setEnabled(false);
    topHL.addComponent(lab = new Label());
    lab.setWidth("1px");
    topHL.setExpandRatio(lab, 0.5f);
    topHL.setWidth("100%");
    addComponent(topHL);

    propagateCB = new CheckBox("Propagate new phase-dependent edits to all other phases in this round");
    addComponent(propagateCB);
    setComponentAlignment(propagateCB, Alignment.MIDDLE_CENTER);
    propagateCB.setVisible(phaseBeingEdited.isPreparePhase());

    addComponent(lab = new HtmlLabel(
            "<b>The currently running phase is set through the Game Administrator menu</b>"));
    lab.setSizeUndefined();
    setComponentAlignment(lab, Alignment.TOP_CENTER);

    newPhaseButt.addClickListener(new ClickListener() {
        @Override
        @MmowgliCodeEntry
        @HibernateOpened
        @HibernateClosed
        public void buttonClick(ClickEvent event) {
            HSess.init();
            NewMovePhaseDialog dial = new NewMovePhaseDialog(moveBeingEdited);
            dial.addCloseListener(new CloseListener() {
                @Override
                public void windowClose(CloseEvent e) {
                    Object key = HSess.checkInit();
                    phaseSelector.fillCombo(moveBeingEdited);
                    HSess.checkClose(key);
                }
            });
            dial.showDialog();
            HSess.close();
        }
    });
}

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

License:Apache License

public void render() {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();/*from www.ja  va  2 s. co m*/

    /* 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);

}