diff options
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/TabSheet.java')
-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(); } |