diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-03-24 10:34:05 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-24 10:34:05 +0200 |
commit | 8fcb2da138eced17f0a6105ae39122a9d096ef0b (patch) | |
tree | 8e72ba50f792d85fe7e22e710cbe972c7a5091fb /server | |
parent | b32d7b0e45ddc9d7b720bc603ce5374404381a81 (diff) | |
download | vaadin-framework-8fcb2da138eced17f0a6105ae39122a9d096ef0b.tar.gz vaadin-framework-8fcb2da138eced17f0a6105ae39122a9d096ef0b.zip |
Add possibility to configure the content mode of TabSheet tabs (#8920)
Fixes #8590
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/TabSheet.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java index b48d35592a..ec018e5fbf 100644 --- a/server/src/main/java/com/vaadin/ui/TabSheet.java +++ b/server/src/main/java/com/vaadin/ui/TabSheet.java @@ -40,6 +40,7 @@ import com.vaadin.server.KeyMapper; import com.vaadin.server.Resource; import com.vaadin.shared.ComponentConstants; import com.vaadin.shared.Registration; +import com.vaadin.shared.ui.ContentMode; import com.vaadin.shared.ui.tabsheet.TabState; import com.vaadin.shared.ui.tabsheet.TabsheetClientRpc; import com.vaadin.shared.ui.tabsheet.TabsheetServerRpc; @@ -1011,6 +1012,11 @@ public class TabSheet extends AbstractComponentContainer * Sets the description for the tab. The description can be used to * briefly describe the state of the tab to the user, and is typically * shown as a tooltip when hovering over the tab. + * <p> + * Setting a description through this method will additionally set the + * content mode of the description to preformatted. For setting a + * different content mode see the overload + * {@link #setDescription(String, ContentMode)}. * * @param description * the new description string for the tab. @@ -1018,6 +1024,22 @@ public class TabSheet extends AbstractComponentContainer public void setDescription(String description); /** + * Sets the description for the tab. The description can be used to + * briefly describe the state of the tab to the user, and is typically + * shown as a tooltip when hovering over the tab. + * + * @see ContentMode + * + * @param description + * the new description string for the tab + * @param mode + * content mode used to display the description + * + * @since 8.1 + */ + public void setDescription(String description, ContentMode mode); + + /** * Sets an error indicator to be shown in the tab. This can be used e.g. * to communicate to the user that there is a problem in the contents of * the tab. @@ -1217,7 +1239,13 @@ public class TabSheet extends AbstractComponentContainer @Override public void setDescription(String description) { + setDescription(description, ContentMode.PREFORMATTED); + } + + @Override + public void setDescription(String description, ContentMode mode) { tabState.description = description; + tabState.descriptionContentMode = mode; markAsDirty(); } |