Fixes #9121tags/8.1.0.alpha8
<li>The <tt>HierarchicalDataProvider</tt> interface replaces <tt>Container.Hierarchical</tt> and <<tt>InMemoryHierarchicalDataProvider</tt> replaces <tt>HierarchicalContainer</tt></li> | <li>The <tt>HierarchicalDataProvider</tt> interface replaces <tt>Container.Hierarchical</tt> and <<tt>InMemoryHierarchicalDataProvider</tt> replaces <tt>HierarchicalContainer</tt></li> | ||||
<li>The <tt>DragSourceExtension</tt> and <tt>DropTargetExtension</tt> extensions replace the old DnD features</li> | <li>The <tt>DragSourceExtension</tt> and <tt>DropTargetExtension</tt> extensions replace the old DnD features</li> | ||||
<li>OSGi bundle manifests of Vaadin Framework JARs no longer export <tt>/VAADIN</tt>, and there are new mechanisms for publishing static resources for OSGi</li> | <li>OSGi bundle manifests of Vaadin Framework JARs no longer export <tt>/VAADIN</tt>, and there are new mechanisms for publishing static resources for OSGi</li> | ||||
<li>Tooltip styles for <tt>ContentMode.PREFORMATTED</tt> have been changed in all built-in themes to use the application font and allow long lines to wrap to multiple lines.</li> | |||||
<h2>For incompatible or behaviour-altering changes in 8.0, please see <a href="https://vaadin.com/download/release/8.0/8.0.0/release-notes.html#incompatible">8.0 release notes</a></h2> | <h2>For incompatible or behaviour-altering changes in 8.0, please see <a href="https://vaadin.com/download/release/8.0/8.0.0/release-notes.html#incompatible">8.0 release notes</a></h2> | ||||
break; | break; | ||||
case PREFORMATTED: | case PREFORMATTED: | ||||
PreElement preElement = Document.get().createPreElement(); | PreElement preElement = Document.get().createPreElement(); | ||||
preElement.addClassName(CLASSNAME + "-pre"); | |||||
preElement.setInnerText(info.getTitle()); | preElement.setInnerText(info.getTitle()); | ||||
// clear existing content | // clear existing content | ||||
description.setHTML(""); | description.setHTML(""); |
cursor: default; | cursor: default; | ||||
background: #fff; | background: #fff; | ||||
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .5); | box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .5); | ||||
pre.v-tooltip-pre { | |||||
font: inherit; | |||||
white-space: pre-wrap; | |||||
} | |||||
} | } | ||||
.v-tooltip-text { | .v-tooltip-text { | ||||
overflow: auto; | overflow: auto; |
Subproject commit a79dd59a14d88413fbfe80071130f3271152aafe | |||||
Subproject commit 03a4ef619539700a7bdc9be528cd8e8ad8503253 |
h4 { | h4 { | ||||
color: inherit; | color: inherit; | ||||
} | } | ||||
pre.v-tooltip-pre { | |||||
font: inherit; | |||||
white-space: pre-wrap; | |||||
} | |||||
} | } | ||||
} | } | ||||
package com.vaadin.tests.components; | package com.vaadin.tests.components; | ||||
import com.vaadin.server.VaadinRequest; | import com.vaadin.server.VaadinRequest; | ||||
import com.vaadin.shared.ui.ContentMode; | |||||
import com.vaadin.ui.Button; | import com.vaadin.ui.Button; | ||||
import com.vaadin.ui.UI; | import com.vaadin.ui.UI; | ||||
import com.vaadin.ui.VerticalLayout; | import com.vaadin.ui.VerticalLayout; | ||||
addComponent(layout); | addComponent(layout); | ||||
for (int i = 0; i < NUMBER_OF_BUTTONS; i++) { | for (int i = 0; i < NUMBER_OF_BUTTONS; i++) { | ||||
Button button = new Button("Button"); | Button button = new Button("Button"); | ||||
button.setDescription(generateTooltipText()); | |||||
button.setDescription(generateTooltipText(), ContentMode.HTML); | |||||
layout.addComponent(button); | layout.addComponent(button); | ||||
} | } | ||||
} | } |
/* | |||||
* 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.Label; | |||||
public class TooltipStyling extends AbstractTestUI { | |||||
@Override | |||||
protected void setup(VaadinRequest request) { | |||||
Label defaultLabel = new Label( | |||||
"I have a tooltip with default settings"); | |||||
defaultLabel.setDescription( | |||||
"This long description should be shown with the application's default font and wrap to several lines as needed." | |||||
+ "\n\nThis part should be on a separate line"); | |||||
defaultLabel.setId("default"); | |||||
addComponent(defaultLabel); | |||||
Label htmlLabel = new Label("I have a tooltip with HTML contents"); | |||||
htmlLabel.setDescription( | |||||
"This is regular text in a tooltip." | |||||
+ "<pre>This is a pre tag inside a HTML tooltip. It should use a monospace font and by default not break to multiple lines.</pre>", | |||||
ContentMode.HTML); | |||||
htmlLabel.setId("html"); | |||||
addComponent(htmlLabel); | |||||
} | |||||
@Override | |||||
protected String getTestDescription() { | |||||
return "Tooltips should be shown with the regular application font and automatically wrap to multiple lines for long contents.<br />" | |||||
+ "<pre> tag contents in a HTML tooltip should still behave according to browser defaults."; | |||||
} | |||||
} |
$(ButtonElement.class).first().showTooltip(); | $(ButtonElement.class).first().showTooltip(); | ||||
// preformatted is default | // preformatted is default | ||||
checkTooltip("<pre>Several\n lines\n tooltip</pre>"); | |||||
checkTooltip( | |||||
"<pre class=\"v-tooltip-pre\">Several\n lines\n tooltip</pre>"); | |||||
// Use html inside tooltip | // Use html inside tooltip | ||||
$(ButtonElement.class).get(1).click(); | $(ButtonElement.class).get(1).click(); |
/* | |||||
* 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 java.io.IOException; | |||||
import java.util.Collection; | |||||
import org.junit.Test; | |||||
import org.junit.runner.RunWith; | |||||
import org.junit.runners.Parameterized.Parameters; | |||||
import com.vaadin.testbench.elements.LabelElement; | |||||
import com.vaadin.tests.tb3.MultiBrowserThemeTest; | |||||
import com.vaadin.tests.tb3.ParameterizedTB3Runner; | |||||
import com.vaadin.tests.tb3.SingleBrowserTest; | |||||
@RunWith(ParameterizedTB3Runner.class) | |||||
public class TooltipStylingTest extends SingleBrowserTest { | |||||
private String theme; | |||||
public void setTheme(String theme) { | |||||
this.theme = theme; | |||||
} | |||||
@Parameters | |||||
public static Collection<String> getThemes() { | |||||
return MultiBrowserThemeTest.themesToTest; | |||||
} | |||||
@Test | |||||
public void tooltipStyling() throws IOException { | |||||
openTestURL("theme=" + theme); | |||||
$(LabelElement.class).id("default").showTooltip(); | |||||
compareScreen("default"); | |||||
$(LabelElement.class).id("html").showTooltip(); | |||||
compareScreen("html"); | |||||
} | |||||
} |
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.Collection; | import java.util.Collection; | ||||
import java.util.Collections; | |||||
import java.util.HashSet; | import java.util.HashSet; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Set; | import java.util.Set; | ||||
@RunWith(ParameterizedTB3Runner.class) | @RunWith(ParameterizedTB3Runner.class) | ||||
public abstract class MultiBrowserThemeTest extends MultiBrowserTest { | public abstract class MultiBrowserThemeTest extends MultiBrowserTest { | ||||
public static final List<String> themesToTest = Collections | |||||
.unmodifiableList(Arrays.asList(new String[] { "valo", "reindeer", | |||||
"runo", "chameleon", "base" })); | |||||
private String theme; | private String theme; | ||||
public void setTheme(String theme) { | public void setTheme(String theme) { | ||||
@Parameters | @Parameters | ||||
public static Collection<String> getThemes() { | public static Collection<String> getThemes() { | ||||
return Arrays.asList(new String[] { "valo", "reindeer", "runo", | |||||
"chameleon", "base" }); | |||||
return themesToTest; | |||||
} | } | ||||
@Override | @Override |