Example usage for com.vaadin.ui Button setDescription

List of usage examples for com.vaadin.ui Button setDescription

Introduction

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

Prototype

public void setDescription(String description) 

Source Link

Document

Sets the component's description.

Usage

From source file:org.opennms.features.vaadin.surveillanceviews.ui.SurveillanceViewsConfigList.java

License:Open Source License

/**
 * Constructor for creating this component.
 *
 * @param surveillanceViewService the surveillance view service to be used
 *//*from ww w .j  a  v a  2  s  .  com*/
public SurveillanceViewsConfigList(SurveillanceViewService surveillanceViewService) {
    /**
     * set the fields
     */
    this.m_surveillanceViewService = surveillanceViewService;

    /**
     * Loading the config
     */
    reloadSurveillanceViews();

    /**
     * Setting up the layout component
     */
    setSizeFull();
    setMargin(true);
    setSpacing(true);

    Label label = new Label("Surveillance View Configurations");
    label.addStyleName("configuration-title");

    /*
    Button button = new Button("Help");
    button.setStyleName("small");
    button.setDescription("Display help and usage");
    */

    /**
     * button.addClickListener(new HelpClickListener(this, m_wallboardConfigView.getDashletSelector()));
     */

    Button addButton = new Button("Add");
    addButton.setStyleName("small");
    addButton.setDescription("Add surveillance view configuration");

    addButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            String newName;
            int i = 0;

            do {
                i++;
                newName = "Untitled #" + i;
            } while (SurveillanceViewProvider.getInstance().containsView(newName));

            View view = new View();
            view.setName(newName);

            getUI().addWindow(new SurveillanceViewConfigurationWindow(m_surveillanceViewService, view,
                    new SurveillanceViewConfigurationWindow.SaveActionListener() {
                        @Override
                        public void save(View view) {
                            m_beanItemContainer.addItem(view);

                            SurveillanceViewProvider.getInstance().getSurveillanceViewConfiguration().getViews()
                                    .add(view);
                            SurveillanceViewProvider.getInstance().save();

                            ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Data saved",
                                    "Surveillance View");

                            m_table.refreshRowCache();
                            m_table.sort(new Object[] { "name" }, new boolean[] { true });
                        }
                    }));
        }
    });

    HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.addComponent(label);
    // horizontalLayout.addComponent(button);
    horizontalLayout.setWidth(100, Unit.PERCENTAGE);

    horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
    // horizontalLayout.setComponentAlignment(button, Alignment.MIDDLE_RIGHT);

    addComponent(horizontalLayout);

    addComponent(addButton);

    /**
     * Adding the table with the required {@link com.vaadin.ui.Table.ColumnGenerator} objects
     */
    m_table = new Table();

    m_table.setContainerDataSource(m_beanItemContainer);
    m_table.setSizeFull();
    m_table.sort(new Object[] { "name" }, new boolean[] { true });

    m_table.addGeneratedColumn("Edit", new Table.ColumnGenerator() {
        public Object generateCell(Table source, final Object itemId, Object columnId) {
            Button button = new Button("Edit");
            button.setDescription("Edit this Surveillance View configuration");
            button.setStyleName("small");
            button.addClickListener(new Button.ClickListener() {
                public void buttonClick(Button.ClickEvent clickEvent) {
                    getUI().addWindow(new SurveillanceViewConfigurationWindow(m_surveillanceViewService,
                            m_beanItemContainer.getItem(itemId).getBean(),
                            new SurveillanceViewConfigurationWindow.SaveActionListener() {
                                @Override
                                public void save(View view) {
                                    View oldView = m_beanItemContainer.getItem(itemId).getBean();

                                    m_beanItemContainer.removeItem(itemId);
                                    m_beanItemContainer.addItem(view);

                                    SurveillanceViewProvider.getInstance().replaceView(oldView, view);

                                    SurveillanceViewProvider.getInstance().save();
                                    ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Data saved",
                                            "Surveillance view");

                                    m_table.refreshRowCache();
                                    m_table.sort(new Object[] { "name" }, new boolean[] { true });
                                }
                            }));
                }
            });
            return button;
        }
    }

    );

    m_table.addGeneratedColumn("Remove", new Table.ColumnGenerator() {
        public Object generateCell(Table source, final Object itemId, Object columnId) {
            Button button = new Button("Remove");
            button.setDescription("Delete this Surveillance View configuration");
            button.setStyleName("small");
            button.addClickListener(new Button.ClickListener() {
                public void buttonClick(Button.ClickEvent clickEvent) {
                    SurveillanceViewProvider.getInstance().removeView((View) itemId);
                    m_beanItemContainer.removeItem(itemId);
                }
            });
            return button;
        }
    });

    m_table.addGeneratedColumn("Preview", new Table.ColumnGenerator() {
        public Object generateCell(Table source, final Object itemId, Object columnId) {
            Button button = new Button("Preview");
            button.setDescription("Preview this Surveillance View configuration");
            button.setStyleName("small");

            button.addClickListener(new PreviewClickListener(m_surveillanceViewService,
                    SurveillanceViewsConfigList.this, (View) itemId));

            return button;
        }
    }

    );

    m_table.addGeneratedColumn("Default", new Table.ColumnGenerator() {
        public Object generateCell(Table source, final Object itemId, Object columnId) {
            CheckBox checkBox = new CheckBox();
            checkBox.setImmediate(true);
            checkBox.setDescription("Make this Surveillance View configuration the default");

            final View view = m_beanItemContainer.getItem(itemId).getBean();

            checkBox.setValue(SurveillanceViewProvider.getInstance().getSurveillanceViewConfiguration()
                    .getDefaultView().equals(view.getName()));

            checkBox.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
                    boolean newValue = ((Boolean) valueChangeEvent.getProperty().getValue());

                    if (newValue) {
                        SurveillanceViewProvider.getInstance().getSurveillanceViewConfiguration()
                                .setDefaultView(view.getName());
                    }

                    m_table.refreshRowCache();

                    SurveillanceViewProvider.getInstance().save();

                    ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Data saved",
                            "Default surveillance view");
                }
            });
            return checkBox;
        }
    }

    );

    m_table.setVisibleColumns(new Object[] { "name", "Edit", "Remove", "Preview", "Default" });
    m_table.setColumnHeader("name", "Name");

    /**
     * Adding the table
     */
    addComponent(m_table);

    setExpandRatio(m_table, 1.0f);
}

From source file:org.ripla.web.demo.widgets.views.ButtonWidgetsView.java

License:Open Source License

public ButtonWidgetsView() {
    super();/*from   w w w .  ja  va 2 s .c om*/

    final IMessages lMessages = Activator.getMessages();
    final VerticalLayout lLayout = initLayout(lMessages, "widgets.title.page.button"); //$NON-NLS-1$

    lLayout.addComponent(getSubtitle(lMessages.getMessage("widgets.view.button.subtitle.button"))); //$NON-NLS-1$
    final Button lButton = new Button(lMessages.getMessage("widgets.view.button.label.save")); //$NON-NLS-1$
    lButton.setDescription(lMessages.getMessage("widgets.view.button.descr.normal")); //$NON-NLS-1$
    lButton.addClickListener(new Listener(lMessages.getMessage("widgets.view.button.feedback.normal"))); //$NON-NLS-1$
    lLayout.addComponent(lButton);

    lLayout.addComponent(getSubtitle(lMessages.getMessage("widgets.view.button.label.image"))); //$NON-NLS-1$
    final Button lButton2 = new Button(lMessages.getMessage("widgets.view.button.label.save")); //$NON-NLS-1$
    lButton2.setIcon(new ThemeResource("../runo/icons/16/ok.png")); //$NON-NLS-1$
    lButton2.setDescription(lMessages.getMessage("widgets.view.button.label.image")); //$NON-NLS-1$
    lButton2.addClickListener(new Listener(lMessages.getMessage("widgets.view.button.feedback.image"))); //$NON-NLS-1$
    lLayout.addComponent(lButton2);

    lLayout.addComponent(getSubtitle(lMessages.getMessage("widgets.view.button.subtitle.disable"))); //$NON-NLS-1$
    lLayout.addComponent(new Label(lMessages.getMessage("widgets.view.button.label.disable"))); //$NON-NLS-1$
    final Button lButton3 = new Button(lMessages.getMessage("widgets.view.button.label.click")); //$NON-NLS-1$
    lButton3.setDisableOnClick(true);
    lButton3.setDescription(lMessages.getMessage("widgets.view.button.descr.disable")); //$NON-NLS-1$
    lButton3.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent inEvent) {
            try {
                Thread.sleep(3000);
            } catch (final InterruptedException exc) {
            }
            Notification.show(lMessages.getMessage("widgets.view.button.feedback.disable"),
                    Notification.Type.TRAY_NOTIFICATION);
            inEvent.getButton().setEnabled(true);
        }
    });
    lLayout.addComponent(lButton3);

    lLayout.addComponent(getSubtitle(lMessages.getMessage("widgets.view.button.subtitle.link"))); //$NON-NLS-1$
    final Button lButton4 = new Button(lMessages.getMessage("widgets.view.button.label.click")); //$NON-NLS-1$
    lButton4.setStyleName(BaseTheme.BUTTON_LINK);
    lButton4.addClickListener(new Listener(lMessages.getMessage("widgets.view.button.feedback.link"))); //$NON-NLS-1$
    lLayout.addComponent(new Label(lMessages.getMessage("widgets.view.button.label.link"))); //$NON-NLS-1$
    lLayout.addComponent(lButton4);

    lLayout.addComponent(getSubtitle(lMessages.getMessage("widgets.view.button.subtitle.check"))); //$NON-NLS-1$
    lLayout.addComponent(new Label(lMessages.getMessage("widgets.view.button.label.check"))); //$NON-NLS-1$
    final CheckBox lCheckbox = new CheckBox(lMessages.getMessage("widgets.view.button.label.click")); //$NON-NLS-1$
    lCheckbox.setImmediate(true);
    lCheckbox.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(final ValueChangeEvent inEvent) {
            Notification.show(lMessages.getMessage("widgets.view.button.feedback.check"),
                    Notification.Type.TRAY_NOTIFICATION);

        }
    });
    lLayout.addComponent(lCheckbox);
}

From source file:org.s23m.cell.editor.semanticdomain.ui.components.ContainmentTreePanel.java

License:Mozilla Public License

private Panel createSearchPanel() {
    final Panel searchPanel = new Panel();
    final HorizontalLayout searchLayout = new HorizontalLayout();
    searchLayout.setWidth(TAB_SHEET_HEIGHT_RATIO);
    searchLayout.setSpacing(true);/*from  w w  w .j  a va  2s . c om*/
    searchPanel.addStyleName(Runo.PANEL_LIGHT);
    searchPanel.getLayout().setMargin(true);
    searchPanel.setLayout(searchLayout);

    searchText = new TextField();
    searchText.setWidth(TAB_SHEET_HEIGHT_RATIO);

    final Button searchBtn = new Button();
    searchBtn.setDescription("Search");
    searchBtn.setClickShortcut(KeyCode.ENTER);
    searchBtn.setIcon(EditorIcon.SEARCH.getIconImage());
    searchBtn.setWidth(null);
    searchBtn.addListener(Button.ClickEvent.class, this, INSTANCE_SEARCH_CMD);

    searchPanel.addComponent(searchText);
    searchPanel.addComponent(searchBtn);

    searchLayout.setExpandRatio(searchText, SEARCH_TEXT_EXPANSION_RATIO);

    return searchPanel;
}

From source file:org.s23m.cell.editor.semanticdomain.ui.components.ContainmentTreePanel.java

License:Mozilla Public License

private Panel createOperationsPanel() {
    final Panel operationsPanel = new Panel();
    final HorizontalLayout operationsPanelLayout = new HorizontalLayout();
    operationsPanelLayout.setWidth(TAB_SHEET_HEIGHT_RATIO);
    operationsPanelLayout.setSpacing(true);
    operationsPanel.addStyleName(Runo.PANEL_LIGHT);
    operationsPanel.getLayout().setMargin(true);
    operationsPanel.setLayout(operationsPanelLayout);

    commitButton = new Button();
    commitButton.setDescription("Commit");
    commitButton.setIcon(EditorIcon.PERSIST.getIconImage());
    commitButton.addListener(Button.ClickEvent.class, this, CHANGESET_COMMIT_CMD);

    rollbackButton = new Button();
    rollbackButton.setDescription("Rollback");
    // TODO use a more appropriate icon
    rollbackButton.setIcon(EditorIcon.DELETE.getIconImage());
    rollbackButton.addListener(Button.ClickEvent.class, this, CHANGESET_ROLLBACK_CMD);

    commitButton.setImmediate(true);/*from   w  ww.j  a v a  2 s  .co  m*/
    rollbackButton.setImmediate(true);
    commitButton.setEnabled(false);
    rollbackButton.setEnabled(false);

    final Button retrievalBtn = new Button();
    retrievalBtn.setDescription("Retrieve");
    retrievalBtn.setIcon(EditorIcon.RETRIEVE.getIconImage());
    retrievalBtn.setWidth(null);
    retrievalBtn.addListener(Button.ClickEvent.class, this, INSTANCE_RETRIEVAL_CMD);

    operationsPanel.addComponent(retrievalBtn);
    operationsPanel.addComponent(commitButton);
    operationsPanel.addComponent(rollbackButton);

    return operationsPanel;
}

From source file:org.sensorhub.ui.AdminUI.java

License:Mozilla Public License

protected Component buildToolbar() {
    HorizontalLayout toolbar = new HorizontalLayout();
    toolbar.setWidth(100.0f, Unit.PERCENTAGE);

    // apply changes button
    Button saveButton = new Button("Save Config");
    saveButton.setDescription("Save Config");
    saveButton.setIcon(UIConstants.APPLY_ICON);
    saveButton.addStyleName(UIConstants.STYLE_SMALL);
    saveButton.setWidth(100.0f, Unit.PERCENTAGE);

    // apply button action
    saveButton.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            try {
                SensorHub.getInstance().getModuleRegistry().saveModulesConfiguration();
            } catch (Exception e) {
                AdminUI.log.error("Error while saving SensorHub configuration", e);
                Notification.show("Error", e.getMessage(), Notification.Type.ERROR_MESSAGE);
            }//from ww w  .j  av a2  s. co m
        }
    });

    toolbar.addComponent(saveButton);
    return toolbar;
}

From source file:org.sensorhub.ui.SensorAdminPanel.java

License:Mozilla Public License

@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final ISensorModule<?> module) {
    super.build(beanItem, module);

    // add section label
    final GridLayout form = new GridLayout();
    form.setWidth(100.0f, Unit.PERCENTAGE);
    form.setMargin(false);//from   w w  w.jav a  2  s.  c  om
    form.setSpacing(true);

    // section title
    form.addComponent(new Label(""));
    HorizontalLayout titleBar = new HorizontalLayout();
    titleBar.setSpacing(true);
    Label sectionLabel = new Label("Inputs/Outputs");
    sectionLabel.addStyleName(STYLE_H3);
    sectionLabel.addStyleName(STYLE_COLORED);
    titleBar.addComponent(sectionLabel);
    titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);

    // refresh button to show latest record
    Button refreshButton = new Button("Refresh");
    refreshButton.setDescription("Load latest data from sensor");
    refreshButton.setIcon(REFRESH_ICON);
    refreshButton.addStyleName(STYLE_QUIET);
    titleBar.addComponent(refreshButton);
    titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
    refreshButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            rebuildSwePanels(form, module);
        }
    });

    form.addComponent(titleBar);

    // add I/O panel
    rebuildSwePanels(form, module);
    addComponent(form);
}

From source file:org.sensorhub.ui.StorageAdminPanel.java

License:Mozilla Public License

@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final IRecordStorageModule<?> storage) {
    super.build(beanItem, storage);

    if (storage != null) {
        // section layout
        final GridLayout form = new GridLayout();
        form.setWidth(100.0f, Unit.PERCENTAGE);
        form.setMargin(false);//w ww . j av  a2  s  .  c o  m
        form.setSpacing(true);

        // section title
        form.addComponent(new Label(""));
        HorizontalLayout titleBar = new HorizontalLayout();
        titleBar.setSpacing(true);
        Label sectionLabel = new Label("Data Store Content");
        sectionLabel.addStyleName(STYLE_H3);
        sectionLabel.addStyleName(STYLE_COLORED);
        titleBar.addComponent(sectionLabel);
        titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);

        // refresh button to show latest record
        Button refreshButton = new Button("Refresh");
        refreshButton.setDescription("Reload data from storage");
        refreshButton.setIcon(REFRESH_ICON);
        refreshButton.addStyleName(STYLE_QUIET);
        titleBar.addComponent(refreshButton);
        titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
        refreshButton.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;

            @Override
            public void buttonClick(ClickEvent event) {
                buildDataPanel(form, storage);
            }
        });

        form.addComponent(titleBar);

        // add I/O panel
        buildDataPanel(form, storage);
        addComponent(form);
    }
}

From source file:org.vaadin.addons.core.window.DialogWindow.java

License:Apache License

private VerticalLayout buildContent(String title, VaadinIcons type, Component content,
        ButtonType[] buttonTypes) {/*  w w  w . j ava 2  s. c o  m*/
    VerticalLayout root = new VerticalLayout();
    root.setMargin(false);
    root.setSpacing(false);

    float width = -1;
    float height = 0;

    if (title != null) {
        HorizontalLayout header = new HorizontalLayout();
        header.setMargin(true);
        header.setHeightUndefined();
        header.setWidth("100%");
        header.addStyleName(ValoTheme.WINDOW_TOP_TOOLBAR);
        Label l = new Label("<font size=\"4\">" + title + "</font>", ContentMode.HTML);
        width = l.getWidth();
        header.addComponent(l);
        header.setComponentAlignment(l, Alignment.MIDDLE_LEFT);

        if (type != null) {
            Label i = new Label(type.getHtml(), ContentMode.HTML);
            header.addComponent(i);
            header.setComponentAlignment(i, Alignment.MIDDLE_RIGHT);
        }

        height = header.getHeight();
        root.addComponent(header);
    }

    if (content != null) {
        content.setSizeFull();
        HorizontalLayout contentRoot = new HorizontalLayout(content);
        contentRoot.setMargin(true);
        root.addComponent(contentRoot);
        height = height + contentRoot.getHeight();
    }

    HorizontalLayout footer = new HorizontalLayout();
    footer.setHeightUndefined();
    footer.setWidth("100%");
    footer.setMargin(true);
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);

    HorizontalLayout buttons = new HorizontalLayout();
    if (buttonTypes != null) {
        Stream.of(buttonTypes).forEach(buttonType -> {
            Button b = new Button(buttonType.getCaption());
            if (buttonType.getIcon() != null) {
                b.setIcon(buttonType.getIcon());
            }
            if (buttonType.getDescription() != null) {
                b.setDescription(buttonType.getDescription());
            }
            if (buttonType.getStyle() != null) {
                b.addStyleName(buttonType.getStyle());
            }
            b.addClickListener(event -> buttonType.getActions().forEach(buttonAction -> {
                ButtonTypeClickEvent event1 = new ButtonTypeClickEvent(buttonType, DialogWindow.this);
                buttonAction.getListener().buttonClick(event1);
            }));
            buttons.addComponent(b);
        });
    }
    buttons.setSizeUndefined();
    buttons.setMargin(false);
    buttons.setSpacing(true);

    footer.addComponent(buttons);
    footer.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);

    if (buttons.getWidth() > width) {
        width = buttons.getWidth();
    }

    root.addComponent(footer);
    root.setComponentAlignment(footer, Alignment.BOTTOM_LEFT);
    height = height + footer.getHeight();

    root.setHeight(height, Unit.PIXELS);
    root.setWidth(width, Unit.PIXELS);
    return root;
}

From source file:probe.com.view.body.quantcompare.PieChart.java

public PieChart(String title, double full, double found, final String notfound) {

    this.setWidth(200 + "px");
    this.setHeight(200 + "px");
    defaultKeyColorMap.put("Found", new Color(110, 177, 206));
    defaultKeyColorMap.put("Not found", new Color(219, 169, 1));
    otherSymbols.setGroupingSeparator('.');
    this.setStyleName("click");

    labels = new String[] { "Found", "Not found" };

    double foundPercent = ((found / full) * 100.0);
    df = new DecimalFormat("#.##", otherSymbols);
    valuesMap.put("Found", ((int) found) + " (" + df.format(foundPercent) + "%)");
    values = new Double[] { foundPercent, 100.0 - foundPercent };
    valuesMap.put("Not found", ((int) (full - found)) + " (" + df.format(100.0 - foundPercent) + "%)");

    String defaultImgURL = initPieChart(200, 200, title);
    chartImg.setSource(new ExternalResource(defaultImgURL));
    this.addComponent(chartImg);
    this.addLayoutClickListener(PieChart.this);

    popupLayout = new PopupView(null, popupBody);
    popupLayout.setHideOnMouseOut(false);
    popupBody.setWidth("300px");
    popupBody.setStyleName(Reindeer.LAYOUT_WHITE);
    popupBody.setHeightUndefined();//from   w w w .java2 s  . c o m
    this.addComponent(popupLayout);
    this.notfound = notfound.replace(" ", "").replace(",", "/n");

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setWidth("100%");
    topLayout.setHeight("20px");

    Label header = new Label("<b>Not Found (New Proteins)</b>");
    header.setStyleName(Reindeer.LABEL_SMALL);
    topLayout.addComponent(header);
    header.setContentMode(ContentMode.HTML);

    VerticalLayout closeBtn = new VerticalLayout();
    closeBtn.setWidth("10px");
    closeBtn.setHeight("10px");
    closeBtn.setStyleName("closebtn");
    topLayout.addComponent(closeBtn);
    topLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);
    closeBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            popupLayout.setPopupVisible(false);
        }
    });
    popupBody.addComponent(topLayout);
    popupBody.addComponent(textArea);
    textArea.setWidth("100%");
    textArea.setHeight("150px");
    textArea.setValue(this.notfound);
    textArea.setReadOnly(true);
    popupBody.setSpacing(true);

    HorizontalLayout bottomLayout = new HorizontalLayout();
    bottomLayout.setWidth("100%");
    bottomLayout.setHeight("40px");
    bottomLayout.setMargin(new MarginInfo(false, true, true, true));
    popupBody.addComponent(bottomLayout);

    Button exportTableBtn = new Button("");
    exportTableBtn.setHeight("24px");
    exportTableBtn.setWidth("24px");
    exportTableBtn.setPrimaryStyleName("exportxslbtn");
    exportTableBtn.setDescription("Export table data");
    exportTableBtn.addClickListener(new Button.ClickListener() {

        private Table table;

        @Override
        public void buttonClick(Button.ClickEvent event) {

            if (table == null) {
                table = new Table();
                table.addContainerProperty("Index", Integer.class, null, "", null, Table.Align.RIGHT);
                table.addContainerProperty("Accession", String.class, Table.Align.CENTER);
                table.setVisible(false);
                addComponent(table);
                int i = 1;
                for (String str : notfound.replace(" ", "").replace(",", "\n").split("\n")) {
                    table.addItem(new Object[] { i, str }, i++);
                }

            }

            ExcelExport csvExport = new ExcelExport(table, "Not found protein accessions (New proteins)");
            //                csvExport.setReportTitle("CSF-PR /  Not found protein accessions (New proteins) ");
            csvExport.setExportFileName("CSF-PR - Not found protein accessions" + ".xls");
            csvExport.setMimeType(CsvExport.EXCEL_MIME_TYPE);
            csvExport.setDisplayTotals(false);
            csvExport.setExcelFormatOfProperty("Index", "#0;[Red] #0");
            csvExport.export();

        }
    });

    bottomLayout.addComponent(exportTableBtn);
    bottomLayout.setComponentAlignment(exportTableBtn, Alignment.MIDDLE_RIGHT);

}

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.DiseaseGroupsListFilter.java

/**
 *
 * @param Quant_Central_Manager//from  www.j a v a2s .c om
 */
public DiseaseGroupsListFilter(final QuantCentralManager Quant_Central_Manager) {
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.setWidth("450px");
    //        this.Quant_Central_Manager.registerFilterListener(DiseaseGroupsListFilter.this);

    //        this.updatePatientGroups(Quant_Central_Manager.getFilteredDatasetsList());
    //        String[] pgArr = merge(patGr1, patGr2);
    this.patientGroupIFilter = new ListSelectDatasetExplorerFilter(1, "Disease Group I",
            Quant_Central_Manager.getSelectedHeatMapRows());
    initGroupsIFilter();

    this.patientGroupIIFilter = new ListSelectDatasetExplorerFilter(2, "Disease Group II",
            Quant_Central_Manager.getSelectedHeatMapColumns());
    initGroupsIIFilter();
    diseaseGroupsSet = new LinkedHashSet<String>();
    diseaseGroupsSet.addAll(Quant_Central_Manager.getSelectedHeatMapRows());

    this.addComponent(patientGroupIIFilter);

    diseaseGroupsFilterBtn = new Button("Disease Groups");
    diseaseGroupsFilterBtn.setStyleName(Reindeer.BUTTON_LINK);
    diseaseGroupsFilterBtn.addClickListener(DiseaseGroupsListFilter.this);

    VerticalLayout popupBody = new VerticalLayout();

    VerticalLayout filtersConatinerLayout = new VerticalLayout();
    filtersConatinerLayout.setSpacing(true);
    filtersConatinerLayout.setWidth("500px");
    filtersConatinerLayout.setHeightUndefined();

    popupBody.addComponent(filtersConatinerLayout);

    HorizontalLayout btnLayout = new HorizontalLayout();
    popupBody.addComponent(btnLayout);
    btnLayout.setSpacing(true);
    btnLayout.setMargin(new MarginInfo(false, false, true, true));

    Button applyFilters = new Button("Apply");
    applyFilters.setDescription("Apply the selected filters");
    applyFilters.setPrimaryStyleName("resetbtn");
    applyFilters.setWidth("50px");
    applyFilters.setHeight("24px");

    btnLayout.addComponent(applyFilters);
    applyFilters.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
        }
    });

    Button resetFiltersBtn = new Button("Reset");
    resetFiltersBtn.setPrimaryStyleName("resetbtn");
    btnLayout.addComponent(resetFiltersBtn);
    resetFiltersBtn.setWidth("50px");
    resetFiltersBtn.setHeight("24px");

    resetFiltersBtn.setDescription("Reset all applied filters");
    resetFiltersBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Quant_Central_Manager.resetFiltersListener();
        }
    });

    popupWindow = new Window() {
        @Override
        public void close() {
            if (updateManager) {
                updateSelectionManager(studiesIndexes);
            }

            popupWindow.setVisible(false);

        }
    };
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidth((540) + "px");
    popupWindow.setHeight((500) + "px");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.center();
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Disease Groups Comparisons</font>");

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

    popupWindow.setCaptionAsHtml(true);
    popupWindow.setClosable(true);

    this.setHeightUndefined();
    filtersConatinerLayout.addComponent(DiseaseGroupsListFilter.this);
    filtersConatinerLayout.setComponentAlignment(DiseaseGroupsListFilter.this, Alignment.BOTTOM_CENTER);
    //        Quant_Central_Manager.setSelectedHeatMapRows(selectedRows);
    //        Quant_Central_Manager.setSelectedHeatMapColumns(selectedColumns);

}