Example usage for com.vaadin.ui Button addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:nl.info.magnolia.solr.app.SolrManagementAppViewImpl.java

License:Open Source License

protected Component createSolrServerInformationSection() {
    FormLayout layout = new FormLayout();

    Label serverInformationSectionTitle = new Label(i18n.translate("solr.app.serverInformation.label.title"));
    serverInformationSectionTitle.addStyleName(STYLE_SECTION_TITLE);

    // build and bind fields
    Component solrServerStatus = buildAndBind(SolrManagementSubApp.SOLR_SERVER_STATUS,
            i18n.translate("solr.app.serverInformation.serverStatus"));
    Component nrDocumentsInIndex = buildAndBind(SolrManagementSubApp.SOLR_SERVER_NUMBER_OF_DOCUMENTS,
            i18n.translate("solr.app.serverInformation.numberOfDocsInIndex"));

    Button refreshSolrServerStatusButton = new Button(
            i18n.translate("solr.app.serverInformation.button.refreshSolrServerStatus.caption"),
            event -> listener.refreshView());
    refreshSolrServerStatusButton.addStyleName(STYLE_V_BUTTON_SMALLAPP);
    refreshSolrServerStatusButton.addStyleName(STYLE_COMMIT);

    VerticalLayout buttons = new VerticalLayout();
    buttons.addStyleName(STYLE_BUTTONS);
    buttons.setSpacing(true);/*w w  w.jav  a 2 s  . c om*/
    buttons.addComponent(refreshSolrServerStatusButton);

    layout.addComponent(serverInformationSectionTitle);
    layout.addComponent(solrServerStatus);
    layout.addComponent(nrDocumentsInIndex);
    layout.addComponent(buttons);

    return layout;
}

From source file:nl.info.magnolia.solr.app.SolrManagementAppViewImpl.java

License:Open Source License

protected Component createSolrIndexManagementSection() {
    FormLayout layout = new FormLayout();

    Label manageSolrSectionTitle = new Label(i18n.translate("solr.app.manageSolrIndex.label.intro"));
    manageSolrSectionTitle.addStyleName(STYLE_SECTION_TITLE);
    layout.addComponent(manageSolrSectionTitle);
    layout.addComponent(new Label(i18n.translate("solr.app.manageSolrIndex.label.description")));

    Button clearSolrIndexButton = new Button(
            i18n.translate("solr.app.management.button.clearSolrIndex.caption"),
            event -> listener.clearSolrIndex());
    clearSolrIndexButton.addStyleName(STYLE_V_BUTTON_SMALLAPP);
    clearSolrIndexButton.addStyleName(STYLE_COMMIT);

    VerticalLayout buttons = new VerticalLayout();
    buttons.addStyleName(STYLE_BUTTONS);
    buttons.setSpacing(true);//from  ww  w . ja v a  2 s.  c  o  m
    buttons.addComponent(clearSolrIndexButton);

    layout.addComponent(buttons);
    return layout;
}

From source file:nl.info.magnolia.solr.app.SolrManagementAppViewImpl.java

License:Open Source License

protected Component createSolrCrawlerManagementSection() {
    FormLayout layout = new FormLayout();

    Label manageSolrSectionTitle = new Label(i18n.translate("solr.app.manageSolrCrawlers.label.intro"));
    manageSolrSectionTitle.addStyleName(STYLE_SECTION_TITLE);
    layout.addComponent(manageSolrSectionTitle);

    Map<String, CrawlerConfig> crawlers = contentIndexerModule.getCrawlers();
    if (crawlers.isEmpty()) {
        layout.addComponent(/* w  w w. j  a v a 2s.c  om*/
                new Label(i18n.translate("solr.app.manageSolrCrawlers.noCrawlers.label.description")));
    } else {
        layout.addComponent(new Label(i18n.translate("solr.app.manageSolrCrawlers.label.description")));

        VerticalLayout buttons = new VerticalLayout();
        buttons.addStyleName(STYLE_BUTTONS);
        buttons.setSpacing(true);

        // only create buttons for crawlers that have been configured and are enabled in the content-indexer module.
        for (Map.Entry<String, CrawlerConfig> crawler : crawlers.entrySet()) {
            CrawlerConfig crawlerConfig = crawler.getValue();
            Button runSolrCrawlerButton = new Button(
                    i18n.translate("solr.app.management.button.runSolrCrawler.caption") + " "
                            + crawlerConfig.getName(),
                    event -> listener.runSolrCrawlerCommand(crawlerConfig.getName()));
            runSolrCrawlerButton.addStyleName(STYLE_V_BUTTON_SMALLAPP);
            runSolrCrawlerButton.addStyleName(STYLE_COMMIT);
            buttons.addComponent(runSolrCrawlerButton);
        }
        layout.addComponent(buttons);
    }
    return layout;
}

From source file:nl.kpmg.lcm.ui.Application.java

License:Apache License

private Button createNavigationButton(String caption, final String viewName) {
    Button button = new Button(caption);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener(new ClickListener() {
        @Override//ww w.  j a v a  2  s . c  om
        public void buttonClick(ClickEvent event) {
            getUI().getNavigator().navigateTo(viewName);
        }
    });
    return button;
}

From source file:nl.kpmg.lcm.ui.Application.java

License:Apache License

private Button createLogoutButton(String caption) {
    Button button = new Button(caption);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener(new ClickListener() {
        @Override//  w  ww . ja va2s .  c  om
        public void buttonClick(ClickEvent event) {
            try {
                restClientService.logout();
                navigator.navigateTo("login");
            } catch (AuthenticationException ex) {
                Notification.show("Error! unable to logout sucessfully.");
            }
        }
    });
    return button;
}

From source file:nl.kpmg.lcm.ui.Application.java

License:Apache License

private Button createNotImplementedButton(String caption) {
    Button button = new Button(caption);
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addClickListener(new ClickListener() {
        @Override/* w  ww .  j  a  va  2 s .  co m*/
        public void buttonClick(ClickEvent event) {
            Notification.show("This functionality is not yet implemented.");
        }
    });
    return button;
}

From source file:nl.kpmg.lcm.ui.view.administration.AuthorizedLcmPanel.java

License:Apache License

private Button initRefreshButton() {
    Button refreshButton = new Button("Refresh");
    refreshButton.addClickListener((Button.ClickEvent event) -> {
        updateAuthorizedLcmTable();//from  ww  w .jav a  2s . c  om
    });
    refreshButton.addStyleName("margin-10");

    return refreshButton;
}

From source file:nl.kpmg.lcm.ui.view.administration.AuthorizedLcmPanel.java

License:Apache License

private Button initCreateButton(RestClientService restClientService1) {
    Button createButton = new Button("Create");
    createButton.addClickListener((Button.ClickEvent event) -> {
        AuthorizedLcmCreateWindow authorizedLcmCreateWindow = new AuthorizedLcmCreateWindow(restClientService1,
                this);
        UI.getCurrent().addWindow(authorizedLcmCreateWindow);
    });/*from  w  w  w . ja v a 2s. c o  m*/
    createButton.addStyleName("margin-10");

    return createButton;
}

From source file:nl.kpmg.lcm.ui.view.administration.AuthorizedLcmPanel.java

License:Apache License

private HorizontalLayout createActionsLayout(AuthorizedLcmRepresentation item) {

    HorizontalLayout actionsLayout = new HorizontalLayout();

    Button viewButton = new Button("view");
    viewButton.setData(item);/*w  w  w. java 2  s  .com*/
    viewButton.addClickListener((event) -> {
        AuthorizedLcmRepresentation data = (AuthorizedLcmRepresentation) event.getButton().getData();
        setSelectedAuthorizedLcm(data);
    });
    viewButton.addStyleName("link");

    Button editButton = new Button("edit");
    editButton.setData(item);
    editButton.addClickListener(new EditAuthorizedLcmListener(this, restClientService));
    editButton.addStyleName("link");

    Button deleteButton = new Button("delete");
    deleteButton.setData(item);
    deleteButton.addClickListener(new DeleteAuthorizedLcmListener(this, restClientService));
    deleteButton.addStyleName("link");

    actionsLayout.addComponent(viewButton);
    actionsLayout.addComponent(editButton);
    actionsLayout.addComponent(deleteButton);

    return actionsLayout;
}

From source file:nl.kpmg.lcm.ui.view.administration.RemoteLcmPanel.java

License:Apache License

private Button initRefreshButton() {
    Button refreshButton = new Button("Refresh");
    refreshButton.addClickListener((Button.ClickEvent event) -> {
        refreshRemoteLcmTable();/*w w  w  .  ja v  a2 s .  c om*/
    });
    refreshButton.addStyleName("margin-10");

    return refreshButton;
}