/** * Creates the user info drop down.<p> * * @return the drop down component */ 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; }
/** * Creates a drop down menu.<p> * * @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; }
pv.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN); pv.setHideOnMouseOut(false);
/** * Constructor.<p> */ public CmsToolBar() { m_quickLaunchDropDown = createQuickLaunchDropDown(); m_userDropDown = createUserInfoDropDown(); m_leftButtons = new VerticalLayout(); m_rightButtons = new VerticalLayout(); VerticalLayout layout = new VerticalLayout(); layout.addComponent(m_leftButtons); layout.addComponent(m_rightButtons); m_foldedButtonsMenu = new PopupView(getDropDownButtonHtml(FontOpenCms.CONTEXT_MENU_DOTS), layout); m_foldedButtonsMenu.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN); m_foldedButtonsMenu.setHideOnMouseOut(false); Design.read("CmsToolBar.html", this); }