summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis <denis@vaadin.com>2017-01-20 10:13:25 +0200
committerGitHub <noreply@github.com>2017-01-20 10:13:25 +0200
commit1fb40df8742791803e0a08328028bbbd67deb78b (patch)
tree0af44b046f5b76f775f5da4e65e5be69bb2764b0
parentf42b9657b818da483b839d3b43b4cf55552ef034 (diff)
downloadvaadin-framework-1fb40df8742791803e0a08328028bbbd67deb78b.tar.gz
vaadin-framework-1fb40df8742791803e0a08328028bbbd67deb78b.zip
Overload AbstarctComponent.setDescription() with content mode parameter (#8252)
* Overload AbstarctComponent.setDescription() with content mode parameter Fixes #8185
-rw-r--r--client/src/main/java/com/vaadin/client/TooltipInfo.java56
-rw-r--r--client/src/main/java/com/vaadin/client/VTooltip.java41
-rw-r--r--client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java3
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VMenuBar.java4
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VTabsheet.java4
-rw-r--r--compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java2
-rw-r--r--compatibility-themes/src/main/themes/VAADIN/themes/base/common/common.scss3
-rw-r--r--server/src/main/java/com/vaadin/server/FontIcon.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractComponent.java26
-rw-r--r--server/src/main/java/com/vaadin/ui/Label.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/csslayout/CssLayoutDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/label/LabelDeclarativeTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java2
-rw-r--r--shared/src/main/java/com/vaadin/shared/AbstractComponentState.java3
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/ContentMode.java (renamed from shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java)2
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/label/LabelState.java1
m---------tests/screenshots0
-rw-r--r--themes/src/main/themes/VAADIN/themes/valo/shared/_tooltip.scss3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/LayoutDemo.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/NativeWindowing.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/PerformanceTestBasicComponentRendering.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/PerformanceTestSubTreeCaching.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestForUpload.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestIFrames.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/TestBase.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipModes.java47
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/customcomponent/ClipContent.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/label/LabelTooltip.java9
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/label/Labels.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/label/MarginsInLabels.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectJump.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldNotScroll.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewOffScreen.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaEmptyString.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/HeaderRightClickAfterDrag.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/TableInTabsheet.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/TableRowScrolledBottom.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/Tables.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/treetable/ComponentsInTreeTable.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/ui/LazyInitUIs.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/ui/UISerialization.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/extensions/ResponsiveUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/integration/JSR286Portlet.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/HiddenHorizontalLayout.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/TestLayoutPerformance.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/push/BasicPush.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/push/PushConfigurator.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/util/Log.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/util/SampleDirectory.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestConnector.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestRpc.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/widgetset/server/v7/grid/GridClientColumnRenderers.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/TooltipModesTest.java64
96 files changed, 323 insertions, 105 deletions
diff --git a/client/src/main/java/com/vaadin/client/TooltipInfo.java b/client/src/main/java/com/vaadin/client/TooltipInfo.java
index 1f819438ef..a84e45e988 100644
--- a/client/src/main/java/com/vaadin/client/TooltipInfo.java
+++ b/client/src/main/java/com/vaadin/client/TooltipInfo.java
@@ -15,12 +15,15 @@
*/
package com.vaadin.client;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.util.SharedUtil;
public class TooltipInfo {
private String title;
+ private ContentMode contentMode;
+
private String errorMessageHtml;
// Contains the tooltip's identifier. If a tooltip's contents and this
@@ -32,16 +35,57 @@ public class TooltipInfo {
}
public TooltipInfo(String tooltip) {
- setTitle(tooltip);
+ this(tooltip, ContentMode.PREFORMATTED);
}
+ /**
+ * Constructs a new instance using the {@code tooltip} for the title and
+ * {@code errorMessage} as a description.
+ *
+ * @param tooltip
+ * tooltip title
+ * @param errorMessage
+ * error description
+ *
+ * @deprecated use {@link #TooltipInfo(String, ContentMode, String)} instead
+ */
+ @Deprecated
public TooltipInfo(String tooltip, String errorMessage) {
- this(tooltip, errorMessage, null);
+ this(tooltip, ContentMode.HTML, errorMessage, null);
}
+ /**
+ * Constructs a new instance using the {@code tooltip} for the title,
+ * {@code errorMessage} as a description and {@code identifier} as its id.
+ *
+ * @param tooltip
+ * tooltip title
+ * @param errorMessage
+ * error description
+ * @param identifier
+ *
+ * @deprecated use {@link #TooltipInfo(String, ContentMode, String, Object)}
+ * instead
+ */
+ @Deprecated
public TooltipInfo(String tooltip, String errorMessage, Object identifier) {
+ this(tooltip, ContentMode.HTML, errorMessage, identifier);
+ }
+
+ public TooltipInfo(String tooltip, ContentMode mode) {
+ setTitle(tooltip);
+ setContentMode(mode);
+ }
+
+ public TooltipInfo(String tooltip, ContentMode mode, String errorMessage) {
+ this(tooltip, mode, errorMessage, null);
+ }
+
+ public TooltipInfo(String tooltip, ContentMode mode, String errorMessage,
+ Object identifier) {
setIdentifier(identifier);
setTitle(tooltip);
+ setContentMode(mode);
setErrorMessage(errorMessage);
}
@@ -69,6 +113,14 @@ public class TooltipInfo {
errorMessageHtml = errorMessage;
}
+ public ContentMode getContentMode() {
+ return contentMode;
+ }
+
+ public void setContentMode(ContentMode contentMode) {
+ this.contentMode = contentMode;
+ }
+
/**
* Checks is a message has been defined for the tooltip.
*
diff --git a/client/src/main/java/com/vaadin/client/VTooltip.java b/client/src/main/java/com/vaadin/client/VTooltip.java
index 21a3287442..b9fbfa1470 100644
--- a/client/src/main/java/com/vaadin/client/VTooltip.java
+++ b/client/src/main/java/com/vaadin/client/VTooltip.java
@@ -18,7 +18,10 @@ package com.vaadin.client;
import com.google.gwt.aria.client.LiveValue;
import com.google.gwt.aria.client.RelevantValue;
import com.google.gwt.aria.client.Roles;
+import com.google.gwt.core.shared.GWT;
+import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.PreElement;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
@@ -38,6 +41,7 @@ import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ui.VOverlay;
@@ -51,7 +55,7 @@ public class VTooltip extends VOverlay {
public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN | Event.ONMOUSEOVER
| Event.ONMOUSEOUT | Event.ONMOUSEMOVE | Event.ONCLICK;
VErrorMessage em = new VErrorMessage();
- Element description = DOM.createDiv();
+ HTML description = GWT.create(HTML.class);
private TooltipInfo currentTooltipInfo = new TooltipInfo(" ");
@@ -88,8 +92,8 @@ public class VTooltip extends VOverlay {
FlowPanel layout = new FlowPanel();
setWidget(layout);
layout.add(em);
- DOM.setElementProperty(description, "className", CLASSNAME + "-text");
- DOM.appendChild(layout.getElement(), description);
+ description.setStyleName(CLASSNAME + "-text");
+ layout.add(description);
// When a tooltip is shown, the content of the tooltip changes. With a
// tooltip being a live-area, this change is notified to a assistive
@@ -128,7 +132,7 @@ public class VTooltip extends VOverlay {
setTooltipText(new TooltipInfo(" "));
showTooltip();
hideTooltip();
- description.getParentElement().getStyle().clearWidth();
+ description.getParent().getElement().getStyle().clearWidth();
}
private void setTooltipText(TooltipInfo info) {
@@ -140,7 +144,24 @@ public class VTooltip extends VOverlay {
em.setVisible(false);
}
if (info.getTitle() != null && !info.getTitle().isEmpty()) {
- description.setInnerHTML(info.getTitle());
+ switch (info.getContentMode()) {
+ case HTML:
+ description.setHTML(info.getTitle());
+ break;
+ case TEXT:
+ description.setText(info.getTitle());
+ break;
+ case PREFORMATTED:
+ PreElement preElement = Document.get().createPreElement();
+ preElement.setInnerText(info.getTitle());
+ // clear existing content
+ description.setHTML("");
+ // add preformatted text to dom
+ description.getElement().appendChild(preElement);
+ break;
+ default:
+ break;
+ }
/*
* Issue #11871: to correctly update the offsetWidth of description
* element we need to clear style width of its parent DIV from old
@@ -156,11 +177,11 @@ public class VTooltip extends VOverlay {
* native GWT method getSubPixelOffsetWidth()) of description
* element")
*/
- description.getParentElement().getStyle().clearWidth();
- description.getStyle().clearDisplay();
+ description.getParent().getElement().getStyle().clearWidth();
+ description.getElement().getStyle().clearDisplay();
} else {
- description.setInnerHTML("");
- description.getStyle().setDisplay(Display.NONE);
+ description.setHTML("");
+ description.getElement().getStyle().setDisplay(Display.NONE);
}
currentTooltipInfo = info;
}
@@ -439,7 +460,7 @@ public class VTooltip extends VOverlay {
@Override
public void hide() {
em.updateMessage("");
- description.setInnerHTML("");
+ description.setHTML("");
updatePosition(null, true);
setPopupPosition(tooltipEventMouseX, tooltipEventMouseY);
diff --git a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
index d7b6d52f98..e35accb1b1 100644
--- a/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/AbstractComponentConnector.java
@@ -761,7 +761,8 @@ public abstract class AbstractComponentConnector extends AbstractConnector
@Override
public TooltipInfo getTooltipInfo(Element element) {
- return new TooltipInfo(getState().description, getState().errorMessage);
+ return new TooltipInfo(getState().description,
+ getState().descriptionContentMode, getState().errorMessage);
}
@Override
diff --git a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java
index 2f1b93994b..6527ac8c93 100644
--- a/client/src/main/java/com/vaadin/client/ui/VMenuBar.java
+++ b/client/src/main/java/com/vaadin/client/ui/VMenuBar.java
@@ -54,6 +54,7 @@ import com.vaadin.client.TooltipInfo;
import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.WidgetUtil;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.menubar.MenuBarConstants;
public class VMenuBar extends SimpleFocusablePanel
@@ -1087,7 +1088,8 @@ public class VMenuBar extends SimpleFocusablePanel
return null;
}
- return new TooltipInfo(description, null, this);
+ return new TooltipInfo(description, ContentMode.PREFORMATTED, null,
+ this);
}
/**
diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
index 4b8c9b2602..8fbd3bcd74 100644
--- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
+++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
@@ -73,6 +73,7 @@ import com.vaadin.shared.ComponentConstants;
import com.vaadin.shared.EventId;
import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc;
import com.vaadin.shared.ui.ComponentStateUtil;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.tabsheet.TabState;
import com.vaadin.shared.ui.tabsheet.TabsheetServerRpc;
import com.vaadin.shared.ui.tabsheet.TabsheetState;
@@ -339,7 +340,8 @@ public class VTabsheet extends VTabsheetBase
if (tabState.description != null
|| tabState.componentError != null) {
setTooltipInfo(new TooltipInfo(tabState.description,
- tabState.componentError, this));
+ ContentMode.PREFORMATTED, tabState.componentError,
+ this));
} else {
setTooltipInfo(null);
}
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java
index 8c7560685c..064627ade1 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java
+++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridHeaderFooterDeclarativeTest.java
@@ -20,7 +20,7 @@ import org.jsoup.parser.Tag;
import org.junit.Assert;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.declarative.DesignContext;
import com.vaadin.v7.ui.Grid;
diff --git a/compatibility-themes/src/main/themes/VAADIN/themes/base/common/common.scss b/compatibility-themes/src/main/themes/VAADIN/themes/base/common/common.scss
index ae811bac79..4e6381aad7 100644
--- a/compatibility-themes/src/main/themes/VAADIN/themes/base/common/common.scss
+++ b/compatibility-themes/src/main/themes/VAADIN/themes/base/common/common.scss
@@ -132,6 +132,9 @@ body &.v-app .v-app-loading {
}
.v-tooltip-text {
overflow: auto;
+ pre {
+ margin: 0px;
+ }
}
.v-tooltip .v-errormessage {
overflow: auto;
diff --git a/server/src/main/java/com/vaadin/server/FontIcon.java b/server/src/main/java/com/vaadin/server/FontIcon.java
index c7aeec2987..cd2e0550b9 100644
--- a/server/src/main/java/com/vaadin/server/FontIcon.java
+++ b/server/src/main/java/com/vaadin/server/FontIcon.java
@@ -16,7 +16,7 @@
package com.vaadin.server;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
/**
diff --git a/server/src/main/java/com/vaadin/ui/AbstractComponent.java b/server/src/main/java/com/vaadin/ui/AbstractComponent.java
index 03a7c14eb5..e2e51a2eca 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractComponent.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractComponent.java
@@ -43,7 +43,6 @@ import com.vaadin.event.ContextClickEvent.ContextClickListener;
import com.vaadin.event.ContextClickEvent.ContextClickNotifier;
import com.vaadin.event.ShortcutListener;
import com.vaadin.server.AbstractClientConnector;
-import com.vaadin.server.AbstractErrorMessage.ContentMode;
import com.vaadin.server.ComponentSizeValidator;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.ErrorMessage.ErrorLevel;
@@ -62,6 +61,7 @@ import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.ComponentStateUtil;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.util.SharedUtil;
import com.vaadin.ui.declarative.DesignAttributeHandler;
import com.vaadin.ui.declarative.DesignContext;
@@ -491,15 +491,32 @@ public abstract class AbstractComponent extends AbstractClientConnector
* Sets the component's description. See {@link #getDescription()} for more
* information on what the description is.
*
- * The description is displayed as HTML in tooltips or directly in certain
+ * @see #setDescription(String, ContentMode)
+ * @param description
+ * the new description string for the component.
+ */
+ public void setDescription(String description) {
+ setDescription(description, ContentMode.PREFORMATTED);
+ }
+
+ /**
+ * Sets the component's description using given content {@code mode}. See
+ * {@link #getDescription()} for more information on what the description
+ * is.
+ * <p>
+ * If the content {@code mode} is {@literal ContentMode.HTML} the
+ * description is displayed as HTML in tooltips or directly in certain
* components so care should be taken to avoid creating the possibility for
* HTML injection and possibly XSS vulnerabilities.
*
* @param description
* the new description string for the component.
+ * @param mode
+ * the content mode for the description
*/
- public void setDescription(String description) {
+ public void setDescription(String description, ContentMode mode) {
getState().description = description;
+ getState().descriptionContentMode = mode;
}
/*
@@ -949,7 +966,8 @@ public abstract class AbstractComponent extends AbstractClientConnector
readSize(attr);
// handle component error
if (attr.hasKey("error")) {
- UserError error = new UserError(attr.get("error"), ContentMode.HTML,
+ UserError error = new UserError(attr.get("error"),
+ com.vaadin.server.AbstractErrorMessage.ContentMode.HTML,
ErrorLevel.ERROR);
setComponentError(error);
}
diff --git a/server/src/main/java/com/vaadin/ui/Label.java b/server/src/main/java/com/vaadin/ui/Label.java
index 8042f3b865..22ed77703c 100644
--- a/server/src/main/java/com/vaadin/ui/Label.java
+++ b/server/src/main/java/com/vaadin/ui/Label.java
@@ -20,7 +20,7 @@ import java.util.Collection;
import org.jsoup.nodes.Element;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.label.LabelState;
import com.vaadin.ui.declarative.DesignContext;
import com.vaadin.ui.declarative.DesignFormatter;
diff --git a/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java b/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java
index ff4b6a9ada..8c24c24406 100644
--- a/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java
+++ b/server/src/test/java/com/vaadin/tests/design/AbstractComponentSetResponsiveTest.java
@@ -17,7 +17,7 @@ package com.vaadin.tests.design;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
public class AbstractComponentSetResponsiveTest
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
index 0ee61e6b8d..018aa25cd4 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
@@ -29,12 +29,12 @@ import org.junit.Before;
import org.junit.Test;
import com.vaadin.server.ErrorMessage.ErrorLevel;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.server.ExternalResource;
import com.vaadin.server.FileResource;
import com.vaadin.server.Responsive;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.UserError;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.design.DeclarativeTestBase;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
index 84b4b6135d..ec8db9e461 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.server.component.DeclarativeMarginTestBase;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/csslayout/CssLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/csslayout/CssLayoutDeclarativeTest.java
index 647e89682d..113d7d1265 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/csslayout/CssLayoutDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/csslayout/CssLayoutDeclarativeTest.java
@@ -17,7 +17,7 @@ package com.vaadin.tests.server.component.csslayout;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.design.DeclarativeTestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CssLayout;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
index 8c435f831d..5cbf5eb8b1 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java
@@ -29,8 +29,8 @@ import com.vaadin.data.SelectionModel.Multi;
import com.vaadin.data.SelectionModel.Single;
import com.vaadin.data.provider.DataProvider;
import com.vaadin.data.provider.Query;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.grid.HeightMode;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.data.bean.Person;
import com.vaadin.tests.server.component.abstractlisting.AbstractListingDeclarativeTest;
import com.vaadin.ui.Grid;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
index 6b81df7e70..0c1b4ce162 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
@@ -22,7 +22,7 @@ import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.server.component.DeclarativeMarginTestBase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/label/LabelDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/label/LabelDeclarativeTest.java
index ae8e5c6878..7a0a8957b0 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/label/LabelDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/label/LabelDeclarativeTest.java
@@ -21,7 +21,7 @@ import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.design.DeclarativeTestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.declarative.DesignContext;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java
index f14fc26bdc..c2ff94025f 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetDeclarativeTest.java
@@ -18,7 +18,7 @@ package com.vaadin.tests.server.component.tabsheet;
import org.junit.Test;
import com.vaadin.server.ExternalResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.design.DeclarativeTestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
diff --git a/shared/src/main/java/com/vaadin/shared/AbstractComponentState.java b/shared/src/main/java/com/vaadin/shared/AbstractComponentState.java
index a60ae7aaf5..81f808f676 100644
--- a/shared/src/main/java/com/vaadin/shared/AbstractComponentState.java
+++ b/shared/src/main/java/com/vaadin/shared/AbstractComponentState.java
@@ -20,6 +20,7 @@ import java.util.List;
import com.vaadin.shared.annotations.NoLayout;
import com.vaadin.shared.communication.SharedState;
+import com.vaadin.shared.ui.ContentMode;
/**
* Default shared state implementation for AbstractComponent.
@@ -33,6 +34,8 @@ public class AbstractComponentState extends SharedState {
public String width = "";
@NoLayout
public String description = "";
+ @NoLayout
+ public ContentMode descriptionContentMode = ContentMode.PREFORMATTED;
// Note: for the caption, there is a difference between null and an empty
// string!
public String caption = null;
diff --git a/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java b/shared/src/main/java/com/vaadin/shared/ui/ContentMode.java
index f5d31fe46f..e283728425 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/label/ContentMode.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/ContentMode.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.shared.ui.label;
+package com.vaadin.shared.ui;
/**
* Content modes defining how the client should interpret a Label's value.
diff --git a/shared/src/main/java/com/vaadin/shared/ui/label/LabelState.java b/shared/src/main/java/com/vaadin/shared/ui/label/LabelState.java
index 40a6399817..84e65449e6 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/label/LabelState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/label/LabelState.java
@@ -16,6 +16,7 @@
package com.vaadin.shared.ui.label;
import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.shared.ui.ContentMode;
public class LabelState extends AbstractComponentState {
{
diff --git a/tests/screenshots b/tests/screenshots
-Subproject e9f8b30d0db8076f24c9253f078b2931f0ecd3f
+Subproject e8a1a198f0c42b2780edc75d9e45993bcebb482
diff --git a/themes/src/main/themes/VAADIN/themes/valo/shared/_tooltip.scss b/themes/src/main/themes/VAADIN/themes/valo/shared/_tooltip.scss
index e0c24c8b65..ff5e855b66 100644
--- a/themes/src/main/themes/VAADIN/themes/valo/shared/_tooltip.scss
+++ b/themes/src/main/themes/VAADIN/themes/valo/shared/_tooltip.scss
@@ -104,6 +104,9 @@ $v-tooltip-border-radius: $v-border-radius - 1px !default;
max-height: 10em;
overflow: auto;
margin-top: $v-tooltip-padding-vertical * 2;
+ pre {
+ margin: 0px;
+ }
}
.v-errormessage[aria-hidden="true"] + .v-tooltip-text {
diff --git a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
index 580faf9be3..2cf1154943 100644
--- a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
+++ b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
@@ -16,7 +16,7 @@
package com.vaadin.tests;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component.Event;
diff --git a/uitest/src/main/java/com/vaadin/tests/LayoutDemo.java b/uitest/src/main/java/com/vaadin/tests/LayoutDemo.java
index 87c1a312fa..3437153d0b 100644
--- a/uitest/src/main/java/com/vaadin/tests/LayoutDemo.java
+++ b/uitest/src/main/java/com/vaadin/tests/LayoutDemo.java
@@ -17,7 +17,7 @@
package com.vaadin.tests;
import com.vaadin.server.ClassResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Component;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java b/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java
index d1dfdd8e7d..615fe7f489 100644
--- a/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java
+++ b/uitest/src/main/java/com/vaadin/tests/NativeWindowing.java
@@ -20,7 +20,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import com.vaadin.server.LegacyApplication;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/uitest/src/main/java/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
index ea05333c33..21af0faea6 100644
--- a/uitest/src/main/java/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
+++ b/uitest/src/main/java/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
@@ -20,7 +20,7 @@ import java.util.Date;
import java.util.Map;
import com.vaadin.server.UserError;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestDateField;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
diff --git a/uitest/src/main/java/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/uitest/src/main/java/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
index 2077b3e4b5..55987c1d4b 100644
--- a/uitest/src/main/java/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
+++ b/uitest/src/main/java/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
@@ -18,7 +18,7 @@ package com.vaadin.tests;
import java.util.Date;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/uitest/src/main/java/com/vaadin/tests/PerformanceTestSubTreeCaching.java
index 3f2870e9c8..a959ae2750 100644
--- a/uitest/src/main/java/com/vaadin/tests/PerformanceTestSubTreeCaching.java
+++ b/uitest/src/main/java/com/vaadin/tests/PerformanceTestSubTreeCaching.java
@@ -18,7 +18,7 @@ package com.vaadin.tests;
import java.util.Date;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
diff --git a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
index 96566efa98..016a2d3d84 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
@@ -20,7 +20,7 @@ import com.vaadin.server.ClassResource;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.ExternalResource;
import com.vaadin.server.UserError;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestDateField;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractDateField;
diff --git a/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java b/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java
index 181ed80df9..77db536053 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestForNativeWindowing.java
@@ -20,7 +20,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import com.vaadin.server.LegacyApplication;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java b/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java
index 8bd16c8461..790ee06c20 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestForStyledUpload.java
@@ -28,7 +28,7 @@ import java.lang.management.MemoryMXBean;
import com.vaadin.server.LegacyApplication;
import com.vaadin.server.StreamResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/TestForUpload.java b/uitest/src/main/java/com/vaadin/tests/TestForUpload.java
index 56c10a13c3..24e4683f5e 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestForUpload.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestForUpload.java
@@ -29,7 +29,7 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import com.vaadin.server.StreamResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
diff --git a/uitest/src/main/java/com/vaadin/tests/TestIFrames.java b/uitest/src/main/java/com/vaadin/tests/TestIFrames.java
index 88567a4d2b..0dd5c96004 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestIFrames.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestIFrames.java
@@ -16,7 +16,7 @@
package com.vaadin.tests;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java b/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
index cbc157e08f..3f5a44f61a 100644
--- a/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
+++ b/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
@@ -19,7 +19,7 @@ package com.vaadin.tests;
import java.io.File;
import com.vaadin.server.VaadinSession;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.util.SampleDirectory;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
diff --git a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java
index c59c99d241..a296e3342d 100644
--- a/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java
+++ b/uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java
@@ -19,7 +19,7 @@ package com.vaadin.tests;
import java.util.LinkedList;
import java.util.Random;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
import com.vaadin.ui.Panel;
diff --git a/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java b/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java
index c3ba0adb0b..bcee266519 100644
--- a/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/application/ApplicationCloseTest.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.application;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java
index 118f4e6b12..aa0a92c364 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/AbstractTestUI.java
@@ -7,7 +7,7 @@ import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.server.WebBrowser;
import com.vaadin.shared.communication.PushMode;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.ui.Transport;
import com.vaadin.shared.ui.ui.UIState.PushConfigurationState;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/TestBase.java b/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
index 6587a2dde3..9a3906bdc0 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/TestBase.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipModes.java b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipModes.java
new file mode 100644
index 0000000000..c8633ee89d
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/TooltipModes.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.abstractcomponent;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+
+/**
+ * @author Vaadin Ltd
+ *
+ */
+public class TooltipModes extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Button label = new Button("Label. Hover to see tooltip");
+ label.setDescription("Several\n lines\n tooltip");
+ addComponent(label);
+
+ Button useHtml = new Button("Use Html in the tooltip",
+ event -> label.setDescription(
+ "<div>Html <b><span>tooltip</span></b></div>",
+ ContentMode.HTML));
+ addComponent(useHtml);
+
+ Button usePreformatted = new Button("Use plain text in the tooltip",
+ event -> label.setDescription("<b>tooltip</b>",
+ ContentMode.TEXT));
+ addComponent(usePreformatted);
+ }
+
+}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
index b5ed6a3461..3aa6ab45e1 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.button;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java b/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java
index 12a48b1a96..c97e69bd68 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.caption;
import com.vaadin.server.ThemeResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.VaadinClasses;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
index c4b8bc289c..1fc5884d34 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
@@ -30,8 +30,8 @@ import com.vaadin.annotations.Widgetset;
import com.vaadin.data.HasValue.ValueChangeEvent;
import com.vaadin.server.StreamResource;
import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.colorpicker.Color;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.AbstractColorPicker;
import com.vaadin.ui.Alignment;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/customcomponent/ClipContent.java b/uitest/src/main/java/com/vaadin/tests/components/customcomponent/ClipContent.java
index df666e0ad6..7e7b0d9450 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/customcomponent/ClipContent.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/customcomponent/ClipContent.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.customcomponent;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java
index 9ad1b3fc61..bbb5c34c03 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java
@@ -27,7 +27,7 @@ import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.server.StreamVariable;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.DragAndDropWrapper;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java
index facf45e122..2e2c791e5e 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/SingleUseDragAndDropUpload.java
@@ -27,7 +27,7 @@ import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.server.FontAwesome;
import com.vaadin.server.StreamVariable;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractTestUIWithLog;
import com.vaadin.ui.Button;
import com.vaadin.ui.DragAndDropWrapper;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.java b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.java
index 168cf25acc..1006566980 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.draganddropwrapper;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.DragAndDropWrapper;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java
index dd6bb14aa2..117291efee 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelModes.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.label;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java
index f81ed25db9..f9f5120284 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTest.java
@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTooltip.java b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTooltip.java
index 9512edc4b7..8f1f878814 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/label/LabelTooltip.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/label/LabelTooltip.java
@@ -1,15 +1,16 @@
package com.vaadin.tests.components.label;
import com.vaadin.server.UserError;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-public class LabelTooltip extends TestBase {
+public class LabelTooltip extends AbstractTestUI {
@Override
- protected void setup() {
+ protected void setup(VaadinRequest request) {
addComponent(createLayout());
}
@@ -41,7 +42,7 @@ public class LabelTooltip extends TestBase {
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "The lower label should have an error indicator. The upper should not.";
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java b/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java
index 416de00bdb..440189f3cb 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/label/Labels.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.label;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/label/MarginsInLabels.java b/uitest/src/main/java/com/vaadin/tests/components/label/MarginsInLabels.java
index 419d990da3..1850278ee7 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/label/MarginsInLabels.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/label/MarginsInLabels.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.label;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.AbstractLayout;
import com.vaadin.ui.Accordion;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectJump.java b/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectJump.java
index 697759941c..fa5c151c79 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectJump.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/listselect/ListSelectJump.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.listselect;
import java.util.ArrayList;
import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.MarginInfo;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
index d430774b91..d0df54fe23 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.optiongroup;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
import com.vaadin.v7.data.Property;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
index 3cb7ba417f..b2f9b29bbf 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
@@ -10,7 +10,7 @@ import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.UserError;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractOrderedLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
index f9c298c217..0d7a4b6628 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.orderedlayout;
import com.vaadin.server.ThemeResource;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldNotScroll.java b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
index e4f9eb46f0..991410407c 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.panel;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewOffScreen.java b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
index 9303ec9fb3..fcc1fb8798 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.components.popupview;
import java.util.ArrayList;
import java.util.List;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaEmptyString.java b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaEmptyString.java
index 01dc10220f..ef531b9f8e 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaEmptyString.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaEmptyString.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.richtextarea;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java b/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java
index 1460d184dc..7b837553cb 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java
@@ -6,7 +6,7 @@ import java.io.OutputStream;
import java.io.Serializable;
import java.util.HashMap;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderRightClickAfterDrag.java b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderRightClickAfterDrag.java
index 5ef77aa358..b4bc32ab7b 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/HeaderRightClickAfterDrag.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/HeaderRightClickAfterDrag.java
@@ -2,7 +2,7 @@ package com.vaadin.tests.components.table;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.MouseEventDetails;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableInTabsheet.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableInTabsheet.java
index 36d7a610f2..59ddad4f85 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/TableInTabsheet.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableInTabsheet.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.components.table;
import java.net.MalformedURLException;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.HorizontalLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableRowScrolledBottom.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableRowScrolledBottom.java
index 2c2a4035c7..bad44e5e9e 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/TableRowScrolledBottom.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableRowScrolledBottom.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.table;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java b/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java
index 608c706d66..7044907781 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/Tables.java
@@ -8,8 +8,8 @@ import java.util.List;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.server.Resource;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.MultiSelectMode;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.select.AbstractSelectTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/treetable/ComponentsInTreeTable.java b/uitest/src/main/java/com/vaadin/tests/components/treetable/ComponentsInTreeTable.java
index 4e30b13b97..5cd7220747 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/treetable/ComponentsInTreeTable.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/treetable/ComponentsInTreeTable.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.components.treetable;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/LazyInitUIs.java b/uitest/src/main/java/com/vaadin/tests/components/ui/LazyInitUIs.java
index aa4fee34f1..01bcb3af1f 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/ui/LazyInitUIs.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/ui/LazyInitUIs.java
@@ -6,7 +6,7 @@ import com.vaadin.server.UIClassSelectionEvent;
import com.vaadin.server.UICreateEvent;
import com.vaadin.server.UIProviderEvent;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractTestUIProvider;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/UISerialization.java b/uitest/src/main/java/com/vaadin/tests/components/ui/UISerialization.java
index 2fe937455d..d60c2a7a82 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/ui/UISerialization.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/ui/UISerialization.java
@@ -26,7 +26,7 @@ import java.io.StringWriter;
import java.util.Date;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/extensions/ResponsiveUI.java b/uitest/src/main/java/com/vaadin/tests/extensions/ResponsiveUI.java
index 3098a93fce..0ea059c9ab 100644
--- a/uitest/src/main/java/com/vaadin/tests/extensions/ResponsiveUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/extensions/ResponsiveUI.java
@@ -19,7 +19,7 @@ package com.vaadin.tests.extensions;
import com.vaadin.annotations.Theme;
import com.vaadin.server.Responsive;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalSplitPanel;
diff --git a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java
index 7709ae4795..39d7f0d5a5 100644
--- a/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java
+++ b/uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java
@@ -20,7 +20,7 @@ import java.util.Map;
import com.vaadin.annotations.PropertyId;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.util.SharedUtil;
import com.vaadin.tests.components.AbstractTestUIWithLog;
import com.vaadin.ui.Alignment;
diff --git a/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java b/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java
index c57f9e8f4b..7007e6706c 100644
--- a/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java
+++ b/uitest/src/main/java/com/vaadin/tests/fonticon/FontIcons.java
@@ -24,7 +24,7 @@ import com.vaadin.server.Resource;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.Position;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/integration/JSR286Portlet.java b/uitest/src/main/java/com/vaadin/tests/integration/JSR286Portlet.java
index f09b790bc8..5abb63cb63 100644
--- a/uitest/src/main/java/com/vaadin/tests/integration/JSR286Portlet.java
+++ b/uitest/src/main/java/com/vaadin/tests/integration/JSR286Portlet.java
@@ -26,8 +26,8 @@ import com.vaadin.server.VaadinPortletRequest;
import com.vaadin.server.VaadinPortletService;
import com.vaadin.server.VaadinPortletSession;
import com.vaadin.server.VaadinPortletSession.PortletListener;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/uitest/src/main/java/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
index ba3716eec8..f07b713a5d 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.layouts;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/TestLayoutPerformance.java b/uitest/src/main/java/com/vaadin/tests/layouts/TestLayoutPerformance.java
index 65550cf651..d95a60b706 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/TestLayoutPerformance.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/TestLayoutPerformance.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.layouts;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java
index a35b958bd5..9d94df21b4 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseAddReplaceMove.java
@@ -16,7 +16,7 @@
package com.vaadin.tests.layouts.layouttester;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractLayout;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java
index 4326866e02..c8dc8fade2 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutForSpacingMargin.java
@@ -16,7 +16,7 @@
package com.vaadin.tests.layouts.layouttester;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.AbstractLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java
index e449afb064..6699cefa39 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java
@@ -19,7 +19,7 @@ import com.vaadin.server.Resource;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.UserError;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java
index a07e97ab1f..05edfb0152 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridAddReplaceMove.java
@@ -16,7 +16,7 @@
package com.vaadin.tests.layouts.layouttester.GridLayout;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java
index 7c826eeab9..ebd345476e 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridBaseLayoutTestUI.java
@@ -16,7 +16,7 @@
package com.vaadin.tests.layouts.layouttester.GridLayout;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.layouts.layouttester.BaseLayoutTestUI;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java
index af719b56f7..20738556b3 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/layouttester/GridLayout/GridLayoutMarginSpacing.java
@@ -16,7 +16,7 @@
package com.vaadin.tests.layouts.layouttester.GridLayout;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
index 8164d72f7f..e9f8182e7f 100644
--- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
+++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
@@ -6,9 +6,9 @@ import com.vaadin.annotations.Widgetset;
import com.vaadin.server.Page;
import com.vaadin.server.Page.Styles;
import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.colorpicker.Color;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.ColorPicker;
import com.vaadin.ui.ComboBox;
diff --git a/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java b/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java
index 7c11c63a5a..5b807092c3 100644
--- a/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java
+++ b/uitest/src/main/java/com/vaadin/tests/push/BasicPush.java
@@ -20,7 +20,7 @@ import java.util.TimerTask;
import com.vaadin.annotations.Push;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java b/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java
index b400d1ef2a..b4a23ba5d5 100644
--- a/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java
+++ b/uitest/src/main/java/com/vaadin/tests/push/PushConfiguration.java
@@ -20,7 +20,7 @@ import java.util.Timer;
import java.util.TimerTask;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/push/PushConfigurator.java b/uitest/src/main/java/com/vaadin/tests/push/PushConfigurator.java
index ea95e50e41..fb56b5226b 100644
--- a/uitest/src/main/java/com/vaadin/tests/push/PushConfigurator.java
+++ b/uitest/src/main/java/com/vaadin/tests/push/PushConfigurator.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.Collections;
import com.vaadin.shared.communication.PushMode;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.ui.Transport;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
diff --git a/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
index b7184921d3..a4b1a025b3 100644
--- a/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
@@ -35,7 +35,7 @@ import java.util.TimeZone;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.Connector;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.tests.util.Log;
import com.vaadin.tests.widgetset.client.ComplexTestBean;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
index fec4399d63..436a427e00 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
@@ -6,8 +6,8 @@ import java.util.UUID;
import com.vaadin.server.Page;
import com.vaadin.server.Page.Styles;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.server.StreamResource;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
index e027fcf4a3..f0f0e0995b 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/CommonParts.java
@@ -24,7 +24,7 @@ import com.vaadin.server.FontAwesome;
import com.vaadin.server.Page;
import com.vaadin.server.UserError;
import com.vaadin.shared.Position;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
index 4bb84bcd37..2d1a3fe4a4 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Labels.java
@@ -17,8 +17,8 @@ package com.vaadin.tests.themes.valo;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.shared.ui.MarginInfo;
-import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java
index 83b3f571bf..17590c1085 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/PopupViews.java
@@ -17,7 +17,7 @@ package com.vaadin.tests.themes.valo;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
index 59b1dbbeef..1268a5cbde 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
@@ -34,7 +34,7 @@ import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinSession;
import com.vaadin.server.WebBrowser;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/uitest/src/main/java/com/vaadin/tests/util/Log.java b/uitest/src/main/java/com/vaadin/tests/util/Log.java
index 01b290711a..78b32b3c85 100644
--- a/uitest/src/main/java/com/vaadin/tests/util/Log.java
+++ b/uitest/src/main/java/com/vaadin/tests/util/Log.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.util;
import java.util.ArrayList;
import java.util.List;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
diff --git a/uitest/src/main/java/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/main/java/com/vaadin/tests/util/SampleDirectory.java
index e240d9971f..66ce33a4c2 100644
--- a/uitest/src/main/java/com/vaadin/tests/util/SampleDirectory.java
+++ b/uitest/src/main/java/com/vaadin/tests/util/SampleDirectory.java
@@ -21,7 +21,7 @@ import java.io.File;
import com.vaadin.server.SystemError;
import com.vaadin.server.VaadinService;
import com.vaadin.server.VaadinSession;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.LegacyWindow;
import com.vaadin.ui.Panel;
diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
index d2f025e407..0c13cea90c 100644
--- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
+++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
@@ -32,7 +32,7 @@ import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.extensions.AbstractExtensionConnector;
import com.vaadin.shared.Connector;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.widgetset.server.SerializerTestExtension;
import elemental.json.Json;
diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
index 0b745e0c88..6093af9d4a 100644
--- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
+++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
@@ -24,7 +24,7 @@ import java.util.Set;
import com.vaadin.shared.Connector;
import com.vaadin.shared.communication.ClientRpc;
import com.vaadin.shared.communication.ServerRpc;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import elemental.json.JsonString;
import elemental.json.JsonValue;
diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java
index ef8a20fb26..e632784446 100644
--- a/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java
+++ b/uitest/src/main/java/com/vaadin/tests/widgetset/client/SerializerTestState.java
@@ -22,7 +22,7 @@ import java.util.Set;
import com.vaadin.shared.Connector;
import com.vaadin.shared.communication.SharedState;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import elemental.json.JsonBoolean;
import elemental.json.JsonValue;
diff --git a/uitest/src/main/java/com/vaadin/tests/widgetset/server/v7/grid/GridClientColumnRenderers.java b/uitest/src/main/java/com/vaadin/tests/widgetset/server/v7/grid/GridClientColumnRenderers.java
index 0f039fae55..36fbf9ae69 100644
--- a/uitest/src/main/java/com/vaadin/tests/widgetset/server/v7/grid/GridClientColumnRenderers.java
+++ b/uitest/src/main/java/com/vaadin/tests/widgetset/server/v7/grid/GridClientColumnRenderers.java
@@ -19,7 +19,7 @@ import java.util.Arrays;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.VaadinRequest;
-import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.widgetset.TestingWidgetSet;
import com.vaadin.tests.widgetset.client.v7.grid.GridClientColumnRendererConnector.Renderers;
import com.vaadin.tests.widgetset.client.v7.grid.GridClientColumnRendererRpc;
diff --git a/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/TooltipModesTest.java b/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/TooltipModesTest.java
new file mode 100644
index 0000000000..e3efd7943e
--- /dev/null
+++ b/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/TooltipModesTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.abstractcomponent;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.tb3.TooltipTest;
+
+/**
+ * @author Vaadin Ltd
+ *
+ */
+public class TooltipModesTest extends TooltipTest {
+
+ @Test
+ public void checkTooltipModes() throws Exception {
+ openTestURL();
+
+ $(ButtonElement.class).first().showTooltip();
+
+ // preformatted is default
+ checkTooltip("<pre>Several\n lines\n tooltip</pre>");
+
+ // Use html inside tooltip
+ $(ButtonElement.class).get(1).click();
+
+ $(ButtonElement.class).first().showTooltip();
+
+ checkTooltip("<div>Html <b><span>tooltip</span></b></div>");
+
+ // Use text inside tooltip
+ $(ButtonElement.class).get(2).click();
+
+ $(ButtonElement.class).first().showTooltip();
+ checkTooltip("&lt;b&gt;tooltip&lt;/b&gt;");
+ }
+
+ @Override
+ protected void checkTooltip(String tooltipText)
+ throws InterruptedException {
+ WebElement tooltip = getTooltip();
+ WebElement tooltipContent = tooltip
+ .findElement(By.className("v-tooltip-text"));
+ Assert.assertEquals(tooltipText,
+ tooltipContent.getAttribute("innerHTML"));
+ }
+}