pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: TabPane closing & collapsing
Date Thu, 26 Aug 2010 17:01:07 GMT
Good points. Comments below:

> The logic to select a tab after another one is closed, exists as a custom
> TabPaneListener in TabPanes.java rather than in the TabPane component
> itself.
> Is it done this way because 'closing' a tab just results in a call to
> TabSequence.remove()?

Yes - but maybe we should be smarter about it. We automatically select the first tab that
is added to a TabPane; perhaps we should automatically select the next (or previous, if none
is available) tab when a tab is closed. Same logic could apply to Accordion. Then users wouldn't
need the custom listener.

> On a vaguely similar theme, should there be user friendly methods for
> handling the collapsed state of the TabPane?
> - tabPane.setCollapsed(boolean collapsed)
> - tabPane.isCollapsed()
> rather than
> - tabPane.setSelectedIndex(-1 / 0..n)
> - ((tabPane.getSelectedIndex() == -1) && isCollapsible())

I think this is a good idea. "collapsible" used to be a style property, so such a method wouldn't
have made sense. I think it would now, though.

Feel free to exercise your new commit privileges on these changes.  :-)


View raw message