docs: public List<String> getButtonBarShownItems() {
  
          if (m_buttonBar == null) {
              // first get individual button bar configuration
              List<String> buttonBar = getButtonBarOption();
              if (buttonBar.isEmpty()) {
                  // no specific button bar defined, try to get global configuration first
                  if (m_globalButtonBarOption == null) {
                      // global configuration not yet parsed, check it now
                      String defaultConf = OpenCms.getXmlContentTypeManager().getWidgetDefaultConfiguration(
                          CmsHtmlWidget.class.getName());
                      if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(defaultConf)
                          && defaultConf.contains(OPTION_BUTTONBAR)) {
                          // found a global configuration containing a button bar definition, parse it
                          CmsHtmlWidgetOption option = new CmsHtmlWidgetOption(defaultConf);
                          // set global configuration in static member
                          m_globalButtonBarOption = option.getButtonBarOption();
                      } else {
                          // no global configuration present, set static member to empty list
                          m_globalButtonBarOption = Collections.emptyList();
                      }
                  }
                  if (m_globalButtonBarOption.isEmpty()) {
                      // no global button bar configuration found, use default button bar
                      buttonBar = BUTTONBAR_DEFAULT_LIST;
                  } else {
                      // found a global configuration containing a button bar definition, use it
                      buttonBar = m_globalButtonBarOption;
                  }
              }
  
              List<String> result = new ArrayList<String>(buttonBar.size());
              int lastSep = -1;
              int lastBlock = -1;
              boolean buttonInBlockAdded = false;
              boolean buttonSinceSepAdded = false;
              for (Iterator<String> i = buttonBar.iterator(); i.hasNext();) {
                  String barItem = i.next();
                  if (BUTTONBAR_BLOCK_START.equals(barItem)) {
                      // start a block
                      if ((lastSep != -1) && (lastSep == (result.size() - 1))) {
                          // remove last separator before block start
                          result.remove(lastSep);
                      }
                      lastBlock = result.size();
                      lastSep = -1;
                      buttonInBlockAdded = false;
                      buttonSinceSepAdded = false;
                      result.add(BUTTONBAR_BLOCK_START);
                  } else if (BUTTONBAR_BLOCK_END.equals(barItem)) {
                      // end a block
                      if (lastBlock != -1) {
                          // block has been started
                          if (lastSep == (result.size() - 1)) {
                              // remove last separator before block end
                              result.remove(lastSep);
                          }
                          //now check if there are items in it
                          if (buttonInBlockAdded) {
                              // block has items, add end
                              result.add(BUTTONBAR_BLOCK_END);
                          } else {
                              // block has no items, remove block start ite,
                              result.remove(lastBlock);
                          }
                          lastBlock = -1;
                          lastSep = -1;
                          buttonInBlockAdded = false;
                          buttonSinceSepAdded = false;
                      }
                  } else if (BUTTONBAR_SEPARATOR.equals(barItem)) {
                      // insert a separator depending on preconditions
                      if (buttonSinceSepAdded) {
                          lastSep = result.size();
                          result.add(BUTTONBAR_SEPARATOR);
                          buttonSinceSepAdded = false;
                      }
                  } else {
                      // insert a button depending on preconditions
                      if (getHiddenButtons().contains(barItem)) {
                          // skip hidden buttons
                          continue;
                      }
                      if (OPTIONAL_BUTTONS_LIST.contains(barItem)) {
                          // check optional buttons
                          if (CmsAjaxImageGallery.GALLERYTYPE_NAME.equals(barItem)) {
                              // special handling of image button to keep compatibility
                              if (!(getAdditionalButtons().contains(barItem)
                                  || getAdditionalButtons().contains(OPTION_IMAGE))) {
                                  // skip image gallery as it is not defined as additional button
                                  continue;
                              }
                          } else if (OPTION_UNLINK.equals(barItem)) {
                              // special handling of unlink button to show only if anchor, editor link or link button are active
                              if (!(getAdditionalButtons().contains(OPTION_LINK)
                                  || getAdditionalButtons().contains(OPTION_EDITORLINK)
                                  || getAdditionalButtons().contains(OPTION_ANCHOR))) {
                                  // skip unlink button because no link buttons are defined as additional buttons
                                  continue;
                              }
                          } else if (OPTION_STYLE.equals(barItem)) {
                              boolean showStyles = getAdditionalButtons().contains(barItem)
                                  || (getStylesFormatPath() != null)
                                  || (getStylesXmlPath() != null);
                              if (!showStyles) {
                                  continue;
                              }
                          } else if (!getAdditionalButtons().contains(barItem)) {
                              // skip all optional buttons that are not defined
                              continue;
                          }
                      }
                      result.add(barItem);
                      buttonSinceSepAdded = true;
                      if (lastBlock != -1) {
                          buttonInBlockAdded = true;
                      }
                  }
              }
              m_buttonBar = result;
          }
          return m_buttonBar;
      }