Example #1
0
 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();
 }
Example #2
0
 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;
 }
Example #3
0
 @Override
 public String toString() {
   return FormatUtils.toJSON(this);
 }