Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Saving and retrieving StyledText to/from database
Saving and retrieving StyledText to/from database [message #462933] Fri, 21 October 2005 07:53 Go to next message
Alex Chan is currently offline Alex ChanFriend
Messages: 16
Registered: July 2009
Junior Member
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 17:25 Go to previous message
Eclipse UserFriend
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
Previous Topic:Hyperlink wrapping in ScrolledForm
Next Topic:Newb question using tabbing
Goto Forum:
  


Current Time: Sat Apr 20 02:06:37 GMT 2024

Powered by FUDForum. Page generated in 0.03124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top