diff options
12 files changed, 104 insertions, 71 deletions
diff --git a/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss b/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss index 5e21ddff35..e5b41b3123 100644 --- a/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss +++ b/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss @@ -48,6 +48,9 @@ body input.v-filterselect-input[type=text] { .v-filterselect-suggestpopup { margin-top: .4em; } +.v-filterselect-suggestmenu tr { + line-height:1.4em; +} body .v-filterselect-suggestpopup-small td { font-size: .85em; diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index c6a7b7ed5d..fc1de31bc8 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -1,5 +1,4 @@ (function() { - var defaults; var apps = {}; var themesLoaded = {}; var widgetsets = {}; @@ -60,14 +59,6 @@ }; window.vaadin = window.vaadin || { - setDefaults: function(d) { - if (defaults) { - log("Ignoring new defaults as defaults have already been loaded"); - return; - } - log("Got defaults", d); - defaults = d; - }, initApplication: function(appId, config) { if (apps[appId]) { throw "Application " + appId + " already initialized"; @@ -83,9 +74,6 @@ var getConfig = function(name) { var value = config[name]; - if (value === undefined) { - value = defaults[name]; - } return value; }; diff --git a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java index 0deebdc9a1..be7d502baa 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java @@ -1,10 +1,12 @@ package com.vaadin.buildhelpers; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Vector; import java.util.jar.Attributes; import java.util.jar.Attributes.Name; @@ -24,13 +26,12 @@ import java.util.jar.Manifest; * @author magi */ public class GeneratePackageExports { - public static final String VAADIN_PACKAGE_PATH_PREFIX = "com/vaadin/"; - public static final String GOOGLE_PACKAGE_PATH_PREFIX = "com/google/"; public static void main(String[] args) { - if (args.length < 1) { - System.err.println("Invalid number of parameters\n" - + "Usage: java -cp .. GenerateManifest <package.jar>"); + if (args.length < 2) { + System.err + .println("Invalid number of parameters\n" + + "Usage: java -cp .. GenerateManifest <package.jar> <accepted package prefixes>"); System.exit(1); } @@ -44,18 +45,35 @@ public class GeneratePackageExports { System.exit(1); } + // Accepted packages + List<String> acceptedPackagePrefixes = new ArrayList<String>(); + for (int i = 1; i < args.length; i++) { + acceptedPackagePrefixes.add(args[i]); + } + // List the included Java packages HashSet<String> packages = new HashSet<String>(); for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); - if ((entry.getName().startsWith(VAADIN_PACKAGE_PATH_PREFIX) || entry - .getName().startsWith(GOOGLE_PACKAGE_PATH_PREFIX)) - && entry.getName().endsWith(".class")) { - int lastSlash = entry.getName().lastIndexOf('/'); - String pkg = entry.getName().substring(0, lastSlash) - .replace('/', '.'); - packages.add(pkg); + if (!entry.getName().endsWith(".class")) { + continue; } + + boolean accept = false; + for (String prefix : acceptedPackagePrefixes) { + if (entry.getName().startsWith(prefix)) { + accept = true; + break; + } + } + if (!accept) { + continue; + } + + int lastSlash = entry.getName().lastIndexOf('/'); + String pkg = entry.getName().substring(0, lastSlash) + .replace('/', '.'); + packages.add(pkg); } // List theme packages @@ -148,5 +166,4 @@ public class GeneratePackageExports { System.exit(status); } } - } diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index e32e9b65f0..fab393eedc 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -327,7 +327,7 @@ public class BrowserInfo { * otherwise <code>false</code> */ public boolean requiresOverflowAutoFix() { - return (getWebkitVersion() > 0 || getOperaVersion() >= 11) + return (getWebkitVersion() > 0 || getOperaVersion() >= 11 || isFirefox()) && Util.getNativeScrollbarSize() > 0; } diff --git a/client/src/com/vaadin/client/ui/ui/VUI.java b/client/src/com/vaadin/client/ui/ui/VUI.java index 8d534053ed..096b0b60ba 100644 --- a/client/src/com/vaadin/client/ui/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/ui/VUI.java @@ -37,6 +37,7 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; +import com.vaadin.client.LayoutManager; import com.vaadin.client.VConsole; import com.vaadin.client.ui.ShortcutActionHandler; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; @@ -286,7 +287,12 @@ public class VUI extends SimplePanel implements ResizeHandler, sendClientResized(); - connector.getLayoutManager().layoutNow(); + LayoutManager layoutManager = connector.getLayoutManager(); + if (layoutManager.isLayoutRunning()) { + layoutManager.layoutLater(); + } else { + layoutManager.layoutNow(); + } } } diff --git a/common.xml b/common.xml index a854ef4358..ffaf27b735 100644 --- a/common.xml +++ b/common.xml @@ -194,6 +194,9 @@ JAR --> <java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes"> <arg value="${jar}" /> + <arg value="com/vaadin" /> + <arg value="com/google" /> + <classpath refid="vaadin.buildhelpers.classpath" /> </java> </target> diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 0886507caf..e10351b4ad 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -379,16 +379,11 @@ public abstract class BootstrapHandler implements RequestHandler { protected void appendMainScriptTagContents(BootstrapContext context, StringBuilder builder) throws JSONException, IOException { - JSONObject defaults = getDefaultParameters(context); JSONObject appConfig = getApplicationParameters(context); boolean isDebug = !context.getSession().getConfiguration() .isProductionMode(); - builder.append("vaadin.setDefaults("); - appendJsonObject(builder, defaults, isDebug); - builder.append(");\n"); - builder.append("vaadin.initApplication(\""); builder.append(context.getAppId()); builder.append("\","); @@ -407,6 +402,10 @@ public abstract class BootstrapHandler implements RequestHandler { protected JSONObject getApplicationParameters(BootstrapContext context) throws JSONException, PaintException { + VaadinRequest request = context.getRequest(); + VaadinServiceSession session = context.getSession(); + VaadinService vaadinService = request.getService(); + JSONObject appConfig = new JSONObject(); String themeName = context.getThemeName(); @@ -420,10 +419,10 @@ public abstract class BootstrapHandler implements RequestHandler { appConfig.put("widgetset", context.getWidgetsetName()); - appConfig.put("initialPath", context.getRequest().getRequestPathInfo()); + appConfig.put("initialPath", request.getRequestPathInfo()); Map<String, String[]> parameterMap = new HashMap<String, String[]>( - context.getRequest().getParameterMap()); + request.getParameterMap()); // Include theme as a fake initial param so that UI can know its theme // for serving CustomLayout templates @@ -431,17 +430,6 @@ public abstract class BootstrapHandler implements RequestHandler { appConfig.put("initialParams", parameterMap); - return appConfig; - } - - protected JSONObject getDefaultParameters(BootstrapContext context) - throws JSONException { - JSONObject defaults = new JSONObject(); - - VaadinRequest request = context.getRequest(); - VaadinServiceSession session = context.getSession(); - VaadinService vaadinService = request.getService(); - // Get system messages SystemMessages systemMessages = vaadinService.getSystemMessages(); if (systemMessages != null) { @@ -453,7 +441,7 @@ public abstract class BootstrapHandler implements RequestHandler { systemMessages.getCommunicationErrorMessage()); comErrMsg.put("url", systemMessages.getCommunicationErrorURL()); - defaults.put("comErrMsg", comErrMsg); + appConfig.put("comErrMsg", comErrMsg); JSONObject authErrMsg = new JSONObject(); authErrMsg.put("caption", @@ -462,29 +450,29 @@ public abstract class BootstrapHandler implements RequestHandler { systemMessages.getAuthenticationErrorMessage()); authErrMsg.put("url", systemMessages.getAuthenticationErrorURL()); - defaults.put("authErrMsg", authErrMsg); + appConfig.put("authErrMsg", authErrMsg); } String staticFileLocation = vaadinService .getStaticFileLocation(request); String widgetsetBase = staticFileLocation + "/" + VaadinServlet.WIDGETSET_DIRECTORY_PATH; - defaults.put("widgetsetBase", widgetsetBase); + appConfig.put("widgetsetBase", widgetsetBase); if (!session.getConfiguration().isProductionMode()) { - defaults.put("debug", true); + appConfig.put("debug", true); } if (vaadinService.isStandalone(request)) { - defaults.put("standalone", true); + appConfig.put("standalone", true); } - defaults.put("heartbeatInterval", vaadinService + appConfig.put("heartbeatInterval", vaadinService .getDeploymentConfiguration().getHeartbeatInterval()); - defaults.put("appUri", getAppUri(context)); + appConfig.put("appUri", getAppUri(context)); - return defaults; + return appConfig; } protected abstract String getAppUri(BootstrapContext context); diff --git a/server/src/com/vaadin/server/PortletCommunicationManager.java b/server/src/com/vaadin/server/PortletCommunicationManager.java index c77c195197..8d39eee9ac 100644 --- a/server/src/com/vaadin/server/PortletCommunicationManager.java +++ b/server/src/com/vaadin/server/PortletCommunicationManager.java @@ -89,21 +89,6 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { } @Override - protected JSONObject getDefaultParameters(BootstrapContext context) - throws JSONException { - /* - * We need this in order to get uploads to work. TODO this is - * not needed for uploads anymore, check if this is needed for - * some other things - */ - JSONObject defaults = super.getDefaultParameters(context); - - defaults.put("pathInfo", ""); - - return defaults; - } - - @Override protected void appendMainScriptTagContents( BootstrapContext context, StringBuilder builder) throws JSONException, IOException { diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 9d1d79d8b1..0620035274 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -288,6 +288,11 @@ public class VaadinServlet extends HttpServlet implements Constants { // Handles AJAX UIDL requests communicationManager.handleUidlRequest(request, response, servletWrapper, uI); + + // Ensure that the browser does not cache UIDL responses. + // iOS 6 Safari requires this (#9732) + response.setHeader("Cache-Control", "no-cache"); + return; } else if (requestType == RequestType.BROWSER_DETAILS) { // Browser details - not related to a specific UI diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java b/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java new file mode 100644 index 0000000000..0fdb579997 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; + +public class HiddenTabSheetBrowserResize extends TestBase { + + @Override + public void setup() { + final TabSheet tabSheet = new TabSheet(); + + tabSheet.addTab(new Label("Label1"), "Tab1"); + tabSheet.addTab(new Label("Label2"), "Tab2"); + + Button toggleButton = new Button("Toggle TabSheet", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + tabSheet.setVisible(!tabSheet.isVisible()); + } + }); + addComponent(toggleButton); + addComponent(tabSheet); + } + + @Override + protected String getDescription() { + return "TabSheet content disappears if browser window resized when the TabSheet is hidden"; + } + + @Override + protected Integer getTicketNumber() { + return 9508; + } + +} diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java index 41b7b020f5..916af7129e 100644 --- a/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java +++ b/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java @@ -38,7 +38,7 @@ public class IntegrationTestApplication extends LegacyApplication { table.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - selectedLabel.setValue(table.getValue().toString()); + selectedLabel.setValue(String.valueOf(table.getValue())); } }); window.addComponent(selectedLabel); diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java index 05683e7b4e..61214ede8c 100755 --- a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java +++ b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java @@ -34,7 +34,7 @@ public class IntegrationTestUI extends UI { table.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - selectedLabel.setValue(table.getValue().toString()); + selectedLabel.setValue(String.valueOf(table.getValue())); } }); addComponent(selectedLabel); |