Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342111 - Can set comment color to green and then back to black
Summary: Can set comment color to green and then back to black
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: RC2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 306352
Blocks:
  Show dependency tree
 
Reported: 2011-04-07 04:05 EDT by Mark Christiaens CLA
Modified: 2017-09-19 17:11 EDT (History)
5 users (show)

See Also:
sven.efftinge: indigo+


Attachments
proposed patch pls review and test (18.70 KB, patch)
2011-05-11 12:29 EDT, Michael Clay CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Christiaens CLA 2011-04-07 04:05:09 EDT
Build Identifier: 20110301-1815

Open an Xtext grammar.  The comments have a default color (on my machine seems to be green).  In the preference page, change the color to something else and press OK, OK.  The color actually changes in the editor (that's fine).  Then open the preference page again and change the color to black (that's the upper left square on my color palette).  Push OK, OK.  Nothing happens in the editor. 

Reproducible: Always
Comment 1 Mark Christiaens CLA 2011-04-07 04:05:36 EDT
I'm using 2.0 M6
Comment 2 Sebastian Zarnekow CLA 2011-04-07 04:09:52 EDT
This one depends on bug 306352 and it seems that we cannot do much about it. Is it possible to set comment color black in the Java Editor?
Comment 3 Mark Christiaens CLA 2011-04-07 04:14:28 EDT
(In reply to comment #2)
> This one depends on bug 306352 and it seems that we cannot do much about it. Is
> it possible to set comment color black in the Java Editor?

Yes, seems to work fine in the Java editor (tried for multi-line comments).  Also tried "restore to defaults" and it goes back to a boring green as expected.
Comment 4 Sebastian Zarnekow CLA 2011-05-04 06:11:40 EDT
Preliminary scheduled for 2.0RC1
Comment 5 Michael Clay CLA 2011-05-11 12:29:18 EDT
Created attachment 195386 [details]
proposed patch pls review and test

whats missing: integration with XtextEditor#affectsTextPresentation to immed. change the editor presentation. requires a shared preferencestore in IPreferenceStoreAccess.
Comment 6 Sebastian Zarnekow CLA 2011-05-13 08:10:19 EDT
Hi Michael,

thanks for the patch. Unfortunately it looks to complicated to me - at least at a first glance. Furthermore, there have been other changes which affect the preference access / store mechanism. Jan is currently digging into this topic. 

Regards,
Sebastian
Comment 7 Michael Clay CLA 2011-05-13 09:25:55 EDT
as mentioned in some comment here jdts java editor can set the comment color back to black i have investigated their solution (which is based on some intermediate preferencestore i.e. OverlayPreferenceStore) and ported it to Xtext to match the existing preferencestore handling in AbstractDetailsPart trying to minimize changes.

the (still existing) issue with the missing editor presentation integration should be handled in a separate bug.


(In reply to comment #6)
> Hi Michael,
> 
> thanks for the patch. Unfortunately it looks to complicated to me - at least at
> a first glance. Furthermore, there have been other changes which affect the
> preference access / store mechanism. Jan is currently digging into this topic. 
> 
> Regards,
> Sebastian
Comment 8 Jan Koehnlein CLA 2011-05-19 02:41:57 EDT
We fixed our preference store setup to get all changes propagated correctly.
There was also a bug in the handling of defaults in the AbstractDetailsPart. Seems to work fine now. 

Pushed to master.
Comment 9 Karsten Thoms CLA 2017-09-19 16:59:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 10 Karsten Thoms CLA 2017-09-19 17:11:14 EDT
Closing all bugs that were set to RESOLVED before Neon.0