public InfoPanel(SearchBox searchBox) { setId(ID); addStyleName(ID); addStyleName("v-scrollable"); // A CssLayout is a simple "div"-element. This makes it much easier to custom style it toggleButton = new CssLayout(); toggleButton.setStyleName("toggle-button"); toggleButton.setDescription(HIDE_TOOLTIP); toggleButton.addLayoutClickListener((event) -> { expanded = !expanded; if (expanded) { toggleButton.removeStyleName("info-panel-collapsed"); toggleButton.setDescription(HIDE_TOOLTIP); } else { toggleButton.addStyleName("info-panel-collapsed"); toggleButton.setDescription(SHOW_TOOLTIP); } refreshInfoArea(); }); staticComponents.add(searchBox); staticComponents.add(toggleButton); }
public InfoPanel(SearchBox searchBox) { setId(ID); addStyleName(ID); addStyleName("v-scrollable"); // A CssLayout is a simple "div"-element. This makes it much easier to custom style it toggleButton = new CssLayout(); toggleButton.setStyleName("toggle-button"); toggleButton.setDescription(HIDE_TOOLTIP); toggleButton.addLayoutClickListener((event) -> { expanded = !expanded; if (expanded) { toggleButton.removeStyleName("info-panel-collapsed"); toggleButton.setDescription(HIDE_TOOLTIP); } else { toggleButton.addStyleName("info-panel-collapsed"); toggleButton.setDescription(SHOW_TOOLTIP); } refreshInfoArea(); }); staticComponents.add(searchBox); staticComponents.add(toggleButton); }
/** * The default constructor. */ public WallboardTabSheet() { m_plusTab = new CssLayout(); m_plusTab.setCaption("+"); m_plusTab.setDescription("Add a new Ops Board configuration"); addTab(m_plusTab).setClosable(false); addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() { public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) { Component selectedTab = getSelectedTab(); if ("+".equals(selectedTab.getCaption())) { setSelectedTab((m_lastTab != null ? m_lastTab : iterator().next())); addNewTabComponent(); } else { m_lastTab = selectedTab; } } }); }
component.setDescription(substitutedUserCaption); } else { userNameLabel = null; component.setDescription(null);