LabelButton
Add clicking features to label. To be used in forms where normal buttons aren't suitable.
Developed to use case where you want to present values in form with label, but offer edit functionality when clicked. Normal button also reserves caption for itself; where LabelButton leaves presentation of caption to parent layout, and uses value as it's own presentation value. This could be useful in forms where leaving caption out breaks the nice look'n feel of layout.
Add-on has been OSGi bundled.
Sample code
LabelButton label = new LabelButton("Caption", "Show notification", event -> Notification.show("Clicked!")); // Add-on provides some nice styling out-of-box. There add link style underlining and pointer cursor label.addStyleName(LabelButtonStyles.HOVER_UNDERLINE_WHEN_CLICKABLE); label.addStyleName(LabelButtonStyles.POINTER_WHEN_CLICKABLE); parentLayout.add(label); // .. you can easily jump between normal label and clickable state with label.setClickable(false); // behaves like normal label // .. and label.setClickable(true); // enables all click features and styling
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
0.2.0+ version are now for Vaadin 8. Vaadin 7 users should use 0.1.x versions.
- Released
- 2017-03-14
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 8.0+
- Vaadin 7.4+ in 0.1.3
- Browser
- Browser Independent
LabelButton - Vaadin Add-on Directory
Add clicking features to label. To be used in forms where normal buttons aren't suitable.Online Demo
Issue Tracker
Source Code
LabelButton version 0.1.0
Initial release
LabelButton version 0.1.2
OSGi bundle fixes part II, fixing export rules.
LabelButton version 0.1.3
- Adds mode where LabelButton will not show tooltips. This is for users of ColumnLayout add-on's material design mode. Where parent layout shows the errors and descriptions of children.
- By default with Valo's theme, will match color with link buttons
LabelButton version 0.2.0
0.2.0+ version are now for Vaadin 8. Vaadin 7 users should use 0.1.x versions.