code: private void foldButtons() {
  
          VerticalLayout mainPV = (VerticalLayout)m_foldedButtonsMenu.getContent().getPopupComponent();
          for (int i = m_itemsLeft.getComponentCount() - 1; i > -1; i--) {
              Component comp = m_itemsLeft.getComponent(i);
              if (!isAlwaysShow(comp)) {
                  m_itemsLeft.removeComponent(comp);
                  m_leftButtons.addComponent(comp, 0);
                  m_leftButtons.setComponentAlignment(comp, Alignment.MIDDLE_CENTER);
              }
          }
          if (m_leftButtons.getComponentCount() == 0) {
              mainPV.removeComponent(m_leftButtons);
          } else {
              mainPV.addComponent(m_leftButtons, 0);
          }
          for (int i = m_itemsRight.getComponentCount() - 1; i > -1; i--) {
              Component comp = m_itemsRight.getComponent(i);
              if (!isAlwaysShow(comp)) {
                  m_itemsRight.removeComponent(comp);
                  m_rightButtons.addComponent(comp, 0);
                  m_rightButtons.setComponentAlignment(comp, Alignment.MIDDLE_CENTER);
              }
          }
          if (m_rightButtons.getComponentCount() == 0) {
              mainPV.removeComponent(m_rightButtons);
          } else {
              mainPV.addComponent(m_rightButtons);
          }
          m_itemsRight.addComponent(m_foldedButtonsMenu, 0);
          m_buttonsFolded = true;
          markAsDirtyRecursive();
      }
docs: Folds the toolbar buttons into a sub menu.<p>