Bug 52296 - [StyledText] RTF Reader for StyledText
Summary: [StyledText] RTF Reader for StyledText
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement with 14 votes (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 201795 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-17 15:56 EST by Brian Farn CLA
Modified: 2019-11-08 04:38 EST (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Farn CLA 2004-02-17 15:56:45 EST
Create org.eclipse.swt.custom.RTFReader class to compliment
org.eclipse.swt.custom.StyledText$RTFWriter class.  Otherwise, content written
by RTFWriter cannot be read back in.

Separate RTFWriter from StyledText so that it is not an inner class.

Optionally add get/setWriter and get/setReader member functions to StyledText
with DefaultRTFWriter as the default writer, and DefaultRTFReader as the default
reader.
Comment 1 Stefan Langer CLA 2007-03-07 08:31:10 EST
Optionally provide a way to override the transfertypes for StyledText or add new once besided RTFWriter and PlainTextWriter. 

Comment 2 Matthias Kempka CLA 2007-07-24 04:53:00 EDT
Is this supposed to be fixed anytime in the near or not so near future? Pasting RTF is desirable.
Comment 3 Grant Gayed CLA 2007-09-06 17:29:47 EDT
*** Bug 201795 has been marked as a duplicate of this bug. ***
Comment 4 Raji Akella CLA 2008-02-26 11:34:36 EST
Any progress on this bug?

Comment 5 Mike Wilson CLA 2008-03-27 14:12:52 EDT
Is anyone working on this? If not, should the bug marked as helpwanted?
Comment 6 Dani Megert CLA 2008-03-27 16:37:44 EDT
Fix would also be welcome for Platform Text, see bug 64498.
Comment 7 Dani Megert CLA 2008-03-27 16:38:31 EDT
> should the bug marked as helpwanted?
I'm not sure whether much help is needed AFAIK most of the code is there but just not API.
Comment 8 Felipe Heidrich CLA 2008-03-27 16:48:07 EDT
(In reply to comment #7)
> > should the bug marked as helpwanted?
> I'm not sure whether much help is needed AFAIK most of the code is there but
> just not API.

That is not true.
We have the code that converts StyledRanges + text to a RTF string. I don't have the code that takes a RTF string, parses it, and creates the StyledRanges.

so help is welcome.
Comment 9 Mike Wilson CLA 2008-03-27 17:09:11 EDT
Just to be clear: We don't need a fully general rtf parser (although that would be nice). To fix this, it would be enough to be able to parse rtf that is generated by RTFWriter.
Comment 10 Dani Megert CLA 2008-03-27 17:21:27 EDT
Sorry, to late here. What Text would need is a public RTF writer.
Comment 11 Mike Wilson CLA 2008-04-03 12:08:42 EDT
Since we're past the API freeze, we're not going to be able to do this for 3.4, at this point. However, it seems like a perfectly reasonable request. Please consider this early in 3.5.

Comment 12 Felipe Heidrich CLA 2008-04-07 15:36:35 EDT
Some thoughts:

1) StyledText can only support a small subset of RTF. Still, this is a big work item. RTF spec is almost 300 pages. 

2) StyledText does not always own the text and the style model.
When the text changes caused by clipboard operations the text model is notified by an existent mechanism (textChanging/textChanged event).
For styles we don't have an equivalent mechanism.

For example, in Java Editor the user doesn't want RTF text to be inserted (the user wants the JavaEditor to choose colors/fonts).

Other case is that the user wants RTF to be inserted but the styles model will override the styles set by the RTF reader when it is called.
Comment 13 Raji Akella CLA 2009-01-21 11:36:58 EST
Any update?
Comment 14 Felipe Heidrich CLA 2009-01-27 17:05:26 EST
(In reply to comment #13)
> Any update?

This is not in the plan. It would make more sense for somebody else to get an existent RTF parser for java and use it to implement this feature.

I can change StyledText to allow user-defined data transfers (maybe fix bug 255013 and bug 106822 in the process).
Comment 15 Lars Vogel CLA 2019-11-08 04:38:19 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant please remove the stalebug whiteboard tag.