Custom rendering of a ReadOnly property in an OutlineView

"Yann Dameron" <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
Hi guys,

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.


Code:
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
[Image: http://forums.netbeans.org/files/case_01_110.png ]



Code:
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)
[Image: http://forums.netbeans.org/files/case_02_199.png ]




Code:
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)
[Image: http://forums.netbeans.org/files/case_03_201.png ]

Looking at the RendererFactory source code, I found few lines to use Color.GREY on the noHtmlLabel.
Shouldn't we have them for both labels (htmlLabel & noHtmlLabel) ?

Regards,
Yann




Attachments: 
http://forums.netbeans.org//files/case_03_201.png
http://forums.netbeans.org//files/case_02_199.png
http://forums.netbeans.org//files/case_01_110.png
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.