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:com.foc.vaadin.gui.RightPanel.java

License:Apache License

public void init() {
    tabSheet = new TabSheet();
    tabSheet.setHeight("800px");
    tabSheet.setWidth("100%");
    addComponent(tabSheet);/*from  w  ww  .jav a  2s. c  om*/

    //    tabSheet.addListener(new TabSheet.SelectedTabChangeListener() {
    //      
    //      @Override
    //      public void selectedTabChange(SelectedTabChangeEvent event) {
    //        Component tab = tabSheet.getSelectedTab();
    //        
    //        if (getLayoutArray() != null) {
    //          if (tab.equals(paletteTab)) {
    //            for (FVLayout layout : getLayoutArray()){
    //              layout.setDragDrop(true);
    //            }
    //          }
    //        }
    //      }
    //    });

    firstTab = new AbsoluteLayout();
    firstTab.setHeight("800px");
    firstTab.setWidth("100%");
    firstTab.setSizeFull();
    firstTab.setCaption("Edit Panel");

    paletteTab = new AbsoluteLayout();
    paletteTab.setHeight("800px");
    paletteTab.setWidth("100%");
    paletteTab.setSizeFull();
    paletteTab.setCaption("Palette");
    paletteTreeContainer = new HierarchicalContainer();
    paletteTreeContainer.addContainerProperty("name", String.class, null);

    Iterator<String> iter = FVGUIFactory.getInstance().keySet().iterator();
    while (iter != null && iter.hasNext()) {
        String tag = iter.next();
        paletteTreeContainer.addItem(tag);
        paletteTreeContainer.setChildrenAllowed(tag, false);
    }
    /*
    for (int i = 0; i < paletteLabels.length; i++) {
      paletteTreeContainer.addItem(paletteLabels[i]);
      paletteTreeContainer.setChildrenAllowed(paletteLabels[i], false);
    }
    */

    paletteTree = new FVTree();
    paletteTree.setContainerDataSource(paletteTreeContainer);
    paletteTab.addComponent(paletteTree);

    treeContainerPanel = new Panel();
    treeContainerPanel.setStyleName(Reindeer.PANEL_LIGHT);
    treeContainerPanel.setHeight("400px");

    save = new Button();
    save.setIcon(FVIconFactory.getInstance().getFVIcon(FVIconFactory.ICON_SAVE));
    save.setStyleName(BaseTheme.BUTTON_LINK);

    createField = new Button();
    createField.setIcon(FVIconFactory.getInstance().getFVIcon(FVIconFactory.ICON_ADD));
    createField.setStyleName(BaseTheme.BUTTON_LINK);

    //    fieldTree = new FVTree();

    INavigationWindow mainWindow = (INavigationWindow) FocWebApplication.getInstanceForThread()
            .getNavigationWindow();
    DataModelNodeTree dataModelNodeTree = new DataModelNodeTree(new DataModelNodeList(getFocDesc(), 3));

    XMLViewKey xmlViewKey = new XMLViewKey(AdminWebModule.RIGHT_PANEL_STORAGE, XMLViewKey.TYPE_TREE,
            XMLViewKey.CONTEXT_DEFAULT, XMLViewKey.VIEW_DEFAULT);
    setRightPanelTree((FocRightPanel_Tree) XMLViewDictionary.getInstance().newCentralPanel(mainWindow,
            xmlViewKey, dataModelNodeTree));

    refreshTree();

    tabSheet.addTab(firstTab, "Edit");
    tabSheet.addTab(paletteTab, "Palette");

    populate();
}

From source file:com.github.mjvesa.herd.HerdIDE.java

License:Apache License

private TabSheet constructFilesAndStatus() {
    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();/*from   w  w  w.  j av a  2 s. c om*/
    tabs.addTab(constructFilesTab(), "Files", null);
    tabs.addTab(constructStatusTab(), "Status", null);
    return tabs;
}

From source file:com.github.mjvesa.herd.HerdIDE.java

License:Apache License

private Component constructEditorAndLayout() {
    TabSheet ts = new TabSheet();
    ts.setSizeFull();/*  w ww.java 2  s  .  c o m*/
    ts.addTab(constructEditorTab(), "Editor", null);
    ts.addTab(constructOutputTab(), "Output", null);
    return ts;
}

From source file:com.gnts.asm.txn.AssetDetails.java

License:Open Source License

private void buildView(HorizontalLayout hlInput) {
    // Initialization for tfSearchAssetDetailsDesc
    tfAssetDetailDesc = new GERPTextArea("Asset Details");
    tfservicerequire = new GERPTextField("ServiceRequired");
    // Initialization for cbSearchAssetStatus
    cbAssetStatus = new GERPComboBox("Status", BASEConstants.T_AMS_ASSET_DETAILS, BASEConstants.ASSETSTATUS);
    cbAssetStatus.setItemCaptionPropertyId("desc");
    cbAssetStatus.setWidth("140px");
    // category//from   w w w  . j  a  v  a  2 s.com
    cbCategory = new GERPComboBox("Category");
    cbCategory.setItemCaptionPropertyId("catgryName");
    loadCategory();
    // Initialization for btnSearch
    btnSearch = new Button("Search", this);
    btnSearch.setStyleName("searchbt");
    // Initialization for btnReset
    btnReset = new Button("Reset", this);
    btnReset.setStyleName("resetbt");
    cbAction = new GERPComboBox("Reviewed By");
    cbReview = new GERPComboBox("Action By");
    cbAction.setItemCaptionPropertyId("firstname");
    cbReview.setItemCaptionPropertyId("firstname");
    loadEmployee();
    // Initialization for btnEdit
    btnEdit = new Button("Edit", this);
    btnEdit.setStyleName("editbt");
    btnEdit.setEnabled(false);
    // Initialization for btnHome
    btnHome = new Button("Home", this);
    btnHome.setStyleName("homebtn");
    btnHome.setEnabled(false);
    // Initialization for tfAssetName
    tfAssetName = new GERPTextField("Asset Name");
    tfAssetName.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            tfAssetName.setComponentError(null);
            if (tfAssetName.getValue() != null) {
                tfAssetName.setComponentError(null);
            }
        }
    });
    // Initialization for tfCategoryId
    tfCategoryId = new GERPTextField("Category Id");
    tfCategoryId.setValue("0");
    tfCategoryId.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            tfCategoryId.setComponentError(null);
            if (tfCategoryId.getValue() != null) {
                tfCategoryId.setComponentError(null);
            }
        }
    });
    // Initialization for tfAssetTypes
    cbAssetType = new GERPComboBox("Asset Type", BASEConstants.T_AMS_ASSET_DETAILS, BASEConstants.ASSET_TYPE);
    cbAssetType.setWidth("148");
    cbAssetType.setRequired(true);
    cbAssetType.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            cbAssetType.setComponentError(null);
            if (cbAssetType.getValue() != null) {
                cbAssetType.setComponentError(null);
            }
        }
    });
    // Used to Load Brand Name in Combo box
    cbBrand = new GERPComboBox("Brand Name");
    cbBrand.setWidth("148");
    cbBrand.setNullSelectionAllowed(false);
    cbBrand.setItemCaptionPropertyId("brandname");
    loadBrandDetails();
    cbBrand.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            cbBrand.setComponentError(null);
            if (cbBrand.getValue() != null) {
                cbBrand.setComponentError(null);
            }
        }
    });
    // Used to Load Region Name in Combo box
    cbDept = new GERPComboBox("Department Name");
    cbDept.setWidth("148");
    cbDept.setNullSelectionAllowed(false);
    cbDept.setItemCaptionPropertyId("deptname");
    loadDepartment();
    cbDept.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            cbDept.setComponentError(null);
            if (cbDept.getValue() != null) {
                cbDept.setComponentError(null);
            }
        }
    });
    //
    cbBranch = new GERPComboBox("Branch");
    cbBranch.setWidth("148");
    cbBranch.setItemCaptionPropertyId("branchName");
    loadBranchList();
    tfSerialNo = new GERPTextField("Serial No.");
    tfMfgSerialNo = new GERPTextField("MFG.Serial No.");
    tfAssetLocation = new GERPTextField("Asset Location");
    tfAssetLocation.setRequired(true);
    // Initialization for dtPurchaseDate
    dtPurchaseDate = new GERPPopupDateField("Purchase Date");
    dtPurchaseDate.setDateFormat("dd-MMM-yyyy");
    // Initialization for tfPurchaseValue
    tfPurchaseValue = new GERPTextField("Purchase Value");
    tfPurchaseValue.setValue("0");
    // Initialization for tfInvoiceNo
    tfInvoiceNo = new GERPTextField("Invoice No.");
    // Initialization for dtWarrentyDate
    dtWarrentyDate = new GERPPopupDateField("Warrenty End Date");
    dtWarrentyDate.setDateFormat("dd-MMM-yyyy");
    // Initialization for dtLastServiceDate
    dtLastServiceDate = new GERPPopupDateField("Last Service Date");
    dtLastServiceDate.setDateFormat("dd-MMM-yyyy");
    // Initialization for dtNextServiceDate
    dtNextServiceDate = new GERPPopupDateField("Next Service Date");
    dtNextServiceDate.setDateFormat("dd-MMM-yyyy");
    // Initialization for tfSalvageValue
    tfSalvageValue = new GERPTextField("Salvage Value");
    tfSalvageValue.setValue("0");
    // Initialization for tfLifeInYears
    tfLifeInYears = new GERPTextField("Life In Years");
    tfLifeInYears.setWidth("148");
    tfLifeInYears.setValue("0");
    // Initialization for tfLifeInMonths
    tfLifeInMonths = new GERPTextField("Life In Months");
    tfLifeInMonths.setWidth("148");
    tfLifeInMonths.setValue("0");
    // Initialization for tfLicenseInfo
    tfLicenseInfo = new GERPTextField("License Info. ");
    tfLicenseInfo.setWidth("148");
    // Initialization for tfRemarks
    tfRemarks = new GERPTextArea("Remarks");
    tfRemarks.setWidth("148");
    taWarrentyDesc = new GERPTextArea("Warrenty Description");
    taWarrentyDesc.setWidth("148");
    tabSheet = new TabSheet();
    vlAssetSpec = new VerticalLayout();
    vlOwnDetails = new VerticalLayout();
    // Initialization for btnSave
    btnSave = new Button("Save", this);
    btnSave.setStyleName("savebt");
    // Initialization for btnCancel
    btnCancel = new Button("Cancel", this);
    btnCancel.setStyleName("cancelbt");
    hlsavecancel = new HorizontalLayout();
    hlsavecancel.addComponent(btnSave);
    hlsavecancel.addComponent(btnCancel);
    hlsavecancel.setVisible(false);
    hlSearchLayout = new GERPAddEditHLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    assembleSearchLayout();
    resetFields();
    loadSrchRslt();
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractPageModContentFactoryImpl.java

License:Apache License

/**
 * Creates the page visit history./* ww w.j  a  v  a  2s  . c  om*/
 *
 * @param pageName
 *            the page name
 * @param pageId
 *            the page id
 * @param panelContent
 *            the panel content
 */
protected final void createPageVisitHistory(final String pageName, final String pageId,
        final VerticalLayout panelContent) {

    final TabSheet tabsheet = new TabSheet();
    tabsheet.setWidth(100, Unit.PERCENTAGE);
    tabsheet.setHeight(100, Unit.PERCENTAGE);

    panelContent.addComponent(tabsheet);
    panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE);

    final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout();
    tabContentPageItemRankHistory.setWidth(100, Unit.PERCENTAGE);
    tabContentPageItemRankHistory.setHeight(100, Unit.PERCENTAGE);
    final Tab tabPageItemRankHistory = tabsheet.addTab(tabContentPageItemRankHistory);

    tabPageItemRankHistory.setCaption(CURRENT_PAGE_VISIT_HISTORY);
    adminChartDataManager.createApplicationActionEventPageElementDailySummaryChart(
            tabContentPageItemRankHistory, pageName, pageId);

    final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout();
    tabContentPageModeSummary.setWidth(100, Unit.PERCENTAGE);
    tabContentPageModeSummary.setHeight(100, Unit.PERCENTAGE);
    final Tab tabPageModeSummary = tabsheet.addTab(tabContentPageModeSummary);
    tabPageModeSummary.setCaption(GENERAL_PAGE_MODE_PAGE_VISIT);

    adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(tabContentPageModeSummary,
            pageName);

}

From source file:com.hack23.cia.web.impl.ui.application.views.user.ballot.pagemode.BallotChartsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override//from   ww  w  .  j  a  va  2  s  . c o  m
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenVoteDataBallotSummary, RiksdagenVoteDataBallotEmbeddedId> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenVoteDataBallotSummary.class);

    final DataContainer<ViewRiksdagenVoteDataBallotPartySummary, RiksdagenVoteDataBallotPartyEmbeddedId> dataPartyContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenVoteDataBallotPartySummary.class);

    final List<ViewRiksdagenVoteDataBallotSummary> ballots = dataContainer.findListByEmbeddedProperty(
            ViewRiksdagenVoteDataBallotSummary.class, ViewRiksdagenVoteDataBallotSummary_.embeddedId,
            RiksdagenVoteDataBallotEmbeddedId.class, RiksdagenVoteDataBallotEmbeddedId_.ballotId, pageId);

    final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotList = dataPartyContainer
            .findListByEmbeddedProperty(ViewRiksdagenVoteDataBallotPartySummary.class,
                    ViewRiksdagenVoteDataBallotPartySummary_.embeddedId,
                    RiksdagenVoteDataBallotPartyEmbeddedId.class,
                    RiksdagenVoteDataBallotPartyEmbeddedId_.ballotId, pageId);

    if (!ballots.isEmpty()) {
        getBallotMenuItemFactory().createBallotMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, CHARTS);

        final TabSheet tabsheet = new TabSheet();
        tabsheet.setWidth(100, Unit.PERCENTAGE);
        tabsheet.setHeight(100, Unit.PERCENTAGE);

        panelContent.addComponent(tabsheet);
        panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE);

        Collections.sort(ballots,
                (Comparator<ViewRiksdagenVoteDataBallotSummary>) (o1,
                        o2) -> (o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern())
                                .compareTo(o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern()));

        for (final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary : ballots) {
            final HorizontalLayout tabContent = new HorizontalLayout();
            tabContent.setWidth(100, Unit.PERCENTAGE);
            tabContent.setHeight(100, Unit.PERCENTAGE);
            final Tab tab = tabsheet.addTab(tabContent);

            ballotChartDataManager.createChart(tab, tabContent, viewRiksdagenVoteDataBallotSummary);
        }

        final Map<String, List<ViewRiksdagenVoteDataBallotPartySummary>> concernIssuePartyBallotSummaryMap = createIssueConcernMap(
                partyBallotList);

        for (final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotSummaryList : concernIssuePartyBallotSummaryMap
                .values()) {
            final HorizontalLayout tabContent = new HorizontalLayout();
            tabContent.setWidth(100, Unit.PERCENTAGE);
            tabContent.setHeight(100, Unit.PERCENTAGE);
            final Tab tab = tabsheet.addTab(tabContent);

            ballotChartDataManager.createChart(tab, tabContent, partyBallotSummaryList);
        }

        panel.setCaption(BALLOT + pageId);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_BALLOT_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }
    return panelContent;

}

From source file:com.hris.payroll.PayrollUI.java

private void getPayrollTab() {
    TabSheet tab = new TabSheet();
    tab.setSizeFull();/*  ww  w .j  a va2  s  . c o  m*/

    VerticalLayout v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(ledger);
    tab.addTab(v, "Payroll Ledger");

    v = new VerticalLayout();
    v.setSizeFull();
    tab.addTab(v, "Payroll Register");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(tm);
    tab.addTab(v, "13th Month");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(al);
    tab.addTab(v, "Alpha List");

    v = new VerticalLayout();
    v.setSizeFull();
    v.addComponent(reportUI);
    tab.addTab(v, "Reports");

    addComponent(tab);
}

From source file:com.logviewer.ui.dialog.LastMinute.java

License:Open Source License

private Component buildContetDialog(int minutes) {
    final Map<String, String> lastMinute = tailService.loadLastMinute(configuration.getRoot(), minutes);
    TabSheet panelContent = new TabSheet() {
        {//w  w w.  j av  a2  s  .  com
            setSizeFull();
            addStyleName("framed padded-tabbar");
        }
    };
    for (Map.Entry<String, String> entry : lastMinute.entrySet()) {
        addTab(panelContent, entry.getValue(), entry.getKey());
    }

    return panelContent;
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoDetails.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();/*from  www.  j a  v  a 2s .c o m*/
    setCaption(ui.getMessage("todo.detailsTitle"));

    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();
    tabs.addTab(createTodoInfo(ui), ui.getMessage("todo.header"));
    tabs.addTab(createProcessInfo(ui), ui.getMessage("process.header"));
    setContent(tabs);

    //      Button close = new Button("Close", new Button.ClickListener() {
    //            // inline click-listener
    //            public void buttonClick(ClickEvent event) {
    //                // close the window by removing it from the parent window
    //                (subwindow.getParent()).removeWindow(subwindow);
    //            }
    //        });
    //        // The components added to the window are actually added to the window's
    //        // layout; you can use either. Alignments are set using the layout
    //        layout.addComponent(close);
    //        layout.setComponentAlignment(close, Alignment.TOP_RIGHT);

}

From source file:com.m4gik.views.component.LibraryScreen.java

/**
 * @param audioFile//from  w ww . j ava  2  s  . co m
 * @return
 */
private CssLayout addDetails(AudioFile audioFile) {
    CssLayout details = new CssLayout();
    details.setWidth("100%");

    Label title = new Label("<h3>" + audioFile.getArtist() + "&ndash;" + audioFile.getTitle() + "</h3>",
            ContentMode.HTML);
    details.addComponent(title);
    title.setSizeUndefined();

    TabSheet tabs = new TabSheet();
    tabs.addStyleName(Runo.TABSHEET_SMALL);
    tabs.setWidth("100%");
    tabs.setHeight("180px");
    details.addComponent(tabs);

    FormLayout formLayout = new FormLayout();
    tabs.addTab(formLayout, "Info");

    Label text = new Label(audioFile.getTitle());
    text.setCaption("Title:");
    formLayout.addComponent(text);

    text = new Label(audioFile.getArtist());
    text.setCaption("Artist:");
    formLayout.addComponent(text);

    text = new Label(audioFile.getAlbum());
    text.setCaption("Album:");
    formLayout.addComponent(text);

    text = new Label(audioFile.getGenre());
    text.setCaption("Genre:");
    formLayout.addComponent(text);

    text = new Label(audioFile.getPrice() + "$");
    text.setCaption("Price");
    formLayout.addComponent(text);

    formLayout = new FormLayout();
    tabs.addTab(formLayout, "Decription");
    text = new Label(audioFile.getAbout());
    formLayout.addComponent(text);

    formLayout = new FormLayout();
    tabs.addTab(formLayout, "Lyrics");
    text = new Label(audioFile.getLyrics());
    formLayout.addComponent(text);

    return details;
}