Example usage for com.vaadin.server FontAwesome MONEY

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

Introduction

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

Prototype

FontAwesome MONEY

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

Click Source Link

Usage

From source file:de.metas.procurement.webui.ui.view.DailyReportingView.java

License:Open Source License

public DailyReportingView() {
    super();//  w ww.  ja v  a  2 s .c  o  m

    addStyleName(STYLE);

    //
    // Top
    {
        final NavigationBar navigationBar = getNavigationBar();
        navigationBar.setCaption(i18n.get("DailyReportingView.caption"));

        final NavigationButton logoutButton = new NavigationButton(i18n.get("Logout.caption"));
        logoutButton.setTargetView(this);
        logoutButton.addClickListener(new NavigationButtonClickListener() {
            @Override
            public void buttonClick(final NavigationButtonClickEvent event) {
                onLogout();
            }
        });
        navigationBar.setRightComponent(logoutButton);
    }

    //
    // Content
    {
        final VerticalLayout content = new VerticalLayout();

        // Date
        {
            datePanel = new DateNavigation();
            datePanel.addDateChangedListener(new PropertyChangeListener() {

                @Override
                public void propertyChange(final PropertyChangeEvent evt) {
                    onDayChanged(datePanel.getDate());
                }
            });

            final VerticalComponentGroup datePanelGroup = new VerticalComponentGroup();
            datePanelGroup.addComponent(datePanel);
            content.addComponent(datePanelGroup);
        }

        // Product buttons
        productButtons = new BeansVerticalComponentGroup<ProductQtyReport>() {
            @Override
            protected Component createItemComponent(final BeanItem<ProductQtyReport> item) {
                final ProductItemButton itemComp = new ProductItemButton();
                itemComp.setItem(item);
                return itemComp;
            };
        };
        content.addComponent(productButtons);

        setContent(content);
    }

    //
    // Toolbar (bottom)
    {
        final Button weekViewButton = new Button(i18n.get("DailyReportingView.weekViewButton"));
        weekViewButton.setStyleName("no-decoration");
        weekViewButton.setIcon(FontAwesome.CALENDAR);
        weekViewButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                onWeekView();
            }
        });

        final Button addProductButton = new Button(i18n.get("DailyReportingView.addProductButton"));
        addProductButton.setStyleName("no-decoration");
        addProductButton.setIcon(FontAwesome.PLUS);
        addProductButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                onProductAdd();
            }
        });

        final Button rfqButton = new Button(i18n.get("DailyReportingView.rfqButton"));
        rfqButton.setStyleName("no-decoration");
        rfqButton.setIcon(FontAwesome.MONEY);
        rfqButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                onRfQ();
            }
        });

        final ISendService sendService = MFProcurementUI.getCurrentMFSession().getSendService();
        final Button sendButton = new Button(i18n.get("DailyReportingView.sendButton"));
        sendButton.setStyleName("no-decoration");
        sendButton.setIcon(FontAwesome.CHECK);
        final TextOverlay sendButtonOverlay = TextOverlay.extend(sendButton);
        sendButtonOverlay.setPropertyDataSource(sendService.getNotSentCounterProperty());
        sendButtonOverlay.setConverter(TextOverlay.CONVERTER_PositiveCounterOrNull);
        sendButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                onSend();
            }
        });

        final Button infoButton = new Button(i18n.getWithDefault("InfoMessageView.caption.short", "Info"));
        infoButton.setStyleName("no-decoration");
        infoButton.setIcon(FontAwesome.INFO);
        infoButton.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                onInfo();
            }
        });

        final Toolbar toolbar = new Toolbar();
        toolbar.addComponents(weekViewButton, addProductButton, sendButton, infoButton, rfqButton);
        setToolbar(toolbar);
    }

    //
    // Initialize
    final Date today = DateUtils.getToday();
    final Date date = DateUtils.addDays(today, +1); // tomorrow (FRESH-196)
    datePanel.setDate(date);
}