Hi , i have two queries.
- How to set different styles to words in same paragraph or line of
GenericStyledArea ? I am doing it like this ....
area.setStyle(area.getText().lastIndexOf(text), area.getText().length(), TextStyle.EMPTY.updateTextColor(color));
This works only for first word, but when i append the second word with different style like
area.setStyle(area.getText().lastIndexOf(text), area.getText().length(), TextStyle.EMPTY.updateTextColor(color).updateBold(true);
It also changes the style of first text. Now how to do it ?
- How to add different objects in same GenericStyledArea . What i mean to say is if i define the area like this
final GenericStyledArea<ParStyle, Either<StyledText<TextStyle>, LinkedImage<TextStyle>>, TextStyle> area .
I can insert only LinkedImage objects into this. But if i have to add lets say an Text or Hyperlink Object then how to do it. I can manage the hyperlink with styling as you explained in some pull request but if i have to add Hyperlink and Image in area then how to do it ?
Thank you.
Hi , i have two queries.
GenericStyledArea? I am doing it like this ....area.setStyle(area.getText().lastIndexOf(text), area.getText().length(), TextStyle.EMPTY.updateTextColor(color));This works only for first word, but when i append the second word with different style like
area.setStyle(area.getText().lastIndexOf(text), area.getText().length(), TextStyle.EMPTY.updateTextColor(color).updateBold(true);It also changes the style of first text. Now how to do it ?
final GenericStyledArea<ParStyle, Either<StyledText<TextStyle>, LinkedImage<TextStyle>>, TextStyle> area.I can insert only
LinkedImageobjects into this. But if i have to add lets say anTextorHyperlinkObject then how to do it. I can manage the hyperlink with styling as you explained in some pull request but if i have to add Hyperlink and Image in area then how to do it ?Thank you.