-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving content of Rich Text #334
Comments
You can check #315 where I have implemented a load/save functionality for the rich text editor example. There are still some issues which need to be solved, but it should give you an idea on how to start. @TomasMikula From an API side, one thing I was missing is the possibility to build the model by calling methods such as In summary, it should be possible to
|
@afester just to clarify, by 'model,' do you mean the
Were you thinking of some builder-like API for this? ReadOnlyStyledDocument.startParagraph(paragraphStyle)
.addSegment(text, style)
.addSegment(text, style)
.addSegment(text, style)
.endParagraph()
.startParagraph(paragraphStyle) or even // t(text, style) --> Tuple2<String, Style>, which is later turned into a StyledText object
ReadOnlyStyledDocument.addParagraph(paragraphStyle, t(text, style), t(text, style))
.addParagraph(paragraphStyle, t(text, style), t(text, style))
.addParagraph(paragraphStyle, t(text, style), t(text, style))
Isn't this already possible in one of
What do you have in mind here? |
@IcarusKR There is no one-liner to do that. In the most general case ( Here's how you can proceed:
All in all, we have StyledDocument<PS, S> ≃ List<(PS, List<(String, S)>)> You can see that it is not too hard to write your own code to serialize this.
This is possible, although maybe we are missing some convenience methods.
See @JordanMartinez's comment above. I don't see much benefit in being able to change the underlying document of the area after construction, if that's what you mean. You can just create a new area.
|
Due to lack of activity on this issue, I'm closing it. @IcarusKR If you still need help, reopen it and ask your questions. |
Is there an easy way to save the formated text and reload it?
I have been checking out the example and it exactly what I need, but cant figure out how to get the formated text and save it to some file or database, and reload it again.
The text was updated successfully, but these errors were encountered: