Saving and retrieving StyledText to/from database [message #462933] |
Fri, 21 October 2005 03:53  |
Eclipse User |
|
|
|
Hi all,
I'm trying out a simple process of entering text into a text field within
my RCP application, applying several styles such as bold and italics to
the selected portion of the text entered, and then save it into my
database via MySQL.
So far, I have managed to get the intended & selected portion of the text
to display the correct styles on my UI application (upon executing bold or
italic functions but before saving to the database). The function I used
also allows me to revert back to my original text before formatting by
running through the same function again.
However, I am currently wondering how would I be able to save the text
into my database, retrieve and display them on my UI application with the
correct formatting?
A troublesome method I have figured out so far would be applying specific
tags for each style and append them to the text before saving the entire
string into the database. Upon retrieval, I would have to detect for these
tags and run thru the appropriate function again.
Could anyone out there help me out or point me in the right direction on
this issue? Thanks a lot!.
Cheers
|
|
|
Re: Saving and retrieving StyledText to/from database [message #462949 is a reply to message #462933] |
Fri, 21 October 2005 13:25  |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
Alex Chan <hcbing@gmail.com> wrote:
> Hi all,
>
> I'm trying out a simple process of entering text into a text field
> within my RCP application, applying several styles such as bold and
> italics to the selected portion of the text entered, and then save it
> into my database via MySQL.
>
> So far, I have managed to get the intended & selected portion of the
> text to display the correct styles on my UI application (upon
> executing bold or italic functions but before saving to the
> database). The function I used also allows me to revert back to my
> original text before formatting by running through the same function
> again.
> However, I am currently wondering how would I be able to save the text
> into my database, retrieve and display them on my UI application with
> the correct formatting?
>
[snip]
Create a table to persist the StyleInfo values for the StyledText.
Then when you read the text, also read its StyleInfo values and apply them.
--
Sunil
|
|
|
Powered by
FUDForum. Page generated in 0.03266 seconds