Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Custom ListCellRenderer not inheriting from SubstanceDefaultListCellRenderer #111

Open
cmadsen opened this issue Dec 27, 2012 · 2 comments

Comments

@cmadsen
Copy link

cmadsen commented Dec 27, 2012

I'm trying to do

class CheckBoxListRenderer extends JCheckBox implements ListCellRenderer 

but the Substance highlighting/striping etc will only work for SubstanceDefaultListCellRenderer.

Would it be possible to lessen the requirements to list cell renders to implement an interface/annotation or perhaps just add a new list cell renderer like SubstanceDefaultTableCellRenderer.BooleanRenderer?

@fpaaske
Copy link

fpaaske commented Mar 11, 2013

It's the same issue with implements TableCellRenderer
I'd love to see some solution that does not require the application to introduce dependencies to the LAF :-)

@xmedeko
Copy link

xmedeko commented Apr 17, 2013

The problem is in the SubstanceTableUI.isSubstanceDefaultRenderer:

return (instance instanceof SubstanceDefaultTableCellRenderer)
        || (instance instanceof SubstanceDefaultTableCellRenderer.BooleanRenderer);

I think the solution 1) may be to use some kind of tag to decide, whether to use Substance highlighting/striping or not. It can be either an annotationor, (empty) interface, or a JComponent client property.

Another simple solution 2) could be to make this method protected/public to allow override it. Or, the best, do both 1) and 2).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants