I am developing a Java Web Application using JSF, Primefaces and XHTML.
In which, I am trying to read the Cell con
Thanks to @Axel, as his answer didn't include color so I decided to add it. But unfortunately in my case, font.getColor()
always returned '0'.
I went through another way as this:
static StringBuffer getHTMLFormatted(String textpart, Font font) {
StringBuffer htmlstring = new StringBuffer();
...
boolean hasColor = false;
...
if(font.toString().contains("") ;
hasColor = true ;
}
}
htmlstring.append(textpart);
...
if (hasColor) {
htmlstring.append("");
}
return htmlstring;
}
public static String getColor(Font font){
String colorStr ;
Pattern pattern = Pattern.compile("");
Matcher matcher = pattern.matcher(font.toString());
if (matcher.find())
{
Log.i(TAG , "font color = : " + matcher.group(1));
colorStr = matcher.group(1);
colorStr = colorStr.substring(2);
}else {
colorStr = "616A6B" ; // my defualt color
}
return colorStr;
}