public void renderOption(OptionItem option, PrintWriter writer, boolean enabled) { new TagWriter(writer) .start("option") .attribute("id", option.getId()) .attribute("class", option.getStyleClass()) .attribute("value", option.getIndex()) .attribute("selected", option.isSelected()) .body(FormatUtils.stripTags(option.getLabel())) .end(); }
private int getFontFormat(String fileName) { String ext = FormatUtils.getExtension(fileName).toLowerCase(); if (ext.equals("ttf")) { return Font.TRUETYPE_FONT; } if (ext.equals("pfa") || ext.equals("pfb")) { return Font.TYPE1_FONT; } return -1; }
@Override public String toString() { return FormatUtils.toJSON(this); }