Bug 564255

Summary: RegistryCSSElementProvider getElement only returns the 1st match
Product: [Eclipse Project] Platform Reporter: Page <pagew2000>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, seema.sonawane
Version: 4.10   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=433789
Whiteboard:
Attachments:
Description Flags
Sample code to show the issue none

Description Page CLA 2020-06-12 13:27:50 EDT
Created attachment 283264 [details]
Sample code to show the issue

Our project has a requirement to use CSS to define colors for Section, including the title foreground color.

Using extension org.eclipse.e4.ui.css.core.propertyHandler, I have provided my own handler and my own element provider through org.eclipse.e4.ui.css.core.elementProvider. However, the handler registered for Section sometimes are ignored.

Further debug shows Eclipse has a SectionElement and handler (org.eclipse.ui.internal.forms.css.properties.css2.CSSPropertyTitleFormsHandler) defined in org.eclipse.ui.forms. Sometimes this handler from Eclipse is found and used instead of my own handler/element.

RegistryCSSElementProvider getElement() should have a better logic to find the needed handler.

I have attached sample program to show the issue.

Note1: I notice the issue is easier to duplicate on Linux than on Win.

Note2: The problem is not consistent. Sometimes my custom handler is invoked; sometimes it is not. I think RegistryCSSElementProvider.getElement() returns the 1st match found; but the order is not always same.
Comment 1 Seema Sonawane CLA 2023-11-09 08:48:49 EST
experiencing the same issue