Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 15389

Summary: StyledText - Printing prints the highlighted line in editor
Product: [Eclipse Project] JDT Reporter: Jiawei Ye <leafy>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: andre_weinand
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jiawei Ye CLA 2002-05-06 23:53:40 EDT
Drop 20020502, WinXP traditional Chinese

When printing the source code, the highlight also gets printed resulting in a 
gray line on the final print.
Comment 1 Erich Gamma CLA 2002-05-07 16:44:10 EDT
Is there some context information we can consult in StyledText rendering canvas 
that allows us to distinguish whether the rendering is done for printing or for 
the display.
Comment 2 Scott Rutledge CLA 2002-05-10 11:13:02 EDT
Related issue: the background colour is printed as well, which is not always desireable. Eg. I set 
my background to a light blue, which I find better for readign on a display, but on paper I only want 
the code coloured.
Comment 3 Mike Wilson CLA 2002-05-30 10:20:59 EDT
StyledText printing support should avoid any extra "decorating" of the text, 
in much the same way that web browsers print simplified representations 
of web pages.

Agree that there would need to be a way to communicate the context 
under which the rendering is occurring. I have no suggestions as to how 
to do this.
Comment 4 Knut Radloff CLA 2002-07-08 11:36:01 EDT
There may be cases where one wishes the line bg colors to be printed (e.g., if 
one is using line bg colors to indicate tabulation, groups of lines), so we 
shouldn't just not print the line bg colors.

The application could set line bg colors to null, call print, and then reset 
the line bg colors if the colors are not desired.  However, whoever calls print 
would need to know to set line bg colors to null, call print, reset line bg 
colors.  Doesn't make sense to add some hacky isPrinting flag. 

Alternatively, we could provide some print API that allows you to specify 
whether or not to print line bg colors.  This is related to [Bug 14956], which 
would also require API for specifying print options.  This is probably what we 
should do.  Investigate further.


Comment 5 Knut Radloff CLA 2002-11-25 14:46:39 EST
Use StyledTextPrintOptions to turn off line background colors and other 
undesirable decorations. See bug 14956. Moving back to JDT UI.
Comment 6 Knut Radloff CLA 2002-11-26 17:19:23 EST
Changing owner
Comment 7 Dani Megert CLA 2003-10-27 04:01:23 EST
*** Bug 17573 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2003-10-27 04:03:00 EST
*** This bug has been marked as a duplicate of 14954 ***

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