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

Bug 331311

Summary: [syntax highlighting] Syntax coloring for abstract classes
Product: [Eclipse Project] JDT Reporter: Björn Michael <b.michael>
Component: TextAssignee: Björn Michael <b.michael>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.6.1   
Target Milestone: 3.7 M5   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
3.7 HEAD patch
daniel_megert: review-
mylyn/context/zip
daniel_megert: review-
3.7 HEAD patch with a test daniel_megert: iplog+, daniel_megert: review+

Description Björn Michael CLA 2010-11-29 05:20:57 EST
Build Identifier: 20100917-0705

I find it very useful to colorizes interfaces and abstract classes with the same color with JDT built in syntax coloring.

Unfortunately, it isn't possible to assign different colors for classes and abstract classes in preferences->java->syntax coloring->element->java.

Reproducible: Always

Steps to Reproduce:
Open a java source file containing references to classes and abstract classes and try to assign different colors.
Comment 1 Björn Michael CLA 2010-12-05 14:47:50 EST
Created attachment 184559 [details]
3.7 HEAD patch

Support for syntax coloring of abstract classes.
Comment 2 Björn Michael CLA 2010-12-05 14:47:54 EST
Created attachment 184560 [details]
mylyn/context/zip
Comment 3 Dani Megert CLA 2010-12-06 06:51:44 EST
Thanks for the patch! I'll take a look during M5.
Comment 4 Dani Megert CLA 2010-12-16 09:06:56 EST
Thanks for the patch Björn. It's looks quite good. There are only some minor issues:

- I don't like to use the same color as for interfaces. Please choose a
  new, not yet used color.
- In the preview: use "AbstractClassName" instead of "AbstractClass".
- The comment on the following line:
      new ClassHighlighting(), // includes abstract classes - fallback
  is misleading: it will not include abstract classes if the class is detected 
  as abstract and the abstract SHL is enabled.
- Please add a tests to org.eclipse.jdt.text.tests.SemanticHighlightingTest
  (in org.eclipse.jdt.text.tests).
- Fill out this template and add it to the header comment of each changed file:
Your Name <email@example.com> - Bug Title - https://bugs.eclipse.org/BUG_NUMBER
Comment 5 Björn Michael CLA 2010-12-19 14:22:17 EST
Created attachment 185504 [details]
3.7 HEAD patch with a test

Thanks for reviewing the patch.

(In reply to comment #4)
> - I don't like to use the same color as for interfaces. Please choose a
> new, not yet used color.
Done - I set it to 139,136,22. I assigned the same color as for interfaces because abstract classes and interfaces are often used quite interchangeably.
> - In the preview: use "AbstractClassName" instead of "AbstractClass".
Done.
> - The comment on the following line:
> new ClassHighlighting(), // includes abstract classes - fallback
> is misleading: it will not include abstract classes if the class is detected
> as abstract and the abstract SHL is enabled.
Done. Set it to: // before classes
> - Please add a tests to org.eclipse.jdt.text.tests.SemanticHighlightingTest
> (in org.eclipse.jdt.text.tests).
org.eclipse.jdt.text.tests.SemanticHighlightingTest.testAbstractClassHighlighting() adopted.
> - Fill out this template and add it to the header comment of each changed file:
> Your Name <email@example.com> - Bug Title - https://bugs.eclipse.org/BUG_NUMBER
Done.
Comment 6 Dani Megert CLA 2011-01-03 10:54:06 EST
Thanks!

Committed the patch to HEAD with updated copyright date (2011).
Comment 7 Dani Megert CLA 2011-01-04 03:26:58 EST
Björn, the properties file does not like 'ö' in it. Do you prefer "Bjorn" or "Bjoern"? I used "Bjoern" for now.
Comment 8 Björn Michael CLA 2011-01-04 03:29:48 EST
Bjoern is ok.