Builds the html for the editor button style select box.<p>

@param htmlAttributes optional html attributes for the &lgt;select&gt; tag
@return the html for the editor button style select box
161092
public String buildSelectEditorButtonStyle(String htmlAttributes) {

        int selectedIndex = Integer.parseInt(getParamTabEdButtonStyle());
        return buildSelectButtonStyle(htmlAttributes, selectedIndex);
    }
604182
function(editor) {
    if (editor.blockless) return;

    var config = editor.config,
      lang = editor.lang.format;

    // Gets the list of tags from the settings.
    var tags = config.format_tags.split(';');

    // Create style objects for all defined styles.
    var styles = {},
      stylesCount = 0,
      allowedContent = [];
    for (var i = 0; i < tags.length; i++) {
      var tag = tags[i];
      // @EDIT: formatting tag name here, try to handle custom-elements
      var formatted_tag = tag.replace('-', '_');
      var style = new CKEDITOR.style(config['format_' + formatted_tag]);
      if (!editor.filter.customConfig || editor.filter.check(style)) {
        stylesCount++;
        styles[formatted_tag] = style;
        styles[formatted_tag]._.enterMode = editor.config.enterMode;
        allowedContent.push(style);
      }
    }

    // Hide entire combo when all formats are rejected.
    if (stylesCount === 0) return;

    editor.ui.addRichCombo('Format', {
      label: lang.label,
      title: lang.panelTitle,
      toolbar: 'styles,20',
      allowedContent: allowedContent,

      panel: {
        css: [CKEDITOR.skin.getPath('editor')].concat(config.contentsCss),
        multiSelect: false,
        attributes: { 'aria-label': lang.panelTitle },
      },

      init: function() {
        this.startGroup(lang.panelTitle);

        for (var tag in styles) {
          var label = lang['tag_' + tag];

          // Add the tag entry to the panel list.
          this.add(tag, styles[tag].buildPreview(label), label);
        }
      },

      onClick: function(value) {
        editor.focus();
        editor.fire('saveSnapshot');

        var style = styles[value],
          elementPath = editor.elementPath();

        // Always apply style, do not allow to toggle it by clicking on corresponding list item (#584).
        if (!style.checkActive(elementPath, editor)) {
          editor.applyStyle(style);
        }

        // Save the undo snapshot after all changes are affected. (https://dev.ckeditor.com/ticket/4899)
        setTimeout(function() {
          editor.fire('saveSnapshot');
        }, 0);
      },

      onRender: function() {
        editor.on(
          'selectionChange',
          function(ev) {
            var currentTag = this.getValue(),
              elementPath = ev.data.path;

            this.refresh();

            for (var tag in styles) {
              if (styles[tag].checkActive(elementPath, editor)) {
                if (tag != currentTag)
                  this.setValue(tag, editor.lang.format['tag_' + tag]);
                return;
              }
            }

            // If no styles match, just empty it.
            this.setValue('');
          },
          this,
        );
      },

      onOpen: function() {
        this.showAll();
        for (var name in styles) {
          var style = styles[name];

          // Check if that style is enabled in activeFilter.
          if (!editor.activeFilter.check(style)) this.hideItem(name);
        }
      },

      refresh: function() {
        var elementPath = editor.elementPath();

        if (!elementPath) return;

        // Check if element path contains 'p' element.
        if (!elementPath.isContextFor('p')) {
          this.setState(CKEDITOR.TRISTATE_DISABLED);
          return;
        }

        // Check if there is any available style.
        for (var name in styles) {
          if (editor.activeFilter.check(styles[name])) return;
        }
        this.setState(CKEDITOR.TRISTATE_DISABLED);
      },
    });
  }
55109
public String htmlSearchBar() {

        if (!isSearchable()) {
            return "";
        }
        StringBuffer html = new StringBuffer(1024);
        html.append("<td class='main'>\n");
        html.append("\t<div>\n");
        html.append(
            "\t\t<input type='text' name='listSearchFilter' id='"
                + SEARCH_BAR_INPUT_ID
                + "' value='' size='20' maxlength='245' style='vertical-align: bottom;'>\n");
        html.append(m_searchAction.buttonHtml());
        I_CmsListAction showAllAction = m_searchAction.getShowAllAction();
        if (showAllAction != null) {
            html.append("&nbsp;&nbsp;");
            html.append(showAllAction.buttonHtml());
        }
        html.append("\t</div>\n");
        html.append("</td>\n");
        return html.toString();
    }
97145
public ServiceCall<HTMLReturn> convertToHtml(ConvertToHtmlOptions convertToHtmlOptions) {
    Validator.notNull(convertToHtmlOptions, "convertToHtmlOptions cannot be null");
    String[] pathSegments = { "v1/html_conversion" };
    RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments));
    builder.query("version", versionDate);
    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("compare-comply", "v1", "convertToHtml");
    for (Entry<String, String> header : sdkHeaders.entrySet()) {
      builder.header(header.getKey(), header.getValue());
    }
    builder.header("Accept", "application/json");
    if (convertToHtmlOptions.model() != null) {
      builder.query("model", convertToHtmlOptions.model());
    }
    MultipartBody.Builder multipartBuilder = new MultipartBody.Builder();
    multipartBuilder.setType(MultipartBody.FORM);
    RequestBody fileBody = RequestUtils.inputStreamBody(convertToHtmlOptions.file(), convertToHtmlOptions
        .fileContentType());
    multipartBuilder.addFormDataPart("file", convertToHtmlOptions.filename(), fileBody);
    builder.body(multipartBuilder.build());
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(HTMLReturn.class));
  }
529691
public String html(String htmlSource) {
        String cleanSource = htmlCleaner.cleanupPreFormatted(htmlSource);
        return "<div>" + StringEscapeUtils.unescapeHtml4(cleanSource) + "</div>";
    }
690721
public String html() {
        if (html != null) {
            return html;
        }

        if (content == null) {
            return null;
        }
        if (charset == null) {
            charset = CharsetDetector.guessEncoding(content());
        }
        try {
            html = new String(content, charset);
        } catch (UnsupportedEncodingException e) {
            LOG.info("Exception when decoding "+ key(),e);
            return null;
        }
        return html;
    }
1199993
protected String createDialogRowHtml(CmsWidgetDialogParameter base) {

        StringBuffer result = new StringBuffer(256);

        List<CmsWidgetDialogParameter> sequence = getParameters().get(base.getName());
        int count = sequence.size();

        // check if value is optional or multiple
        boolean addValue = false;
        if (count < base.getMaxOccurs()) {
            addValue = true;
        }
        boolean removeValue = false;
        if (count > base.getMinOccurs()) {
            removeValue = true;
        }

        // check if value is present
        boolean disabledElement = false;
        if (count < 1) {
            // no parameter with the value present, but also not optional: use base as parameter
            sequence = new ArrayList<CmsWidgetDialogParameter>();
            sequence.add(base);
            count = 1;
            if (base.getMinOccurs() == 0) {
                disabledElement = true;
            }
        }

        // loop through multiple elements
        for (int j = 0; j < count; j++) {

            // get the parameter and the widget
            CmsWidgetDialogParameter p = sequence.get(j);
            I_CmsWidget widget = p.getWidget();

            // check for an error in this row
            if (p.hasError()) {
                // show error message
                result.append("<tr><td></td><td><img src=\"");
                result.append(getSkinUri()).append("editors/xmlcontent/");
                result.append("error.png");
                result.append("\" border=\"0\" alt=\"\"></td><td class=\"xmlTdError\">");
                Throwable t = p.getError();
                while (t != null) {
                    if (t instanceof I_CmsThrowable) {
                        result.append(CmsEncoder.escapeXml(((I_CmsThrowable)t).getLocalizedMessage(getLocale())));
                    } else {
                        result.append(CmsEncoder.escapeXml(t.getLocalizedMessage()));
                    }
                    t = t.getCause();
                    if (t != null) {
                        result.append("<br>");
                    }
                }
                result.append("</td><td colspan=\"2\"></td></tr>\n");
            }

            // create label and help bubble cells
            result.append("<tr>");
            result.append("<td class=\"xmlLabel");
            if (disabledElement) {
                // element is disabled, mark it with css
                result.append("Disabled");
            }

            result.append("\">");
            result.append(keyDefault(A_CmsWidget.getLabelKey(p), p.getName()));
            if (count > 1) {
                result.append(" [").append(p.getIndex() + 1).append("]");
            }
            result.append(": </td>");
            if (p.getIndex() == 0) {
                // show help bubble only on first element of each content definition
                result.append(p.getWidget().getHelpBubble(getCms(), this, p));
            } else {
                // create empty cell for all following elements
                result.append(dialogHorizontalSpacer(16));
            }

            // append individual widget html cell if element is enabled
            if (!disabledElement) {
                // this is a simple type, display widget
                result.append(widget.getDialogWidget(getCms(), this, p));
            } else {
                // disabled element, show message for optional element
                result.append("<td class=\"xmlTdDisabled maxwidth\">");
                result.append(key(Messages.GUI_EDITOR_WIDGET_OPTIONALELEMENT_0));
                result.append("</td>");
            }

            // append add and remove element buttons if required
            result.append(dialogHorizontalSpacer(5));
            result.append("<td>");
            if (addValue || removeValue) {
                result.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>");

                if (!addValue) {
                    result.append(dialogHorizontalSpacer(25));
                } else {
                    result.append(
                        "<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
                    result.append(buildAddElement(base.getName(), p.getIndex(), addValue));
                }

                if (removeValue) {
                    if (!addValue) {
                        result.append(
                            "<td><table class=\"editorbuttonbackground\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>");
                    }
                    result.append(buildRemoveElement(base.getName(), p.getIndex(), removeValue));
                }

                result.append("</tr></table></td>");
                result.append("</tr></table>");
            }
            result.append("</td>");
            // close row
            result.append("</tr>\n");
        }

        return result.toString();
    }
99845
public String getHtmlCode()
	{
		Object[] _params =
		{
				getHtmlCodeForNameAttribute(),
				getHtmlCodeForIdAttribute(),
				HtmlUtils.generateAttribute(HtmlUtils.AttributeNames.VALUE, getValue()),
				isSelected() ? HtmlUtils.SpecialAttribute.CHECKED : HtmlUtils.SpecialAttribute.NONE,
				isDisabled() ? HtmlUtils.SpecialAttribute.DISABLED : HtmlUtils.SpecialAttribute.NONE,
				HtmlUtils.generateAttribute(HtmlUtils.AttributeNames.Form.FOR, getId()),
				getLabel()

		};
		return FORMAT_RADIO_BUTTON.format(_params);
	}
709817
public String buildSelectProject(String htmlAttributes) {

        SelectOptions selectOptions = getProjectSelectOptions();
        return buildSelect(htmlAttributes, selectOptions);

    }
138291
public String htmlCell(CmsListItem item, boolean isPrintable) {

        StringBuffer html = new StringBuffer(512);
        Iterator<I_CmsListDirectAction> itActions = m_directActions.iterator();
        while (itActions.hasNext()) {
            I_CmsListDirectAction action = itActions.next();
            action.setItem(item);
            boolean enabled = action.isEnabled();
            if (isPrintable) {
                action.setEnabled(false);
            }
            html.append(action.buttonHtml());
            if (isPrintable) {
                action.setEnabled(enabled);
            }
        }
        if (!m_defaultActions.isEmpty()) {
            Iterator<CmsListDefaultAction> itDefaultActions = m_defaultActions.iterator();
            while (itDefaultActions.hasNext()) {
                CmsListDefaultAction defAction = itDefaultActions.next();
                defAction.setItem(item);
                boolean enabled = defAction.isEnabled();
                if (isPrintable) {
                    defAction.setEnabled(false);
                }
                html.append(defAction.buttonHtml());
                if (isPrintable) {
                    defAction.setEnabled(enabled);
                }
            }
        } else {
            if (m_formatter == null) {
                // unformatted output
                if (item.get(m_id) != null) {
                    // null values are not showed by default
                    html.append(item.get(m_id).toString());
                }
            } else {
                // formatted output
                html.append(m_formatter.format(item.get(m_id), getWp().getLocale()));
            }
        }
        html.append("\n");
        return html.toString();
    }
391926
public static String stripHtml(String html) {

        if (html == null) {
            return null;
        }
        Element el = DOM.createDiv();
        el.setInnerHTML(html);
        return el.getInnerText();
    }
492860
public String buildSelectUpload(String htmlAttributes) {

        List<String> options = new ArrayList<String>();
        List<String> values = new ArrayList<String>();
        int selectedIndex = 0;
        int pos = 0;

        UploadVariant currentVariant = getParamTabWpUploadVariant();
        for (UploadVariant variant : UploadVariant.values()) {

            values.add(variant.toString());
            options.add(getUploadVariantMessage(variant));

            if (variant.equals(currentVariant)) {
                selectedIndex = pos;
            }
            pos++;
        }
        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }
104844
public String buttonActionCancel() {

        String target = null;
        if (Boolean.valueOf(getParamDirectedit()).booleanValue()) {
            // editor is in direct edit mode
            if (CmsStringUtil.isNotEmpty(getParamBacklink())) {
                // set link to the specified back link target
                target = getParamBacklink();
            } else {
                // set link to the edited resource
                target = getParamResource();
            }
        } else {
            // in workplace mode, show explorer view
            target = CmsVaadinUtils.getWorkplaceLink();
        }
        return "onclick=\"top.location.href='" + getJsp().link(target) + "';\"";
    }
154396
public String outerHtml() {
        StringBuilder accum = StringUtil.borrowBuilder();
        outerHtml(accum);
        return StringUtil.releaseBuilder(accum);
    }
293825
public String buildOrgUnitSelector() {

        StringBuffer html = new StringBuffer();
        html.append("<select style='width: 100%;' size='1' ");
        appendId(html, PARAM_OUFQN);
        html.append(">\n");
        for (CmsOrganizationalUnit ou : getOus()) {
            String selected = "";
            if (ou.getName().equals(m_oufqn)
                || (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_oufqn) && ou.getName().equals(m_oufqn.substring(1)))) {
                selected = " selected='selected'";
            }
            html.append("<option value='").append(ou.getName()).append("'").append(selected).append(">");
            html.append(ou.getDisplayName(m_locale));
            html.append("</option>\n");
        }
        html.append("</select>\n");
        return html.toString();
    }
430502
private static String toHtmlTable(final List<OptionWithMetaInfo> options) {
		StringBuilder htmlTable = new StringBuilder();
		htmlTable.append("<table class=\"table table-bordered\">\n");
		htmlTable.append("    <thead>\n");
		htmlTable.append("        <tr>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 20%\">Key</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 15%\">Default</th>\n");
		htmlTable.append("            <th class=\"text-left\" style=\"width: 65%\">Description</th>\n");
		htmlTable.append("        </tr>\n");
		htmlTable.append("    </thead>\n");
		htmlTable.append("    <tbody>\n");

		for (OptionWithMetaInfo option : options) {
			htmlTable.append(toHtmlString(option));
		}

		htmlTable.append("    </tbody>\n");
		htmlTable.append("</table>\n");

		return htmlTable.toString();
	}
452738
protected String htmlBegin() {

        StringBuffer html = new StringBuffer(512);
        // help & confirmation text for actions if needed
        if (!isPrintable() && (m_visibleItems != null) && !m_visibleItems.isEmpty()) {
            Iterator<CmsListColumnDefinition> cols = getMetadata().getColumnDefinitions().iterator();
            while (cols.hasNext()) {
                CmsListColumnDefinition col = cols.next();
                Iterator<I_CmsListDirectAction> actions = col.getDirectActions().iterator();
                while (actions.hasNext()) {
                    I_CmsListDirectAction action = actions.next();
                    action.setItem(m_visibleItems.get(0));
                    html.append(action.helpTextHtml());
                    html.append(action.confirmationTextHtml());
                }
                Iterator<CmsListDefaultAction> defActions = col.getDefaultActions().iterator();
                while (defActions.hasNext()) {
                    I_CmsListDirectAction action = defActions.next();
                    action.setItem(m_visibleItems.get(0));
                    html.append(action.helpTextHtml());
                    html.append(action.confirmationTextHtml());
                }
            }
        }
        // start list code
        html.append("<div class='listArea'>\n");
        if (isBoxed()) {
            html.append(getWp().dialogBlock(CmsWorkplace.HTML_START, m_name.key(getWp().getLocale()), false));
        }
        html.append("\t\t<table width='100%' cellspacing='0' cellpadding='0' border='0'>\n");
        html.append("\t\t\t<tr><td>\n");
        return html.toString();
    }