Example usage for com.vaadin.ui PopupView setDescription

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

Introduction

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

Prototype

public void setDescription(String description) 

Source Link

Document

Sets the component's description.

Usage

From source file:org.opencms.ui.components.CmsToolBar.java

License:Open Source License

/**
 * Creates a drop down menu.<p>//from   w w w . j a  v a 2  s.c  o  m
 *
 * @param buttonHtml the button HTML
 * @param content the drop down content
 * @param title the button title
 *
 * @return the component
 */
public static Component createDropDown(String buttonHtml, Component content, String title) {

    PopupView pv = new PopupView(buttonHtml, content);
    pv.setDescription(title);
    pv.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN);
    pv.setHideOnMouseOut(false);
    return pv;
}

From source file:org.opencms.ui.components.CmsToolBar.java

License:Open Source License

/**
 * Creates the app select drop down.<p>
 *
 * @return the drop down component/*from w  ww.j  av a 2 s. c  om*/
 */
private Component createQuickLaunchDropDown() {

    PopupView pv = new PopupView(new PopupView.Content() {

        private static final long serialVersionUID = 1L;

        public String getMinimizedValueAsHTML() {

            return getDropDownButtonHtml(FontOpenCms.APPS);
        }

        public Component getPopupComponent() {

            CmsObject cms = A_CmsUI.getCmsObject();
            Locale locale = UI.getCurrent().getLocale();
            HorizontalLayout layout = new HorizontalLayout();
            layout.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
            layout.addStyleName(OpenCmsTheme.QUICK_LAUNCH);
            //    layout.setSpacing(true);
            layout.setMargin(true);
            for (I_CmsWorkplaceAppConfiguration config : OpenCms.getWorkplaceAppManager()
                    .getQuickLaunchConfigurations(cms)) {
                layout.addComponent(CmsDefaultAppButtonProvider.createAppButton(cms, config, locale));
            }
            return layout;
        }
    });
    pv.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_QUICK_LAUNCH_TITLE_0));
    pv.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN);
    pv.setHideOnMouseOut(false);

    return pv;

}

From source file:org.opencms.ui.components.CmsToolBar.java

License:Open Source License

/**
 * Creates the user info drop down.<p>
 *
 * @return the drop down component/*w  w w.  j  a v a 2  s  .c  o m*/
 */
private Component createUserInfoDropDown() {

    PopupView pv = new PopupView(new PopupView.Content() {

        private static final long serialVersionUID = 1L;

        public String getMinimizedValueAsHTML() {

            CmsObject cms = A_CmsUI.getCmsObject();
            return getDropDownButtonHtml(new ExternalResource(OpenCms.getWorkplaceAppManager()
                    .getUserIconHelper().getSmallIconPath(cms, cms.getRequestContext().getCurrentUser())));
        }

        public Component getPopupComponent() {

            return new CmsUserInfo(new I_UploadListener() {

                public void onUploadFinished(List<String> uploadedFiles) {

                    handleUpload(uploadedFiles);
                }
            }, getDialogContext());
        }
    });
    pv.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_USER_INFO_TITLE_0));
    pv.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN);
    pv.setHideOnMouseOut(false);
    pv.addStyleName(OpenCmsTheme.USER_INFO);
    return pv;
}