Toggle button style/behavior to Vaadin Core


Vaadin Chameleon Theme
contains great demo of Toggle Buttons /Toggle Button Groups (see compound styles | Buttons).

I think It is good idea to add this behavior to Vaadin core (and core themes).

For example CheckBox and OptionGroup could have setToggleButtonMode(boolean) setter, which switch them from classic view to “button” view.

PS:


Sun’s Java Look and Feel Design Guidelines: Toggle Buttons

You could make an enhancement ticket about it.

Actually, the API kind of is there, setSwitchMode() - the CheckBox was originally just a mode of the Button component. That’s why it still inherits it.

You can actually
do the same with just core components
, without Chameleon. There’s a bit flicker though, because of the :active style, so the styling isn’t perfect.

But sure, it would be nice to have such thing in the core library.


ticket 6742