resultHtml.append("</td></tr>");
paramCounter++;
}
resultHtml.append("</table>");
} else if ("GetFormats".equals(commandStr)) {
Variable variable = WYSIWYGHTMLEditor.getCurrent().getVariablesMap(false).get(tagName);
resultHtml.append("<select id=\"tagFormat\">");
if (variable != null) {
String format = TagParser.getFormatMapping(variable.getFormat()).getName();
// It may not exist variables at all.
FormatTag formatTag = FormatTag.getTag(format);
for (String f : formatTag.formats.keySet()) {
resultHtml.append("<option value=\"" + f + "\">" + formatTag.formats.get(f).name + "</option>");
}
}
resultHtml.append("</select>");
} else if ("GetTagImage".equals(commandStr)) {
//resultHtml.append(MethodTag.getTag(tagName).image);
} else if ("GetVarTagWidth".equals(commandStr)) {
resultHtml.append(MethodTag.getTag(tagName).width);
} else if ("GetVarTagHeight".equals(commandStr)) {
resultHtml.append(MethodTag.getTag(tagName).height);
} else if ("IsAvailable".equals(commandStr)) {
resultHtml.append(WYSIWYGHTMLEditor.getCurrent().isFtlFormat());
WYSIWYGHTMLEditor.getCurrent().setBrowserLoaded(true);
} else if ("GetVariableNames".equals(commandStr)) {
String elementType = request.getParameter("elementType");
if (!ELEMENT_TYPE_FILTERS.containsKey(elementType)) {
WYSIWYGPlugin.logInfo("Invalid param: elementType = " + elementType);
}
for (Variable variable : WYSIWYGHTMLEditor.getCurrent().getVariablesList(true)) {
String formatAlias = TagParser.getFormatMapping(variable.getFormat()).getName();
if (ELEMENT_TYPE_FILTERS.get(elementType).contains(formatAlias)) {
if (resultHtml.length() > 0) {
resultHtml.append("|");
}
resultHtml.append(variable.getName());
}
}
} else {
WYSIWYGPlugin.logInfo("Unknown cmd: " + commandStr);
}