weimingtom / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
1 stars 0 forks source link

SyntaxView ignores selected text color #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Edit SyntaxTester to change the JEditorPane's selected color (eg.
pane.setSelectedTextColor(Color.magenta))
2. Start SyntaxTester
3. Select some text

What is the expected output? What do you see instead?
Expected: selected text is orange
Actual: selected text is the same color as unselected text

The problem is that SyntaxView.drawSelectedText() calls
drawUnselectedText() instead of implementing the selected text method.  The
workaround seems to be commenting out SyntaxView.drawSelectedText()

Original issue reported on code.google.com by javlo...@gmail.com on 11 Aug 2008 at 9:40

GoogleCodeExporter commented 9 years ago
Actually the main reason I used the same call to draw both selected and 
un-selected
text is to have colors and style even when the text is highlighted.  Otherwise 
the
highlighted text will be in one color and style.  So this work around will 
actually
break the way I intended it to work.  The case may actually be with the way
highlighting occurs.
I'll try and see what goes wrong...

Original comment by ayman.al...@gmail.com on 11 Aug 2008 at 5:52

GoogleCodeExporter commented 9 years ago
The highlighted text should be one color, though you'll probably want to keep 
the
original style.  I've attached an image of other applications as an example.

Original comment by javlo...@gmail.com on 11 Aug 2008 at 7:22

Attachments:

GoogleCodeExporter commented 9 years ago
Yeah.. but NetBeans does not :-)
Any votes for this?

Original comment by ayman.al...@gmail.com on 12 Aug 2008 at 6:24

Attachments:

GoogleCodeExporter commented 9 years ago
netBeans is better

Original comment by hongyi.j...@gmail.com on 28 Aug 2008 at 9:19

GoogleCodeExporter commented 9 years ago
Only way is to create yet another view class that does not override the
drawUnselected method.  

Original comment by ayman.al...@gmail.com on 21 Sep 2008 at 12:30

GoogleCodeExporter commented 9 years ago
This is now handled in the config.properties added in 0.9.3 and be configured 
as needed

Original comment by ayman.al...@gmail.com on 10 Nov 2008 at 5:23

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
There seems to be a problem with the fix of this issue:

IMHO the overridden method drawSelectedText() in SyntaxView should return 
super.drawSelectedText() in case the singleColorSelect property is set and not 
super.drawUnselectedText(). (see attached file)

Original comment by marc.fri...@gmail.com on 15 Jan 2010 at 4:12

Attachments: