code: private int estimateRequiredWidth(AbstractOrderedLayout items) {
  
          int result = 0;
          if (items != null) {
              for (Component comp : items) {
                  if (comp == m_foldedButtonsMenu) {
                      continue;
                  } else if ((comp instanceof Button) || (comp instanceof PopupView) || (comp instanceof MenuBar)) {
                      // assume all buttons have a with of 50px
                      result += 50;
                  } else if (comp == m_appIndicator) {
                      // assume app indicator requires 150px
                      result += 50;
                  } else {
                      float compWidth = comp.getWidth();
                      if ((compWidth > 0) && (comp.getWidthUnits() == Unit.PIXELS)) {
                          // also add 10px margin
                          result += compWidth + 10;
                      } else {
                          result += 200;
                      }
                  }
              }
          }
          return result;
      }
docs: Calculates the width required by the layout components.<p>
  
  @param items the layout
  
  @return the width