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 - RendererFactory doesn't use correct foreground color for ReadOnly properties
Summary: RendererFactory doesn't use correct foreground color for ReadOnly properties
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-29 08:08 UTC by Yann_Dameron
Modified: 2016-09-29 08:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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