Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add always expanded SourceList categories #161

Open
GoogleCodeExporter opened this issue May 4, 2015 · 1 comment
Open

Add always expanded SourceList categories #161

GoogleCodeExporter opened this issue May 4, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I'd love to see a way to make SourceList categories always expanded, like some 
of them are in 
iTunes (e.g. Library, Store).

One would have to remove the little open/close triangle and make sure that the 
node is expanded 
by default. This could be an attribute of the SourceListCategory class.

Original issue reported on code.google.com by [email protected] on 7 Apr 2010 at 11:09

Attachments:

@GoogleCodeExporter
Copy link
Author

This could be achieved by a combination of things:

1) add a property boolean isAlwaysExpanded to SourceListCategory (and perhaps 
add an interface 
ExpansionControlProvider for the DefaultMutableTreeNode use case)
2) overwrite boolean shouldPaintExpandControl in SourceListTreeUI, so that it 
somehow checks for isAlwaysExpanded in potential nodes
3) make sure that the always expanded nodes are always expanded - maybe when 
you add them to the model
4) prevent the clickable space where the ExpandControl would be from firing an 
expansion/contraction event. 
this can be done by adding a TreeWillExpandListener to the JTree, that throws 
an ExpandVetoException, if the 
clicked on node corresponds to a SourceListCategory with isAlwaysExpanded == 
true

What's not solved in this approach, is that the always expanded categories are 
indented by the amount of 
space the little triangle would have taken up (and they shouldn't be).

Original comment by [email protected] on 7 Apr 2010 at 3:52

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

No branches or pull requests

1 participant