This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268264

Summary: RendererFactory doesn't use correct foreground color for ReadOnly properties
Product: platform Reporter: Yann_Dameron
Component: ExplorerAssignee: Jan Peska <JPESKA>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Yann_Dameron 2016-09-29 08:08:11 UTC
I'm using an OutlineView to display ReadOnly<String> properties.
For one of them I'd like to display an icon so I tested different stuffs without good results...
I'm contacting you to know if I'm doing it wrong or if it comes from a bug in org.openide.explorer.propertysheet.RendererFactory.


ReadOnly<String> prop = ...
prop.setValue("suppressCustomEditor", Boolean.TRUE);
prop.setValue("valueIcon", greenIcon);

Doing that, as the property is ReadOnly, the icon used is automatically greyed which is not what I expected. Font colors (selected or not) are correct


ReadOnly<String> prop = ...
prop.setValue("suppressCustomEditor", Boolean.TRUE);
prop.setValue("valueIcon", greenIcon);
prop.setValue("htmlDisplayValue", "<html>" + textToDisplay + "</html>");

Doing that, the icon used is correct but the Selected foreground color is wrong (black instead of white)


ReadOnly<String> prop = ...
prop.setValue("suppressCustomEditor", Boolean.TRUE);
prop.setValue("valueIcon", greenIcon);
prop.setValue("htmlDisplayValue", "<html><font color=\"!Tree.background\">" + textToDisplay + "</html>");

Doing that, the icon used is correct but the unselected foreground color is wrong (black instead of grey)


Looking at the RendererFactory source code, I found few lines to use "Tree.textForeground" or Color.GREY on the noHtmlLabel.
As long as the HTML String doesn't define the color, I was expecting to reuse the default table colors 

http://forums.netbeans.org/viewtopic.php?t=66909