Bug 65373 - Copying from the editor contains no rich text formatting information
Summary: Copying from the editor contains no rich text formatting information
Status: RESOLVED DUPLICATE of bug 64498
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-02 12:25 EDT by Axel Sammet CLA
Modified: 2004-06-03 13:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Sammet CLA 2004-06-02 12:25:50 EDT
Hi there!

I am using:
Version: 3.0.0
Build id: 200405211200

When using older versions of Eclipse (e.g M7) copying of Java source code from
the editor into the clipboard contained rich text formatting information like
color, bold ... besides the plain text.
Since I upgraded to M9 this feature does not work anymore, only plain text is
copied.

Scenario:
- open any Java editor
- mark text block
- Strg+C or Menu Edit/Copy to copy the text
- Insert text into some client (understanding rich text, in my case Notes)
==> plain text is copied, any code formatting is lost.

Besides that, great job! :-D

Axel
Comment 1 DJ Houghton CLA 2004-06-02 12:33:42 EDT
Hmm..this works ok for me with the Java Editor and Lotus Notes. In Notes I
right-click, hit Paste Special, and then select "Rich Text" instead of "Text".

Did you recently upgrade or change your Notes settings? (I think that I did and
I think that it changed my default to paste plain text)

Moving to Platform/UI for comment.
Comment 2 Axel Sammet CLA 2004-06-02 12:47:59 EDT
I did not change any settings for Notes. But you never know what the admins do ;-)

Anyway I double checked the whole thing with M7:
- I retested the scenario with notes (besides we are using 4.xx, no paste
special :-( ) ==> works fine
- I tried to paste the text into wordpad ==> works fine
Using M9 again:
- copying into notes ==> does not work
- copying into workpad ==> does not work

So, if it works for you, it might be something OS-specific ?
Comment 3 Kim Horne CLA 2004-06-02 13:38:31 EDT
The StyledText control was reimplemented by SWT.  Perhaps this is a bug in the
control itself?
Comment 4 Axel Sammet CLA 2004-06-02 14:09:01 EDT
If it comes from StyledText control, there should be other GUI elements in
Eclipse, with which I could reproduce the behaviour. Right? 
In that case, can you please name some other components overriding StyledText?

thx
Comment 5 Mariano Kamp CLA 2004-06-02 14:10:05 EDT
Tried to copy from Eclipse RC1, JDK 1.5b on Win XP to WordPad and lost the
formatting/color information.

Btw. Axel is not using JDK1.5.

With Build id: 200405120800 it is working.
Comment 6 Kim Horne CLA 2004-06-02 14:13:38 EDT
Try going to the Preferences->Java->Editor->Templates page.  The template
preview uses Styled Text I think.  For another editor example, you could view
the source page in the plugin.xml editor.
Comment 7 Mariano Kamp CLA 2004-06-02 14:28:08 EDT
Tried with template editor and PDE editor. In both cases the formatting/coloring
information have been preserved correctly in RC1.

Move to JDT-UI?
Comment 8 Kim Horne CLA 2004-06-02 15:31:44 EDT
Sounds like a plan.
Comment 9 Mariano Kamp CLA 2004-06-02 16:03:10 EDT
Seems to be related to #61273.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=61273
Comment 10 Dirk Baeumer CLA 2004-06-03 05:14:31 EDT
Martin, please investigate. 
Comment 11 Martin Aeschlimann CLA 2004-06-03 09:14:37 EDT
It has to do with the new folding capabilities. The rtf clipboard data created
by the style text widget can't be used if the code is folded.
Comment 12 Axel Sammet CLA 2004-06-03 12:52:38 EDT
Just a remark:
copying unfolded code into the clipboard, has the same result. No rtf.
Comment 13 Axel Sammet CLA 2004-06-03 13:10:46 EDT
Ok, sorry for the former remark. When switching the folding of in the
preferences, rtf works fine. So you were absolutely right.
Comment 14 Kai-Uwe Maetzel CLA 2004-06-03 13:41:41 EDT

*** This bug has been marked as a duplicate of 64498 ***