From: Artur Signell Date: Wed, 23 Apr 2014 17:51:04 +0000 (+0300) Subject: Merge changes from origin/7.1 X-Git-Tag: 7.2.0~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e2db3e777a587a383f287fab7979cb065821bb5e;p=vaadin-framework.git Merge changes from origin/7.1 e77e73c Update copyright year to 2014 Conflicts: client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java client/src/com/vaadin/client/ApplicationConnection.java server/src/com/vaadin/data/util/converter/StringToNumberConverter.java shared/src/com/vaadin/shared/ui/ui/PageState.java shared/src/com/vaadin/shared/ui/window/WindowState.java theme-compiler/src/com/vaadin/sass/SassCompiler.java theme-compiler/src/com/vaadin/sass/internal/ScssStylesheet.java theme-compiler/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluator.java theme-compiler/src/com/vaadin/sass/internal/expression/BinaryExpression.java theme-compiler/src/com/vaadin/sass/internal/expression/BinaryOperator.java theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java theme-compiler/src/com/vaadin/sass/internal/expression/exception/IncompatibleUnitsException.java theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandler.java theme-compiler/src/com/vaadin/sass/internal/handler/SCSSDocumentHandlerImpl.java theme-compiler/src/com/vaadin/sass/internal/handler/SCSSErrorHandler.java theme-compiler/src/com/vaadin/sass/internal/parser/CharStream.java theme-compiler/src/com/vaadin/sass/internal/parser/Generic_CharStream.java theme-compiler/src/com/vaadin/sass/internal/parser/LexicalUnitImpl.java theme-compiler/src/com/vaadin/sass/internal/parser/LocatorImpl.java theme-compiler/src/com/vaadin/sass/internal/parser/MediaListImpl.java theme-compiler/src/com/vaadin/sass/internal/parser/ParseException.java theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java theme-compiler/src/com/vaadin/sass/internal/parser/ParserConstants.java theme-compiler/src/com/vaadin/sass/internal/parser/ParserTokenManager.java theme-compiler/src/com/vaadin/sass/internal/parser/SCSSLexicalUnit.java theme-compiler/src/com/vaadin/sass/internal/parser/SCSSParseException.java theme-compiler/src/com/vaadin/sass/internal/parser/SelectorListImpl.java theme-compiler/src/com/vaadin/sass/internal/parser/Selectors.java theme-compiler/src/com/vaadin/sass/internal/parser/ThrowedParseException.java theme-compiler/src/com/vaadin/sass/internal/parser/Token.java theme-compiler/src/com/vaadin/sass/internal/parser/TokenMgrError.java theme-compiler/src/com/vaadin/sass/internal/resolver/ClassloaderResolver.java theme-compiler/src/com/vaadin/sass/internal/resolver/FilesystemResolver.java theme-compiler/src/com/vaadin/sass/internal/resolver/ScssStylesheetResolver.java theme-compiler/src/com/vaadin/sass/internal/resolver/VaadinResolver.java theme-compiler/src/com/vaadin/sass/internal/selector/SelectorUtil.java theme-compiler/src/com/vaadin/sass/internal/tree/BlockNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ExtendNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ForNode.java theme-compiler/src/com/vaadin/sass/internal/tree/FunctionNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ImportNode.java theme-compiler/src/com/vaadin/sass/internal/tree/KeyframesNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ListContainsNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ListModifyNode.java theme-compiler/src/com/vaadin/sass/internal/tree/ListRemoveNode.java theme-compiler/src/com/vaadin/sass/internal/tree/MediaNode.java theme-compiler/src/com/vaadin/sass/internal/tree/MicrosoftRuleNode.java theme-compiler/src/com/vaadin/sass/internal/tree/MixinDefNode.java theme-compiler/src/com/vaadin/sass/internal/tree/MixinNode.java theme-compiler/src/com/vaadin/sass/internal/tree/NestPropertiesNode.java theme-compiler/src/com/vaadin/sass/internal/tree/Node.java theme-compiler/src/com/vaadin/sass/internal/tree/RuleNode.java theme-compiler/src/com/vaadin/sass/internal/tree/SimpleNode.java theme-compiler/src/com/vaadin/sass/internal/tree/VariableNode.java theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/EachDefNode.java theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfElseDefNode.java theme-compiler/src/com/vaadin/sass/internal/tree/controldirective/IfNode.java theme-compiler/src/com/vaadin/sass/internal/util/ColorUtil.java theme-compiler/src/com/vaadin/sass/internal/util/DeepCopy.java theme-compiler/src/com/vaadin/sass/internal/util/FastByteArrayInputStream.java theme-compiler/src/com/vaadin/sass/internal/util/FastByteArrayOutputStream.java theme-compiler/src/com/vaadin/sass/internal/util/StringUtil.java theme-compiler/src/com/vaadin/sass/internal/visitor/BlockNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/EachNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/ExtendNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/IfElseNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/MixinNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/NestedNodeHandler.java theme-compiler/src/com/vaadin/sass/internal/visitor/VariableNodeHandler.java theme-compiler/tests/src/com/vaadin/sass/AbstractTestBase.java theme-compiler/tests/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluatorTest.java theme-compiler/tests/src/com/vaadin/sass/parser/ParserTest.java theme-compiler/tests/src/com/vaadin/sass/resolvers/VaadinResolverTest.java theme-compiler/tests/src/com/vaadin/sass/testcases/css/Interpolation.java theme-compiler/tests/src/com/vaadin/sass/testcases/css/Selectors.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AbstractDirectoryScanningSassTests.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/AutomaticSassTests.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Comments.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Extends.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Functions.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Imports.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Mixins.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/NestedProperties.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Nesting.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentImports.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/ParentSelector.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/SassLangTests.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/SassLangTestsBroken.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/SassTestRunner.java theme-compiler/tests/src/com/vaadin/sass/testcases/scss/Variables.java theme-compiler/tests/src/com/vaadin/sass/tree/ImportNodeTest.java uitest/src/com/vaadin/tests/push/BasicPushTest.java uitest/src/com/vaadin/tests/push/PushConfigurationTest.java uitest/src/com/vaadin/tests/push/PushReconnectTest.java Change-Id: Ic08c4f9aecd4c684ce74408de4e0b0d0ff617273 --- e2db3e777a587a383f287fab7979cb065821bb5e diff --cc buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java index 06b941f522,0000000000..0fa4a7e8ab mode 100644,000000..100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java @@@ -1,154 -1,0 +1,154 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.buildhelpers; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.apache.commons.cli.PosixParser; + +import com.vaadin.sass.internal.ScssStylesheet; + +/** + * Helper to combine css divided into separate per component dirs into one to + * optimize http requests. + */ +public class CompileTheme { + + /** + * @param args + * @throws IOException + * @throws ParseException + */ + public static void main(String[] args) throws IOException, ParseException { + Options options = new Options(); + options.addOption("t", "theme", true, "the theme to compile"); + options.addOption("f", "theme-folder", true, + "the folder containing the theme"); + options.addOption("v", "version", true, + "the Vaadin version to compile for"); + CommandLineParser parser = new PosixParser(); + CommandLine params = parser.parse(options, args); + if (!params.hasOption("theme") || !params.hasOption("theme-folder") + || !params.hasOption("version")) { + // automatically generate the help statement + HelpFormatter formatter = new HelpFormatter(); + formatter.printHelp(CompileTheme.class.getName(), options); + return; + } + String themeName = params.getOptionValue("theme"); + String themeFolder = params.getOptionValue("theme-folder"); + String version = params.getOptionValue("version"); + + // Regular theme + try { + processSassTheme(themeFolder, themeName, "styles", version); + System.out.println("Compiling theme " + themeName + + " styles successful"); + } catch (Exception e) { + System.err.println("Compiling theme " + themeName + + " styles failed"); + e.printStackTrace(); + } + // Legacy theme w/o .themename{} wrapping + try { + processSassTheme(themeFolder, themeName, "legacy-styles", version); + System.out.println("Compiling theme " + themeName + + " legacy-styles successful"); + } catch (Exception e) { + System.err.println("Compiling theme " + themeName + + " legacy-styles failed"); + e.printStackTrace(); + } + } + + private static void processSassTheme(String themeFolder, String themeName, + String variant, String version) throws Exception { + + StringBuffer cssHeader = new StringBuffer(); + + String stylesCssDir = themeFolder + File.separator + themeName + + File.separator; + + String stylesCssName = stylesCssDir + variant + ".css"; + + // Process as SASS file + String sassFile = stylesCssDir + variant + ".scss"; + + ScssStylesheet scss = ScssStylesheet.get(sassFile); + if (scss == null) { + throw new IllegalArgumentException("SASS file: " + sassFile + + " not found"); + } + scss.compile(); + String filteredScss = scss.printState().replace("@version@", version); + + BufferedWriter out = new BufferedWriter(new FileWriter(stylesCssName)); + out.write(cssHeader.toString()); + out.write(filteredScss); + out.close(); + + System.out.println("Compiled CSS to " + stylesCssName + " (" + + filteredScss.length() + " bytes)"); + + createSprites(themeFolder, themeName); + File oldCss = new File(stylesCssName); + File newCss = new File(stylesCssDir + variant + "-sprite.css"); + + if (newCss.exists()) { + // Theme contained sprites. Renamed "styles-sprite.css" -> + // "styles.css" + oldCss.delete(); + + boolean ok = newCss.renameTo(oldCss); + if (!ok) { + throw new RuntimeException("Rename " + newCss + " -> " + oldCss + + " failed"); + } + } + + } + + private static void createSprites(String themeFolder, String themeName) + throws FileNotFoundException, IOException { + try { + // Try loading the class separately from using it to avoid + // hiding other classpath issues + Class smartSpritesClass = org.carrot2.labs.smartsprites.SmartSprites.class; + } catch (NoClassDefFoundError e) { + System.err + .println("Could not find smartsprites. No sprites were generated. The theme should still work."); + return; + } + + String[] parameters = new String[] { "--sprite-png-depth", "AUTO", + "--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8", + "--root-dir-path", themeFolder + File.separator + themeName, + "--log-level", "WARN" }; + + org.carrot2.labs.smartsprites.SmartSprites.main(parameters); + System.out.println("Generated sprites"); + + } +} diff --cc client/src/com/vaadin/client/ApplicationConnection.java index 5d614439bb,0623416a09..09a5047e7c --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@@ -1,5 -1,5 +1,5 @@@ -/* +/* - * Copyright 2000-2013 Vaadin Ltd. + * Copyright 2000-2014 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 diff --cc client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java index 8f60f0bcf3,0000000000..1de2f9722f mode 100644,000000..100644 --- a/client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java +++ b/client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java @@@ -1,34 -1,0 +1,34 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.client.event; + +import com.vaadin.client.event.PointerEvent.EventType; + +/** + * Pointer event support class for IE 10 ("ms" prefixed pointer events) + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PointerEventSupportImplIE10 extends + PointerEventSupportImplModernIE { + + @Override + public String getNativeEventName(EventType eventName) { + return "MS" + eventName; + } + +} diff --cc server/src/com/vaadin/server/ServiceDestroyListener.java index ad4966dd58,0000000000..1549d82d51 mode 100644,000000..100644 --- a/server/src/com/vaadin/server/ServiceDestroyListener.java +++ b/server/src/com/vaadin/server/ServiceDestroyListener.java @@@ -1,39 -1,0 +1,39 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.server; + +import java.io.Serializable; + +/** + * Listener that gets notified when the {@link VaadinService} to which it has + * been registered is destroyed. + * + * @see VaadinService#addServiceDestroyListener(ServiceDestroyListener) + * @see VaadinService#removeServiceDestroyListener(ServiceDestroyListener) + * + * @since 7.2 + * @author Vaadin Ltd + */ +public interface ServiceDestroyListener extends Serializable { + /** + * Invoked when a service is destroyed + * + * @param event + * the event + */ + public void serviceDestroy(ServiceDestroyEvent event); +} diff --cc server/src/com/vaadin/server/communication/DateSerializer.java index 9179eb922b,0000000000..429941abfd mode 100644,000000..100644 --- a/server/src/com/vaadin/server/communication/DateSerializer.java +++ b/server/src/com/vaadin/server/communication/DateSerializer.java @@@ -1,42 -1,0 +1,42 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.server.communication; + +import java.lang.reflect.Type; +import java.util.Date; + +import com.vaadin.ui.ConnectorTracker; + +/** + * Server side serializer/deserializer for java.util.Date + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DateSerializer implements JSONSerializer { + + @Override + public Date deserialize(Type type, Object jsonValue, + ConnectorTracker connectorTracker) { + return new Date(Long.valueOf(String.valueOf(jsonValue))); + } + + @Override + public Object serialize(Date value, ConnectorTracker connectorTracker) { + return value.getTime(); + } + +} diff --cc server/tests/src/ClassInDefaultPackage.java index 1eb8bc4df5,0000000000..52dc87e0e2 mode 100644,000000..100644 --- a/server/tests/src/ClassInDefaultPackage.java +++ b/server/tests/src/ClassInDefaultPackage.java @@@ -1,29 -1,0 +1,29 @@@ +import org.junit.Ignore; + +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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. + */ + +/** + * + * This class is test data. Don't delete it. + * + * @author Vaadin Ltd + * @since 7.2 + */ +@Ignore +public class ClassInDefaultPackage { + +} diff --cc server/tests/src/com/vaadin/server/MockVaadinSession.java index 1fb53cd368,0000000000..660767e0d4 mode 100644,000000..100644 --- a/server/tests/src/com/vaadin/server/MockVaadinSession.java +++ b/server/tests/src/com/vaadin/server/MockVaadinSession.java @@@ -1,49 -1,0 +1,49 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.server; + +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +/** + * + * @author Vaadin Ltd + */ +public class MockVaadinSession extends VaadinSession { + + public MockVaadinSession(VaadinService service) { + super(service); + } + + @Override + public void close() { + super.close(); + closeCount++; + } + + public int getCloseCount() { + return closeCount; + } + + @Override + public Lock getLockInstance() { + return lock; + } + + private int closeCount; + + private ReentrantLock lock = new ReentrantLock(); +} diff --cc shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java index 996525151c,0000000000..a96c616ec6 mode 100644,000000..100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java @@@ -1,44 -1,0 +1,44 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.shared.ui.tabsheet; + +import com.vaadin.shared.communication.ServerRpc; + +/** + * Client to server RPC methods for the TabSheet. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public interface TabsheetServerRpc extends ServerRpc { + + /** + * Tell server that a tab has been selected by the user. + * + * @param key + * internal key of the tab + */ + void setSelected(String key); + + /** + * Tell server that a tab has been closed by the user. + * + * @param key + * internal key of the tab + */ + void closeTab(String key); + +} diff --cc shared/src/com/vaadin/shared/ui/ui/PageState.java index 4d2768787f,84b5af9f35..b6dd5abb89 --- a/shared/src/com/vaadin/shared/ui/ui/PageState.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageState.java @@@ -30,9 -30,4 +30,9 @@@ public class PageState implements Seria * True if the page has browser window resize listeners. */ public boolean hasResizeListeners = false; + + /** + * Non-null if the title is set. Null means Vaadin does not touch the title. + */ + public String title = null; - } + } diff --cc shared/src/com/vaadin/shared/ui/window/WindowRole.java index fc6b099620,0000000000..5114c04bc2 mode 100644,000000..100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowRole.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowRole.java @@@ -1,25 -1,0 +1,25 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.shared.ui.window; + +/** + * Available WAI-ARIA roles for a window. + * + * @since 7.2 + */ +public enum WindowRole { + ALERTDIALOG, DIALOG +} diff --cc shared/src/com/vaadin/shared/ui/window/WindowState.java index ebb1995287,b04d598c83..fa73bea391 --- a/shared/src/com/vaadin/shared/ui/window/WindowState.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java @@@ -31,12 -30,4 +31,12 @@@ public class WindowState extends PanelS public int positionX = -1; public int positionY = -1; public WindowMode windowMode = WindowMode.NORMAL; + + public String assistivePrefix = ""; + public String assistivePostfix = ""; + public Connector[] contentDescription = new Connector[0]; + public WindowRole role = WindowRole.DIALOG; + public boolean assistiveTabStop = false; + public String assistiveTabStopTopText = "Top of dialog"; + public String assistiveTabStopBottomText = "Bottom of Dialog"; - } + } diff --cc uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java index c47ec0b792,0000000000..a3f8f06976 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java @@@ -1,36 -1,0 +1,36 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.customfield; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class CustomFieldSizeTest extends MultiBrowserTest { + + @Test + public void checkScreenshot() throws IOException { + openTestURL(); + compareScreen("size"); + } +} diff --cc uitest/src/com/vaadin/tests/components/page/PageTitleTest.java index 039f52be73,0000000000..bc2e6f7ca1 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java +++ b/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java @@@ -1,36 -1,0 +1,36 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.page; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PageTitleTest extends MultiBrowserTest { + + @Test + public void nullTitle() { + driver.get(getTestUrl()); + Assert.assertEquals(PageTitle.class.getName(), driver.getTitle()); + } + + @Test + public void fooTitle() { + driver.get(getTestUrl() + "?title=foo"); + Assert.assertEquals("foo", driver.getTitle()); + } +} diff --cc uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java index dabc9c8e0b,0000000000..cebb00c11b mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java @@@ -1,30 -1,0 +1,30 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.tabsheet; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class EmptyTabSheetTest extends MultiBrowserTest { + @Test + public void emptyTabSheet() throws Exception { + openTestURL(); + + compareScreen("empty"); + } + - } ++} diff --cc uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java index af54b73ae3,0000000000..bc08071cef mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java @@@ -1,36 -1,0 +1,36 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.fonticon; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class FontIconsTest extends MultiBrowserTest { + + @Test + public void checkScreenshot() throws IOException { + openTestURL(); + compareScreen("all"); + } +} diff --cc uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java index b526a11d38,0000000000..b404747c80 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java @@@ -1,19 -1,0 +1,19 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + +public class BasicPushLongPollingTest extends BasicPushTest { - } ++} diff --cc uitest/src/com/vaadin/tests/push/BasicPushTest.java index 7f4492aeba,9f478cffe2..fd34a1f192 --- a/uitest/src/com/vaadin/tests/push/BasicPushTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushTest.java @@@ -83,25 -107,4 +83,25 @@@ public abstract class BasicPushTest ext return t.vaadinElementById(BasicPush.INCREMENT_BUTTON_ID); } + private void waitUntilClientCounterChanges(final int expectedValue) { + waitUntil(new ExpectedCondition() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getClientCounter(BasicPushTest.this) == expectedValue; + } + }, 10); + } + + private void waitUntilServerCounterChanges() { + final int counter = BasicPushTest.getServerCounter(this); + waitUntil(new ExpectedCondition() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getServerCounter(BasicPushTest.this) > counter; + } + }, 10); + } + - } + } diff --cc uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java index eb28634dfa,0000000000..13f601da7a mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java @@@ -1,21 -1,0 +1,21 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + +public class ExtremelyLongPushTimeLongPollingTest extends + ExtremelyLongPushTimeTest { + +} diff --cc uitest/src/com/vaadin/tests/push/PushConfigurationTest.java index 20399fc67e,5d884136bf..bb5b420259 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java @@@ -69,19 -117,7 +69,19 @@@ abstract class PushConfigurationTest ex return Integer.parseInt(getServerCounterElement().getText()); } - private WebElement getServerCounterElement() { + protected WebElement getServerCounterElement() { return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VLabel[0]"); } + + protected void waitForServerCounterToUpdate() { + int counter = getServerCounter(); + final int waitCounter = counter + 2; + waitUntil(new ExpectedCondition() { + + @Override + public Boolean apply(WebDriver input) { + return (getServerCounter() >= waitCounter); + } + }); + } - } + } diff --cc uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java index 52a647115a,0000000000..c2fdb5ae95 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java @@@ -1,32 -1,0 +1,32 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.ui.Transport; +import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; + +@Push(transport = Transport.LONG_POLLING) +public class PushLargeDataLongPolling extends PushLargeData { + + @Override + protected void setup(VaadinRequest request) { + super.setup(request); + getPushConfiguration().setParameter( + PushConfigurationState.FALLBACK_TRANSPORT_PARAM, "none"); + } +} diff --cc uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java index 4ea0c7daf4,0000000000..8a4593d70d mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java @@@ -1,26 -1,0 +1,26 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + + +public class ReconnectLongPollingTest extends ReconnectTest { + + @Override + protected Class getUIClass() { + return BasicPushLongPolling.class; + } + +} diff --cc uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java index 4e2143f9e0,0000000000..fe63764e78 mode 100755,000000..100755 --- a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java @@@ -1,26 -1,0 +1,26 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + + +public class ReconnectStreamingTest extends ReconnectTest { + + @Override + protected Class getUIClass() { + return BasicPushStreaming.class; + } + +} diff --cc uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java index 57fe0a040d,0000000000..efaf5d493e mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java @@@ -1,36 -1,0 +1,36 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.push; + +import java.util.List; + +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.WebsocketTest; + +public class ReconnectWebsocketTest extends ReconnectTest { + + @Override + public List getBrowsersToTest() { + return WebsocketTest.getWebsocketBrowsers(); + } + + @Override + protected Class getUIClass() { + return BasicPushWebsocket.class; + } + +} diff --cc uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java index a6ff0c4459,0000000000..9c21ec1de4 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java +++ b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java @@@ -1,35 -1,0 +1,35 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.serialization; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class GenericWidgetHandlingTest extends MultiBrowserTest { + + @Test + public void testWidgetInit() { + openTestURL(); + WebElement label = vaadinElementById("label"); + + Assert.assertEquals("The generic text is strong in this one", + label.getText()); + } + +} diff --cc uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java index a05bedfa27,0000000000..35d071a6df mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java @@@ -1,33 -1,0 +1,33 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.widgetset.client; + +import com.vaadin.client.ui.AbstractComponentConnector; +import com.vaadin.shared.ui.Connect; +import com.vaadin.tests.widgetset.server.GenericWidgetComponent; + +@Connect(GenericWidgetComponent.class) +public class GenericWidgetConnector extends AbstractComponentConnector { + @Override + public GenericWidget getWidget() { + return (GenericWidget) super.getWidget(); + } + + @Override + public GenericWidgetState getState() { + return (GenericWidgetState) super.getState(); + } +} diff --cc uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java index 2be59ee96b,0000000000..32320f0158 mode 100644,000000..100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java @@@ -1,31 -1,0 +1,31 @@@ +/* - * Copyright 2000-2013 Vaadin Ltd. ++ * Copyright 2000-2014 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.widgetset.server; + +import com.vaadin.tests.widgetset.client.GenericWidgetState; +import com.vaadin.ui.AbstractComponent; + +public class GenericWidgetComponent extends AbstractComponent { + + @Override + protected GenericWidgetState getState() { + return (GenericWidgetState) super.getState(); + } + + public void setGenericText(String genericText) { + getState().genericText = genericText; + } +}