You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Tomas, since paragraphs are styledText elements, would it be possible for the styledText to report its start position in reference to the text area? or example
styledText.getIndex()? something to go with the styledText.getStyle();
I can calculate it, but thought it would be convenient to provide such a method since the infra structure is already there.
The text was updated successfully, but these errors were encountered:
StyledText instances are immutable (i.e. they don't have any fields that can change, such as index). They don't hold a reference to the text area they are used in. In fact, a single StyledText instance may be used in more than one text area at the same time, at different positions. Therefore, it does not make sense for StyledText to have an index. You should think of StyledText as just a String with an associated style. The same String instance can be used in many different places in your Java program, and the String itself is not aware of where it is being used.
Hi Tomas, since paragraphs are styledText elements, would it be possible for the styledText to report its start position in reference to the text area? or example
styledText.getIndex()? something to go with the styledText.getStyle();
I can calculate it, but thought it would be convenient to provide such a method since the infra structure is already there.
The text was updated successfully, but these errors were encountered: