Example usage for com.vaadin.server FontAwesome QUESTION_CIRCLE

List of usage examples for com.vaadin.server FontAwesome QUESTION_CIRCLE

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome QUESTION_CIRCLE.

Prototype

FontAwesome QUESTION_CIRCLE

To view the source code for com.vaadin.server FontAwesome QUESTION_CIRCLE.

Click Source Link

Usage

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

License:Open Source License

/**
 * Precondition: {DatasetView#table} has to be initialized. e.g. with
 * {DatasetView#buildFilterTable} If it is not, strange behaviour has to be expected. builds the
 * Layout of this view./*from   w w w  .  java  2s.  c o m*/
 */
private void buildLayout() {
    this.vert.removeAllComponents();
    this.vert.setWidth("100%");

    // Table (containing datasets) section
    VerticalLayout tableSectionDatasets = new VerticalLayout();
    VerticalLayout tableSectionSamples = new VerticalLayout();
    HorizontalLayout tableSectionContent = new HorizontalLayout();
    HorizontalLayout sampletableSectionContent = new HorizontalLayout();

    tableSectionContent.setMargin(new MarginInfo(false, false, false, false));
    sampletableSectionContent.setMargin(new MarginInfo(false, false, false, false));

    // tableSectionContent.setCaption("Datasets");
    // tableSectionContent.setIcon(FontAwesome.FLASK);

    descriptionLabel.setWidth("100%");
    tableSectionDatasets.addComponent(descriptionLabel);

    sampletableSectionContent.addComponent(sampleGrid);
    tableSectionContent.addComponent(this.datasetTable);

    tableSectionDatasets.setMargin(new MarginInfo(true, false, false, true));
    tableSectionDatasets.setSpacing(true);

    tableSectionSamples.setMargin(new MarginInfo(true, false, true, true));
    tableSectionSamples.setSpacing(true);

    tableSectionDatasets.addComponent(tableSectionContent);

    tableSectionSamples.addComponent(sampletableSectionContent);
    tableSectionSamples.addComponent(exportSamples);

    this.vert.addComponent(tableSectionDatasets);

    sampleGrid.setWidth("100%");
    datasetTable.setWidth("100%");
    tableSectionDatasets.setWidth("100%");

    tableSectionSamples.setWidth("100%");
    sampletableSectionContent.setWidth("100%");

    tableSectionContent.setWidth("100%");

    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setMargin(new MarginInfo(false, false, false, true));
    buttonLayout.setHeight(null);
    buttonLayout.setSpacing(true);

    this.download.setEnabled(false);
    buttonLayout.setSpacing(true);

    Button checkAll = new Button("Select all datasets");
    checkAll.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            for (Object itemId : datasetTable.getItemIds()) {
                ((CheckBox) datasetTable.getItem(itemId).getItemProperty("Select").getValue()).setValue(true);
            }
        }
    });

    Button uncheckAll = new Button("Unselect all datasets");
    uncheckAll.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            for (Object itemId : datasetTable.getItemIds()) {
                ((CheckBox) datasetTable.getItem(itemId).getItemProperty("Select").getValue()).setValue(false);
            }
        }
    });

    buttonLayout.addComponent(exportData);
    buttonLayout.addComponent(checkAll);
    buttonLayout.addComponent(uncheckAll);
    // buttonLayout.addComponent(visualize);
    buttonLayout.addComponent(this.download);

    String content = "<p> In case of multiple file selections, Project Browser will create a tar archive.</p>"
            + "<hr>" + "<p> If you need help on extracting a tar archive file, follow the tips below: </p>"
            + "<p>" + FontAwesome.WINDOWS.getHtml() + " Windows </p>"
            + "<p> To open/extract TAR file on Windows, you can use 7-Zip, Easy 7-Zip, PeaZip.</p>" + "<hr>"
            + "<p>" + FontAwesome.APPLE.getHtml() + " MacOS </p>"
            + "<p> To open/extract TAR file on Mac, you can use Mac OS built-in utility Archive Utility,<br> or third-part freeware. </p>"
            + "<hr>" + "<p>" + FontAwesome.LINUX.getHtml() + " Linux </p>"
            + "<p> You need to use command tar. The tar is the GNU version of tar archiving utility. <br> "
            + "To extract/unpack a tar file, type: $ tar -xvf file.tar</p>";

    PopupView tooltip = new PopupView(new helpers.ToolTip(content));
    tooltip.setHeight("44px");

    HorizontalLayout help = new HorizontalLayout();
    help.setSizeFull();
    HorizontalLayout helpContent = new HorizontalLayout();
    // helpContent.setSizeFull();

    help.setMargin(new MarginInfo(false, false, false, true));
    Label helpText = new Label("Attention: Click here before Download!");
    helpContent.addComponent(new Label(FontAwesome.QUESTION_CIRCLE.getHtml(), ContentMode.HTML));
    helpContent.addComponent(helpText);
    helpContent.addComponent(tooltip);
    helpContent.setSpacing(true);

    help.addComponent(helpContent);
    help.setComponentAlignment(helpContent, Alignment.TOP_CENTER);

    /**
     * prepare download.
     */
    download.setResource(new ExternalResource("javascript:"));
    download.setEnabled(false);

    for (final Object itemId : this.datasetTable.getItemIds()) {
        setCheckedBox(itemId, (String) this.datasetTable.getItem(itemId).getItemProperty("CODE").getValue());
    }

    this.datasetTable.addItemClickListener(new ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            if (!event.isDoubleClick() & !((boolean) datasetTable.getItem(event.getItemId())
                    .getItemProperty("isDirectory").getValue())) {
                String datasetCode = (String) datasetTable.getItem(event.getItemId()).getItemProperty("CODE")
                        .getValue();
                String datasetFileName = (String) datasetTable.getItem(event.getItemId())
                        .getItemProperty("File Name").getValue();
                URL url = null;
                try {
                    Resource res = null;
                    Object parent = datasetTable.getParent(event.getItemId());
                    if (parent != null) {

                        String parentDatasetFileName = (String) datasetTable.getItem(parent)
                                .getItemProperty("File Name").getValue();
                        try {
                            url = datahandler.getOpenBisClient().getUrlForDataset(datasetCode,
                                    parentDatasetFileName + "/" + URLEncoder.encode(datasetFileName, "UTF-8"));
                        } catch (UnsupportedEncodingException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                    } else {
                        try {
                            url = datahandler.getOpenBisClient().getUrlForDataset(datasetCode,
                                    URLEncoder.encode(datasetFileName, "UTF-8"));
                        } catch (UnsupportedEncodingException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                    }

                    Window subWindow = new Window();
                    VerticalLayout subContent = new VerticalLayout();
                    subContent.setMargin(true);
                    subContent.setSizeFull();
                    subWindow.setContent(subContent);
                    QbicmainportletUI ui = (QbicmainportletUI) UI.getCurrent();
                    Boolean visualize = false;

                    if (datasetFileName.endsWith(".pdf")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("application/pdf");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".png")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("application/png");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".qcML")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/xml");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".alleles")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/plain");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".tsv")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/plain");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".log")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/plain");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".html")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/html");
                        res = streamres;
                        visualize = true;
                    }

                    if (datasetFileName.endsWith(".GSvar")) {
                        QcMlOpenbisSource re = new QcMlOpenbisSource(url);
                        StreamResource streamres = new StreamResource(re, datasetFileName);
                        streamres.setMIMEType("text/plain");
                        res = streamres;
                        visualize = true;
                    }

                    if (visualize) {
                        BrowserFrame frame = new BrowserFrame("", res);

                        frame.setSizeFull();
                        subContent.addComponent(frame);

                        // Center it in the browser window
                        subWindow.center();
                        subWindow.setModal(true);
                        subWindow.setSizeUndefined();
                        subWindow.setHeight("75%");
                        subWindow.setWidth("75%");
                        subWindow.setResizable(false);

                        frame.setSizeFull();
                        frame.setHeight("100%");
                        // frame.setHeight((int) (ui.getPage().getBrowserWindowHeight() * 0.9), Unit.PIXELS);

                        // Open it in the UI
                        ui.addWindow(subWindow);
                    }

                } catch (MalformedURLException e) {
                    LOGGER.error(String.format("Visualization failed because of malformedURL for dataset: %s",
                            datasetCode));
                    helpers.Utils.Notification("No file attached.",
                            "Given dataset has no file attached to it!! Please Contact your project manager. Or check whether it already has some data",
                            "error");

                    // Notification
                    // .show(
                    // "Given dataset has no file attached to it!! Please Contact your project manager. Or
                    // check whether it already has some data",
                    // Notification.Type.ERROR_MESSAGE);
                }
            }
        }
    });
    this.vert.addComponent(help);
    this.vert.addComponent(buttonLayout);
    this.vert.addComponent(tableSectionSamples);

}

From source file:fr.amapj.view.engine.enumselector.EnumSearcher.java

License:Open Source License

/**
 * Permet de crer une combo box permettant de choisir parmi une liste de Enum
 * avec possibilit d'indiquer comment afficher les libelles 
 *  //w  w  w .ja v a2s  .  c om
 * @param binder
 * @param title
 * @param enumeration donne la liste  afficher
 * @param propertyId
 * @return
 */
static public <T extends Enum<T>> HorizontalLayout createEnumSearcher(FieldGroup binder, String title,
        String propertyId, T... enumsToExcludes) {
    Class<T> enumeration = binder.getItemDataSource().getItemProperty(propertyId).getType();
    if (enumeration.isEnum() == false) {
        throw new AmapjRuntimeException("Le champ " + title + " n'est pas de type enum");
    }

    HelpInfo metaData = MetaDataEnum.getHelpInfo(enumeration);

    ComboBox comboBox = new ComboBox();
    comboBox.setWidth("300px");

    EnumSet<T> enums = EnumSet.allOf(enumeration);
    for (T en : enums) {
        if (isAllowed(en, enumsToExcludes)) {
            String caption = getCaption(metaData, en);

            comboBox.addItem(en);
            comboBox.setItemCaption(en, caption);
        }
    }

    binder.bind(comboBox, propertyId);

    comboBox.setImmediate(true);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setCaption(title);
    hl.addComponent(comboBox);

    if (metaData != null) {

        Button aide = new Button();
        aide.setIcon(FontAwesome.QUESTION_CIRCLE);
        aide.addStyleName("borderless-colored");
        aide.addStyleName("question-mark");
        aide.addClickListener(e -> handleAide(metaData));

        hl.addComponent(aide);
    }

    return hl;
}

From source file:fr.amapj.view.engine.popup.formpopup.AbstractFormPopup.java

License:Open Source License

protected TextField addIntegerField(String title, String propertyId, String helpContent) {
    TextField f = BaseUiTools.createIntegerField(null);
    binder.bind(f, propertyId);/*from w w  w.j a v  a 2 s  . co  m*/

    Button aide = new Button();
    aide.setIcon(FontAwesome.QUESTION_CIRCLE);
    aide.addStyleName("borderless-colored");
    aide.addStyleName("question-mark");
    aide.addClickListener(e -> handleAide(helpContent));

    HorizontalLayout hl = new HorizontalLayout();
    hl.setCaption(title);
    hl.addComponent(f);
    hl.addComponent(aide);

    form.addComponent(hl);
    return f;
}

From source file:fr.amapj.view.engine.popup.formpopup.AbstractFormPopup.java

License:Open Source License

protected Button addHelpButton(String title, String helpContent) {
    Button aide = new Button(title);
    aide.setIcon(FontAwesome.QUESTION_CIRCLE);
    aide.addStyleName("borderless-colored");
    aide.addStyleName("question-mark");
    aide.addClickListener(e -> handleAide(helpContent));

    HorizontalLayout hl = new HorizontalLayout();
    hl.setWidth(100, Unit.PERCENTAGE);// w w w. j av  a2s.c  o m
    hl.addComponent(aide);
    hl.setComponentAlignment(aide, Alignment.MIDDLE_RIGHT);

    form.addComponent(hl);

    return aide;
}

From source file:org.eclipse.hawkbit.ui.components.SPUIComponentProvider.java

License:Open Source License

/**
 * Generates help/documentation links from within management UI.
 *
 * @param i18n/*  ww w.j  a  v  a2s.  c o  m*/
 *            the i18n
 * @param uri
 *            to documentation site
 *
 * @return generated link
 */
public static Link getHelpLink(final VaadinMessageSource i18n, final String uri) {

    final Link link = new Link("", new ExternalResource(uri));
    link.setTargetName("_blank");
    link.setIcon(FontAwesome.QUESTION_CIRCLE);
    link.setDescription(i18n.getMessage("tooltip.documentation.link"));
    return link;

}

From source file:org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterTable.java

License:Open Source License

private Component getStatusIcon(final Object itemId) {
    final Item row1 = getItem(itemId);
    final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1
            .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
    final Label label = new LabelBuilder().name("").buildLabel();
    label.setContentMode(ContentMode.HTML);
    if (targetStatus == TargetUpdateStatus.PENDING) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW);
        label.setValue(FontAwesome.ADJUST.getHtml());
    } else if (targetStatus == TargetUpdateStatus.REGISTERED) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
        label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
    } else if (targetStatus == TargetUpdateStatus.ERROR) {
        label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR)));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC));
        label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN));
        label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
    }//from   w  w  w  .  j a va2s  .c o  m
    return label;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

protected Component buildLinks() {

    final HorizontalLayout links = new HorizontalLayout();
    links.setSpacing(true);/*  ww w .  j  a  va2 s.  c o  m*/
    links.addStyleName("links");
    final String linkStyle = "v-link";

    if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
        final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                i18n.getMessage("link.documentation.name"),
                uiProperties.getLinks().getDocumentation().getRoot(), FontAwesome.QUESTION_CIRCLE, "_blank",
                linkStyle);
        links.addComponent(docuLink);
        docuLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
        final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
                i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
                FontAwesome.SHOPPING_CART, "", linkStyle);
        links.addComponent(requestAccountLink);
        requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
        final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                FontAwesome.USERS, "_blank", linkStyle);
        links.addComponent(userManagementLink);
        userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    return links;
}

From source file:org.eclipse.hawkbit.ui.login.LoginView.java

License:Open Source License

private Component buildLinks() {

    final HorizontalLayout links = new HorizontalLayout();
    links.setSpacing(true);//  w ww . j  ava2s . c  om
    links.addStyleName("links");
    final String linkStyle = "v-link";

    if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
        final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                i18n.getMessage("link.documentation.name"),
                uiProperties.getLinks().getDocumentation().getRoot(), FontAwesome.QUESTION_CIRCLE, "_blank",
                linkStyle);
        links.addComponent(docuLink);
        docuLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getDemo().getUser().isEmpty()) {
        final Link demoLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DEMO,
                i18n.getMessage("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle);
        links.addComponent(demoLink);
        demoLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
        final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
                i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
                FontAwesome.SHOPPING_CART, "", linkStyle);
        links.addComponent(requestAccountLink);
        requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
        final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                FontAwesome.USERS, "_blank", linkStyle);
        links.addComponent(userManagementLink);
        userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    return links;
}

From source file:org.eclipse.hawkbit.ui.menu.DashboardMenu.java

License:Open Source License

private VerticalLayout buildLinksAndVersion() {
    final VerticalLayout links = new VerticalLayout();
    links.setSpacing(true);/*from www  . j  a  va 2s.c  o m*/
    links.addStyleName("links");
    final String linkStyle = "v-link";

    if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
        final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                i18n.getMessage("link.documentation.name"),
                uiProperties.getLinks().getDocumentation().getRoot(), FontAwesome.QUESTION_CIRCLE, "_blank",
                linkStyle);
        docuLink.setSizeFull();
        links.addComponent(docuLink);
        links.setComponentAlignment(docuLink, Alignment.BOTTOM_CENTER);
    }

    if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
        final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                FontAwesome.USERS, "_blank", linkStyle);
        links.addComponent(userManagementLink);
        userManagementLink.setSizeFull();
        links.setComponentAlignment(userManagementLink, Alignment.BOTTOM_CENTER);
    }

    if (!uiProperties.getLinks().getSupport().isEmpty()) {
        final Link supportLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_SUPPORT,
                i18n.getMessage("link.support.name"), uiProperties.getLinks().getSupport(),
                FontAwesome.ENVELOPE_O, "", linkStyle);
        supportLink.setSizeFull();
        links.addComponent(supportLink);
        links.setComponentAlignment(supportLink, Alignment.BOTTOM_CENTER);

    }

    final Component buildVersionInfo = buildVersionInfo();
    links.addComponent(buildVersionInfo);
    links.setComponentAlignment(buildVersionInfo, Alignment.BOTTOM_CENTER);
    links.setSizeFull();
    links.setHeightUndefined();
    return links;
}

From source file:org.jumpmind.metl.ui.common.TopBar.java

License:Open Source License

public TopBar(ViewManager vm, ApplicationContext context) {
    setWidth(100, Unit.PERCENTAGE);/* w ww  . java 2  s.c  o  m*/
    this.context = context;
    this.viewManager = vm;
    this.viewManager.addViewChangeListener(this);

    viewToButtonMapping = new HashMap<String, MenuItem>();

    menuBar = new MenuBar();
    menuBar.setWidth(100, Unit.PERCENTAGE);
    addComponent(menuBar);
    setExpandRatio(menuBar, 1.0f);

    String systemText = getGlobalSetting(GlobalSetting.SYSTEM_TEXT, "").getValue();
    if (isNotBlank(systemText)) {
        Button systemLabel = new Button(systemText, FontAwesome.WARNING);
        systemLabel.setHtmlContentAllowed(true);
        addComponent(systemLabel);
    }

    Button helpButton = new Button("Help", FontAwesome.QUESTION_CIRCLE);
    helpButton.addClickListener(event -> openHelp(event));
    addComponent(helpButton);

    Button settingsButton = new Button(context.getUser().getLoginId(), FontAwesome.GEAR);
    settingsButton.addClickListener((event) -> {
    });
    addComponent(settingsButton);

    Button logoutButton = new Button("Logout", FontAwesome.SIGN_OUT);
    logoutButton.addClickListener(event -> logout());
    addComponent(logoutButton);

    Map<Category, List<TopBarLink>> menuItemsByCategory = viewManager.getMenuItemsByCategory();
    Set<Category> categories = menuItemsByCategory.keySet();
    for (Category category : categories) {
        if (!context.getUser().hasPrivilege(category.name())) {
            log.info("'{}' does not have access to the {} menu tab", context.getUser(), category.name());
            continue;
        }
        List<TopBarLink> links = menuItemsByCategory.get(category);
        boolean needDefaultView = viewManager.getDefaultView() == null && links.size() > 0;
        MenuItem categoryItem = null;
        if (links.size() > 1) {
            categoryItem = menuBar.addItem(category.name(), null);
            categoryItems.add(categoryItem);
        }

        if (needDefaultView) {
            viewManager.setDefaultView(links.get(0).id());
        }

        for (final TopBarLink menuLink : links) {
            Command command = new Command() {

                private static final long serialVersionUID = 1L;

                @Override
                public void menuSelected(MenuItem selectedItem) {
                    uncheckAll();
                    selectedItem.setChecked(true);
                    viewManager.navigateTo(menuLink.id());
                }
            };
            MenuItem menuItem = null;
            if (categoryItem == null) {
                menuItem = menuBar.addItem(menuLink.name(), command);
            } else {
                menuItem = categoryItem.addItem(menuLink.name(), command);
            }
            menuItem.setCheckable(true);
            viewToButtonMapping.put(menuLink.id(), menuItem);
        }
    }
    viewManager.navigateTo(viewManager.getDefaultView());
}