Exemplo n.º 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();
 }
Exemplo n.º 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;
 }
Exemplo n.º 3
0
 @Override
 public String toString() {
   return FormatUtils.toJSON(this);
 }