Example usage for com.vaadin.ui PopupView.Content PopupView.Content

List of usage examples for com.vaadin.ui PopupView.Content PopupView.Content

Introduction

In this page you can find the example usage for com.vaadin.ui PopupView.Content PopupView.Content.

Prototype

PopupView.Content

Source Link

Usage

From source file:com.esofthead.mycollab.community.vaadin.web.ui.field.PopupFieldBuilder.java

License:Open Source License

public PopupView build() {
    view = new PopupView(new PopupView.Content() {
        @Override/*from   w ww .j av a2 s . co  m*/
        public String getMinimizedValueAsHTML() {
            return captionHtml;
        }

        @Override
        public Component getPopupComponent() {
            MVerticalLayout layout = new MVerticalLayout();
            layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
            Label infoLbl = new Label(
                    AppContext.getMessage(GenericI18Enum.NOTIFICATION_FEATURE_NOT_AVAILABLE_IN_VERSION));

            Button requestFeatureBtn = new Button("Buy the premium edition", new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                    UI.getCurrent().addWindow(new AdWindow());
                    view.setPopupVisible(false);
                }
            });
            requestFeatureBtn.addStyleName(UIConstants.BUTTON_ACTION);

            layout.with(infoLbl, requestFeatureBtn);
            return layout;
        }
    });
    view.setDescription(description);
    view.setStyleName("block-popupedit");
    return view;
}