From 5744434571318d47180ac620ba1b86e53142f7b0 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 13 Jan 2015 14:19:15 +0200 Subject: Support both DefaultWidgetSet and TestingWidgetSet Change-Id: Icdf5f3cdca60aa7e40d698b51df52ccbac1aee35 --- eclipse/Super Development Mode (vaadin).launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclipse/Super Development Mode (vaadin).launch b/eclipse/Super Development Mode (vaadin).launch index b57410bfd6..9f4da19a74 100644 --- a/eclipse/Super Development Mode (vaadin).launch +++ b/eclipse/Super Development Mode (vaadin).launch @@ -21,7 +21,7 @@ - + -- cgit v1.2.3 From 69db9eac8f76a66210b8eb7308c9e5fc84eff977 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 5 Mar 2015 11:35:19 +0200 Subject: Update @since for 7.4.1 Change-Id: I61233d704eae50447d3ccb5a5c485fe3ef98c436 --- .../com/vaadin/client/widget/escalator/ScrollbarBundle.java | 2 ++ client/src/com/vaadin/client/widgets/Grid.java | 2 +- .../vaadin/server/communication/AtmospherePushConnection.java | 2 +- server/src/com/vaadin/ui/Flash.java | 10 +++++----- server/src/com/vaadin/ui/Grid.java | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java index 2345641408..2b33d7103f 100644 --- a/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java +++ b/client/src/com/vaadin/client/widget/escalator/ScrollbarBundle.java @@ -518,6 +518,8 @@ public abstract class ScrollbarBundle implements DeferredWorker { * Should be called whenever this bundle is attached to the DOM (typically, * from the onLoad of the containing widget). Used to ensure the DOM scroll * position is maintained when detaching and reattaching the bundle. + * + * @since 7.4.1 */ public void onLoad() { internalSetScrollPos(toInt32(scrollPos)); diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 9e0cb0f4f8..75d5ee0f99 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -6290,7 +6290,7 @@ public class Grid extends ResizeComposite implements * cannot rely on the columns being the correct width after the call * returns. * - * @since + * @since 7.4.1 */ public void recalculateColumnWidths() { autoColumnWidthsRecalculator.schedule(); diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index ab45fcfe89..357278f411 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -311,7 +311,7 @@ public class AtmospherePushConnection implements PushConnection { /** * Called when the connection to the client has been lost. * - * @since + * @since 7.4.1 */ public void connectionLost() { resource = null; diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java index cd7c00087e..2d0f188b84 100644 --- a/server/src/com/vaadin/ui/Flash.java +++ b/server/src/com/vaadin/ui/Flash.java @@ -97,7 +97,7 @@ public class Flash extends AbstractEmbedded { * Returns the codebase. * * @see #setCodebase(String) - * @since 7.4 + * @since 7.4.1 * @return Current codebase. */ public String getCodebase() { @@ -126,7 +126,7 @@ public class Flash extends AbstractEmbedded { * Returns the current codetype. * * @see #setCodetype(String) - * @since 7.4 + * @since 7.4.1 * @return Current codetype. */ public String getCodetype() { @@ -157,7 +157,7 @@ public class Flash extends AbstractEmbedded { * Returns current archive. * * @see #setArchive(String) - * @since 7.4 + * @since 7.4.1 * @return Current archive. */ public String getArchive() { @@ -181,7 +181,7 @@ public class Flash extends AbstractEmbedded { /** * Returns standby. * - * @since + * @since 7.4.1 * @return Standby string. */ public String getStandby() { @@ -247,7 +247,7 @@ public class Flash extends AbstractEmbedded { * * @see #setParameter(String, String) * @see #getParameter(String) - * @since 7.4 + * @since 7.4.1 * @return An iterable with declared parameter names. */ public Iterable getParameterNames() { diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java index 6ab6c6b1a4..ee7da1e36c 100644 --- a/server/src/com/vaadin/ui/Grid.java +++ b/server/src/com/vaadin/ui/Grid.java @@ -5088,7 +5088,7 @@ public class Grid extends AbstractComponent implements SelectionNotifier, * but this method can be used to force recalculation in situations when * grid does not recalculate automatically. * - * @since + * @since 7.4.1 */ public void recalculateColumnWidths() { getRpcProxy(GridClientRpc.class).recalculateColumnWidths(); -- cgit v1.2.3 From 4db0b55aefd83d149e62a7fad2b14fb232d976c8 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Fri, 6 Mar 2015 09:09:27 +0000 Subject: Revert "Encode filenames to UTF-8 in Content-Disposition header. (#16556)" Breaks AppResource404, BrowserFrameIsVisible and FlashIsVisible This reverts commit af6dd56e89db8ea8c88f607c4214abcde50dfc94. Change-Id: I82fc9ef4c9d08dc8aa48e0fa137fae5782701389 --- server/src/com/vaadin/server/DownloadStream.java | 30 ++++++---------- server/src/com/vaadin/server/FileDownloader.java | 6 ++++ .../src/com/vaadin/server/FileDownloaderTests.java | 41 ---------------------- 3 files changed, 16 insertions(+), 61 deletions(-) delete mode 100644 server/tests/src/com/vaadin/server/FileDownloaderTests.java diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java index 8b2b933bcc..681c438967 100644 --- a/server/src/com/vaadin/server/DownloadStream.java +++ b/server/src/com/vaadin/server/DownloadStream.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -282,9 +280,16 @@ public class DownloadStream implements Serializable { } } - // Content-Disposition: attachment generally forces download - response.setHeader("Content-Disposition", - getContentDispositionValue()); + // suggest local filename from DownloadStream if + // Content-Disposition + // not explicitly set + String contentDispositionValue = getParameter("Content-Disposition"); + if (contentDispositionValue == null) { + contentDispositionValue = "filename=\"" + getFileName() + + "\""; + response.setHeader("Content-Disposition", + contentDispositionValue); + } int bufferSize = getBufferSize(); if (bufferSize <= 0 || bufferSize > Constants.MAX_BUFFER_SIZE) { @@ -312,21 +317,6 @@ public class DownloadStream implements Serializable { } } - private String getContentDispositionValue() - throws UnsupportedEncodingException { - String contentDispositionValue = getParameter("Content-Disposition"); - - if (contentDispositionValue == null) { - String encodedFilename = URLEncoder.encode(getFileName(), "utf-8"); - - contentDispositionValue = String.format( - "attachment; filename=\"%s\"; filename*=utf-8''%s", - encodedFilename, encodedFilename); - } - - return contentDispositionValue; - } - /** * Helper method that tries to close an output stream and ignores any * exceptions. diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java index bea9922c50..42c2f76e1a 100644 --- a/server/src/com/vaadin/server/FileDownloader.java +++ b/server/src/com/vaadin/server/FileDownloader.java @@ -141,6 +141,12 @@ public class FileDownloader extends AbstractExtension { } stream = ((ConnectorResource) resource).getStream(); + if (stream.getParameter("Content-Disposition") == null) { + // Content-Disposition: attachment generally forces download + stream.setParameter("Content-Disposition", + "attachment; filename=\"" + stream.getFileName() + "\""); + } + // Content-Type to block eager browser plug-ins from hijacking // the file if (isOverrideContentType()) { diff --git a/server/tests/src/com/vaadin/server/FileDownloaderTests.java b/server/tests/src/com/vaadin/server/FileDownloaderTests.java deleted file mode 100644 index 4e9478c570..0000000000 --- a/server/tests/src/com/vaadin/server/FileDownloaderTests.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.server; - -import static org.mockito.Matchers.contains; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URLEncoder; - -import org.junit.Before; -import org.junit.Test; - -public class FileDownloaderTests { - private String filename = "日本語.png"; - private DownloadStream stream; - - @Before - public void setup() { - stream = new DownloadStream(mock(InputStream.class), "", filename); - } - - @Test - public void contentDispositionFilenameIsUtf8Encoded() throws IOException { - VaadinResponse response = mock(VaadinResponse.class); - - stream.writeResponse(mock(VaadinRequest.class), response); - - verify(response).setHeader(eq("Content-Disposition"), - contains("attachment;")); - String encodedFileName = URLEncoder.encode(filename, "utf-8"); - verify(response).setHeader(eq("Content-Disposition"), - contains(String.format("filename=\"%s\";", encodedFileName))); - verify(response) - .setHeader( - eq("Content-Disposition"), - contains(String.format("filename*=utf-8''%s", - encodedFileName))); - } -} -- cgit v1.2.3 From 8cc721393c4b6599eccb2e519f56d85dc5285adc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 19 Feb 2015 23:37:41 +0200 Subject: Remove eXo test which is unreliable and tests an old version Change-Id: I00e1bb23bb312ecf3303b23f22dc07b58e2b8e0e --- .../eXo-3/integration-test-eXo-3.0.3-portlet2.html | 328 --------------------- uitest/integration_tests.xml | 11 - 2 files changed, 339 deletions(-) delete mode 100644 uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html diff --git a/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html b/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html deleted file mode 100644 index 8813f7fe23..0000000000 --- a/uitest/integration-testscripts/eXo-3/integration-test-eXo-3.0.3-portlet2.html +++ /dev/null @@ -1,328 +0,0 @@ - - - - - - -integration-test-eXo-3.1.0-portlet2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
integration-test-eXo-3.1.0-portlet2
open/portal/public/intranet/
setTimeout60000
waitForElementPresentlink=Login as John
mouseClicklink=Login as John37,4
waitForElementPresentlink=Applications Registry
mouseClickAndWaitlink=Applications Registry
mouseClicklink=Portlet33,11
waitForElementPresentlink=Vaadin Portlet 2.0 Test59,9
mouseClicklink=Vaadin Portlet 2.0 Test59,9
waitForElementPresentlink=Click here to add into categories
mouseClicklink=Click here to add into categories48,3
waitForElementPresentname=category_Gadgets
mouseClickname=category_Gadgets10,16
waitForElementPresentlink=Save
mouseClicklink=Save4,6
waitForElementPresentlink=Vaadin Liferay Theme
mouseClicklink=Vaadin Liferay Theme64,13
waitForElementPresentlink=Click here to add into categories
mouseClicklink=Click here to add into categories96,9
waitForElementPresentname=category_Gadgets7,12
mouseClickname=category_Gadgets7,12
waitForElementPresentlink=Save4,6
mouseClicklink=Save4,6
waitForElementPresentlink=Add New Page55,11
mouseClicklink=Add New Page55,11
waitForElementPresentpageName
mouseClickpageName33,16
enterCharacterpageNamePortlet2
mouseClick//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div36,12
waitForElementPresent//div[@id='UIDropDownPageTemp']/div[1]/div/div/div/div/div/div
mouseClick//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div21,13
waitForElementPresent//div[@id='Gadgets/JSR286TestPortlet']/div/div/div/div
drag//div[@id='Gadgets/JSR286TestPortlet']/div/div/div/div
drop//div[2]/div/div/div[1]/div/div[2]/div/div/div/div113,9
waitForTextPresentVaadin Portlet 2.0 Test
mouseClickAndWait//a[@onclick='eXo.core.DOMUtil.disableOnClick(this);']13,5
waitForText//div[2]/div/div/div/spanTest of ApplicationResources with full path
assertText//body/div[4]/div//pexact:Mode: view State: normal
screenCaptureinitial
closeNotification//body/div[4]/div0,0
assertTextNotPresentAction * received
assertText//div[@class="v-link v-widget"]/a/spanEdit
mouseClickAndWait//div[8]/div/a/span32,9
assertTextPresentAction 'someAction' received
assertText//body/div[4]/div//pexact:Mode: view State: normal
assertText//div[@class="v-link v-widget"]/a/spanEdit
closeNotification//body/div[4]/div0,0
mouseClickAndWait//div[5]/div/a/span12,3
assertText//body/div[4]/div//pexact:Mode: edit State: normal
closeNotification//body/div[4]/div0,0
assertText//div[@class="v-link v-widget"]/a/spanDone
mouseClickAndWait//div[6]/div/a/span16,7
assertText//body/div[3]/div//pexact:Mode: edit State: normal
closeNotification//body/div[3]/div0,0
assertText//div[6]/div/a/spanMaximize
mouseClickAndWait//div[6]/div/a/span71,8
assertText//body/div[3]/div//pexact:Mode: edit State: normal
closeNotification//body/div[3]/div0,0
assertText//div[@class="v-link v-widget"]/a/spanDone
assertText//div[6]/div/a/spanMaximize
screenCapturefinal
- - diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml index 26ce4ed70d..67d22c2b2e 100644 --- a/uitest/integration_tests.xml +++ b/uitest/integration_tests.xml @@ -304,16 +304,6 @@ - - - - - - - - - - @@ -406,7 +396,6 @@ - -- cgit v1.2.3 From bb73827b48e54086e24415df0ae19e44a098ac87 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 29 Jan 2015 18:54:35 +0200 Subject: Converted ValidationOfRequiredEmptyFields to TB4 Change-Id: Ifab3d891115b30ef2d3f7542cd57ac7215653fe5 --- .../src/com/vaadin/tests/tb3/AbstractTB3Test.java | 6 + .../ValidationOfRequiredEmptyFields.java | 44 +++--- .../ValidationOfRequiredEmptyFieldsTest.java | 105 +++++++++++++++ .../ValidationOfRequiredEmptyFields.html | 147 --------------------- 4 files changed, 134 insertions(+), 168 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java delete mode 100644 uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index ef32d9a067..a95def5983 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -158,6 +158,12 @@ public abstract class AbstractTB3Test extends ParallelTest { } } + protected WebElement getTooltipErrorElement() { + WebElement tooltip = getDriver().findElement( + com.vaadin.testbench.By.className("v-tooltip")); + return tooltip.findElement(By.className("v-errormessage")); + } + protected WebElement getTooltipElement() { return getDriver().findElement( com.vaadin.testbench.By.className("v-tooltip-text")); diff --git a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java index e70a980d70..4fa6eda5c3 100644 --- a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java +++ b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java @@ -5,11 +5,13 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.Validator; import com.vaadin.data.validator.IntegerValidator; import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.tests.components.TestBase; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.CheckBox; import com.vaadin.ui.TextField; -public class ValidationOfRequiredEmptyFields extends TestBase { +@SuppressWarnings("deprecation") +public class ValidationOfRequiredEmptyFields extends AbstractTestUI { private TextField tf; private CheckBox requiredInput; @@ -23,10 +25,10 @@ public class ValidationOfRequiredEmptyFields extends TestBase { private CheckBox stringLengthValidatorInput; @Override - protected void setup() { + protected void setup(VaadinRequest request) { requiredInput = new CheckBox("Field required"); requiredInput.setImmediate(true); - requiredInput.addListener(new ValueChangeListener() { + requiredInput.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tf.setRequired(requiredInput.getValue()); @@ -35,16 +37,16 @@ public class ValidationOfRequiredEmptyFields extends TestBase { requiredErrorInput = new TextField("Required error message"); requiredErrorInput.setImmediate(true); - requiredErrorInput.addListener(new ValueChangeListener() { + requiredErrorInput.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tf.setRequiredError(requiredErrorInput.getValue()); } }); - integerValidatorInput = new CheckBox("Integer.parseInt validator"); + integerValidatorInput = new CheckBox("Integer validator"); integerValidatorInput.setImmediate(true); - integerValidatorInput.addListener(new ValueChangeListener() { + integerValidatorInput.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { @@ -55,20 +57,20 @@ public class ValidationOfRequiredEmptyFields extends TestBase { } } }); - stringLengthValidatorInput = new CheckBox( - "stringLength.parseInt validator"); + stringLengthValidatorInput = new CheckBox("String length validator"); stringLengthValidatorInput.setImmediate(true); - stringLengthValidatorInput.addListener(new ValueChangeListener() { + stringLengthValidatorInput + .addValueChangeListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - if (stringLengthValidatorInput.getValue()) { - tf.addValidator(stringLengthValidator); - } else { - tf.removeValidator(stringLengthValidator); - } - } - }); + @Override + public void valueChange(ValueChangeEvent event) { + if (stringLengthValidatorInput.getValue()) { + tf.addValidator(stringLengthValidator); + } else { + tf.removeValidator(stringLengthValidator); + } + } + }); tf = new TextField(); tf.setImmediate(true); @@ -86,8 +88,8 @@ public class ValidationOfRequiredEmptyFields extends TestBase { } @Override - protected String getDescription() { - return null; + protected String getTestDescription() { + return "Tests that the lower textfield's tooltip displays validation error messages correctly."; } @Override diff --git a/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java new file mode 100644 index 0000000000..ab77ba6b26 --- /dev/null +++ b/uitest/src/com/vaadin/tests/validation/ValidationOfRequiredEmptyFieldsTest.java @@ -0,0 +1,105 @@ +package com.vaadin.tests.validation; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; + +import com.vaadin.testbench.elements.CheckBoxElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ValidationOfRequiredEmptyFieldsTest extends MultiBrowserTest { + + @Override + protected boolean requireWindowFocusForIE() { + return true; + } + + @Test + public void requiredErrorMessage() throws Exception { + openTestURL(); + getRequiredCheckbox().click(); + getRequiredMessageField().click(); + getRequiredMessageField().sendKeys("The field is required", Keys.TAB); + assertTooltipError("The field is required"); + } + + @Test + public void integerValidatorErrorMessage() { + openTestURL(); + getRequiredCheckbox().click(); + getIntegerValidatorCheckbox().click(); + getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB); + assertTooltipError("Must be an integer"); + } + + @Test + public void requiredWithIntegerAndLengthValidatorErrorMessage() { + openTestURL(); + getRequiredCheckbox().click(); + getIntegerValidatorCheckbox().click(); + getLengthValidatorCheckbox().click(); + getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB); + assertTooltipError("Must be an integer\nMust be 5-10 chars"); + } + + @Test + public void integerAndLengthValidatorErrorMessage() { + openTestURL(); + getIntegerValidatorCheckbox().click(); + getLengthValidatorCheckbox().click(); + getTargetTextField().sendKeys("a", Keys.SHIFT, Keys.TAB); + assertTooltipError("Must be an integer\nMust be 5-10 chars"); + } + + private void assertTooltipError(final String message) { + TextFieldElement e = getTargetTextField(); + testBenchElement(e).showTooltip(); + waitUntil(new ExpectedCondition() { + + @Override + public Boolean apply(WebDriver input) { + return message.equals(getTooltipErrorElement().getText()); + } + + @Override + public String toString() { + return "tooltip to be '" + message + "' (was: '" + + getTooltipErrorElement().getText() + "')"; + } + }); + hideTooltip(); + } + + private void hideTooltip() { + $(VerticalLayoutElement.class).first().click(); + } + + private TextFieldElement getRequiredMessageField() { + return $(TextFieldElement.class).all().get(0); + } + + private TextFieldElement getTargetTextField() { + return $(TextFieldElement.class).all().get(1); + } + + private WebElement getRequiredCheckbox() { + return $(CheckBoxElement.class).caption("Field required").first() + .findElement(By.xpath("input")); + } + + private WebElement getIntegerValidatorCheckbox() { + return $(CheckBoxElement.class).caption("Integer validator").first() + .findElement(By.xpath("input")); + } + + private WebElement getLengthValidatorCheckbox() { + return $(CheckBoxElement.class).caption("String length validator") + .first().findElement(By.xpath("input")); + } + +} diff --git a/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html b/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html deleted file mode 100644 index 62d972e89f..0000000000 --- a/uitest/tb2/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.validation.ValidationOfRequiredEmptyFields?restartApplication
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]11,8
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0]60,11
enterCharactervaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0]The field is required
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]0,0
screenCapturerequired-message
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]13,5
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]28,13
enterCharactervaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]a
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]34,186
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]0,0
screenCaptureerror-must-be-int
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]45,9
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]0,0
waitForVisiblevaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]
screenCaptureerror-must-be-int-and-5-to-10-chars
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]0,0
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]12,7
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]124,12
typevaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]8,10
mouseClickvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]13,7
showTooltipvaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]0,0
waitForVisiblevaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]
screenCaptureempty-invalid-not-required
- - -- cgit v1.2.3 From 789995e01e79944d45797d31b640b42fa34b115c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 6 Mar 2015 14:24:00 +0200 Subject: Ensure refresh message is sent on invalid CSRF (#17042) If we create an AtmospherePushConnection and a broadcaster like before we would need to suspend the connection to ensure the AtmosphereResource is actually added to the broadcaster Change-Id: I7265ac0594b7a4da2c7a49fa34ebfbb27e1abdff --- .../com/vaadin/server/communication/PushHandler.java | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index 22eee70aa0..c570d22086 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -470,23 +470,9 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter { */ private static void sendRefreshAndDisconnect(AtmosphereResource resource) throws IOException { - if (resource instanceof AtmosphereResourceImpl - && !((AtmosphereResourceImpl) resource).isInScope()) { - // The resource is no longer valid so we should not write - // anything to it - getLogger() - .fine("sendRefreshAndDisconnect called for resource no longer in scope"); - return; - } - - AtmospherePushConnection connection = new AtmospherePushConnection(null); - connection.connect(resource); - try { - connection.sendMessage(VaadinService - .createCriticalNotificationJSON(null, null, null, null)); - } finally { - connection.disconnect(); - } + sendNotificationAndDisconnect(resource, + VaadinService.createCriticalNotificationJSON(null, null, null, + null)); } /** -- cgit v1.2.3 From b3684f5a1aee5fab2f3bdb6c77305151fc0f91a3 Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 4 Mar 2015 11:26:23 +0200 Subject: Add OSGi integration tests (#9583) Change-Id: Ibea856ab7bbde663d9a1762050902f1740f6d73f --- uitest/integration_tests.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml index 67d22c2b2e..1e040b04f7 100644 --- a/uitest/integration_tests.xml +++ b/uitest/integration_tests.xml @@ -150,6 +150,13 @@
+ + + + + + + @@ -415,6 +422,7 @@ + -- cgit v1.2.3 From dee8a04d16f01ed062920913a251f0fd371c5b32 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 6 Mar 2015 15:51:56 +0200 Subject: Fix regression for Table selection and checkbox issue (#17064) Converts the old TB2 test for the issue to TB4 as well. Change-Id: I76a37d836a55102221aa63e75f7ab605769bc0b9 --- WebContent/VAADIN/themes/base/table/table.scss | 6 ++++ .../components/table/SelectableEditableTest.java | 18 ++++++++++++ .../tests/components/table/SelectableEditable.html | 32 ---------------------- 3 files changed, 24 insertions(+), 32 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java delete mode 100644 uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html diff --git a/WebContent/VAADIN/themes/base/table/table.scss b/WebContent/VAADIN/themes/base/table/table.scss index f500d2f12a..22ffdffa4d 100644 --- a/WebContent/VAADIN/themes/base/table/table.scss +++ b/WebContent/VAADIN/themes/base/table/table.scss @@ -247,6 +247,12 @@ .v-off { color: #ddd; } + +/* CheckBox and selection fix #9064 */ +.#{$primaryStyleName} .v-checkbox { + display: inline-block; +} + /************************************* * Drag'n'drop styles *************************************/ diff --git a/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java b/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java new file mode 100644 index 0000000000..8b5b54cfaa --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/SelectableEditableTest.java @@ -0,0 +1,18 @@ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class SelectableEditableTest extends MultiBrowserTest { + @Test + public void testSelectFromCellWith() throws Exception { + openTestURL(); + TableElement table = $(TableElement.class).first(); + table.getCell(0, 1).click(70, 12); + Assert.assertTrue("Element does not have the 'v-selected' css class", + hasCssClass(table.getRow(0), "v-selected")); + } +} diff --git a/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html b/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html deleted file mode 100644 index 8d46523c40..0000000000 --- a/uitest/tb2/com/vaadin/tests/components/table/SelectableEditable.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -SelectableEditable - - - - - - - - - - - - - - - - - - - - - - -
SelectableEditable
open/run/com.vaadin.tests.components.table.SelectableEditable?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstableSelectableEditable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[0]70,12
assertCSSClassvaadin=runcomvaadintestscomponentstableSelectableEditable::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]v-selected
- - -- cgit v1.2.3 From eee3c6be22e583752748acea31255b27fde27fdf Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 9 Mar 2015 13:03:02 +0200 Subject: Disable auto-testing of TB2 tests on Chrome Chrome has started auto-updating even though auto updates are disabled on the test machines. TestBench 2 works with Chrome 41 (latest) but opens the test in a new tab instead of in a new window and therefore is unable to resize the browser to the correct size for screenshots. Change-Id: Ib7f05a9115a9c82f5b3b384d73c47d6becbfbe79 --- uitest/test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uitest/test.xml b/uitest/test.xml index 496e115c18..c07c4d96af 100644 --- a/uitest/test.xml +++ b/uitest/test.xml @@ -7,7 +7,7 @@ - + -- cgit v1.2.3 From 9086245a6d2052fe813b3ef4296c686aad82b244 Mon Sep 17 00:00:00 2001 From: Alexey Fansky Date: Wed, 4 Mar 2015 13:23:42 -0800 Subject: Using ComponentFactory in DesignContext.getDefaultInstance() (#16990) Change-Id: I0bb3e7975f2b48cdc589de740cb07ac893b13461 --- .../com/vaadin/ui/declarative/DesignContext.java | 21 +++++++++--------- .../vaadin/tests/design/ComponentFactoryTest.java | 25 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/server/src/com/vaadin/ui/declarative/DesignContext.java b/server/src/com/vaadin/ui/declarative/DesignContext.java index 09fefd0a6b..218774c72d 100644 --- a/server/src/com/vaadin/ui/declarative/DesignContext.java +++ b/server/src/com/vaadin/ui/declarative/DesignContext.java @@ -278,16 +278,8 @@ public class DesignContext implements Serializable { Class componentClass) { Component instance = instanceCache.get(componentClass); if (instance == null) { - try { - instance = componentClass.newInstance(); - instanceCache.put(componentClass, instance); - } catch (InstantiationException e) { - throw new RuntimeException("Could not instantiate " - + componentClass.getName()); - } catch (IllegalAccessException e) { - throw new RuntimeException("Could not instantiate " - + componentClass.getName()); - } + instance = instantiateClass(componentClass.getName()); + instanceCache.put(componentClass, instance); } return instance; } @@ -484,6 +476,15 @@ public class DesignContext implements Serializable { // Extract the package and class names. String qualifiedClassName = tagNameToClassName(node); + return instantiateClass(qualifiedClassName); + } + + /** + * Instantiates given class via ComponentFactory. + * @param qualifiedClassName class name to instantiate + * @return instance of a given class + */ + private Component instantiateClass(String qualifiedClassName) { ComponentFactory factory = Design.getComponentFactory(); Component component = factory.createComponent(qualifiedClassName, this); diff --git a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java index a5f1d288a2..4115872fb7 100644 --- a/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java +++ b/server/tests/src/com/vaadin/tests/design/ComponentFactoryTest.java @@ -19,6 +19,8 @@ import java.io.ByteArrayInputStream; import java.util.ArrayList; import java.util.List; +import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.TextField; import org.junit.After; import org.junit.Assert; import org.junit.Test; @@ -109,9 +111,32 @@ public class ComponentFactoryTest { Design.read(new ByteArrayInputStream("".getBytes())); } + @Test + public void testGetDefaultInstanceUsesComponentFactory() { + final List classes = new ArrayList(); + currentComponentFactory.set(new ComponentFactory() { + @Override + public Component createComponent(String fullyQualifiedClassName, + DesignContext context) { + classes.add(fullyQualifiedClassName); + return defaultFactory.createComponent(fullyQualifiedClassName, + context); + } + }); + + DesignContext designContext = new DesignContext(); + designContext.getDefaultInstance(new DefaultInstanceTestComponent()); + + Assert.assertEquals("There should be one class requests", 1, classes.size()); + Assert.assertEquals("First class should be DefaultInstanceTestComponent", + DefaultInstanceTestComponent.class.getName(), classes.get(0)); + } + @After public void cleanup() { currentComponentFactory.remove(); } + public static class DefaultInstanceTestComponent extends AbstractComponent { + } } -- cgit v1.2.3 From 3373024142a2adc22654afca1c5ac6ca195d3660 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 2 Jan 2015 16:20:26 +0200 Subject: Script for updating push version Supports both Vaadin atmosphere versions and upstream versions Change-Id: I4d4965354a19c071dbd0bfb295e311e7cd55a63f --- scripts/updatePushVersion.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 scripts/updatePushVersion.sh diff --git a/scripts/updatePushVersion.sh b/scripts/updatePushVersion.sh new file mode 100755 index 0000000000..d2e83e0454 --- /dev/null +++ b/scripts/updatePushVersion.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +if [ "$#" != "2" ] +then + echo "Usage: $0 " + echo "If the runtime version contains the string 'vaadin', then a vaadin atmosphere version will be assumed, otherwise an upstream atmosphere version". + echo "If a version is set to -, the version will not be updated" + exit 1 +fi + +pushd `dirname $0`/.. > /dev/null +basedir=`pwd` +popd > /dev/null + +currentRuntime=`grep ENTITY "$basedir"/push/ivy.xml|grep runtime.version|cut -d\" -f 2` +currentJs=`grep ENTITY "$basedir"/push/ivy.xml|grep js.version|cut -d\" -f 2` + +sed=`which sed` + +uname|grep Darwin > /dev/null +if [ "$?" = "0" ] +then + # Mac if uname output contains Darwin + sed=`which gsed` + if [ "$sed" = "" ] + then + echo "Install gnu sed (gsed) using e.g. brew install gnu-sed" + exit 2 + fi +fi + +echo "Currently using runtime $currentRuntime and JS $currentJs" + +newRuntime=$1 +newJs=$2 + +if [ "$newRuntime" != "-" ] +then + echo "Updating runtime to $newRuntime..." + $sed -i "s#$currentRuntime#$newRuntime#" "$basedir"/push/ivy.xml + $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/push/build.xml + $sed -i "s/$currentRuntime/$newRuntime/g" "$basedir"/server/src/com/vaadin/server/Constants.java + if [[ $newRuntime == *"vaadin"* ]] + then + $sed -i "s/org.atmosphere/com.vaadin.external.atmosphere/g" "$basedir"/push/ivy.xml + else + $sed -i "s/com.vaadin.external.atmosphere/org.atmosphere/g" "$basedir"/push/ivy.xml + fi +fi + +if [ "$newJs" != "-" ] +then + echo "Updating JS to $newJs..." + $sed -i "s/$currentJs/$newJs/g" "$basedir"/push/ivy.xml +fi -- cgit v1.2.3 From 21c73437439539276c6f4152fa149c201db94d95 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 10 Mar 2015 15:19:27 +0200 Subject: Update Atmosphere to 2.2.4.vaadin5 (#17074) Change-Id: I85618f66effbf647856d9c152b3e66a6454001d9 --- push/build.xml | 2 +- push/ivy.xml | 2 +- server/src/com/vaadin/server/Constants.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/push/build.xml b/push/build.xml index 519dc81ed2..336c3629aa 100644 --- a/push/build.xml +++ b/push/build.xml @@ -18,7 +18,7 @@ location="${result.dir}/js/VAADIN/vaadinPush.debug.js" /> - + diff --git a/push/ivy.xml b/push/ivy.xml index c285bfd4aa..605f5d1a05 100644 --- a/push/ivy.xml +++ b/push/ivy.xml @@ -1,7 +1,7 @@ - + ]> diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index b9a43a98de..b7c2a1ff3e 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -67,7 +67,7 @@ public interface Constants { // Keep the version number in sync with push/build.xml and other locations // listed in that file - static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin4"; + static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin5"; static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n" + "=================================================================\n" -- cgit v1.2.3 From 155ffa7560e6445557ad2d04d2f83411c391debb Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Wed, 25 Feb 2015 23:19:30 +0200 Subject: Use Math.floor instead of casting to int when trimming decimals. (#16926) Change-Id: I02802b910d0dc90221483fedbf05be48958d8dcc --- server/src/com/vaadin/ui/Slider.java | 2 +- .../src/com/vaadin/tests/server/component/slider/SliderTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index dad4d295bf..fab6e33cae 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -267,7 +267,7 @@ public class Slider extends AbstractField { if (resolution > 0) { // Round up to resolution - newValue = (int) (v * Math.pow(10, resolution)); + newValue = Math.floor(v * Math.pow(10, resolution)); newValue = newValue / Math.pow(10, resolution); if (getMin() > newValue || getMax() < newValue) { throw new ValueOutOfBoundsException(newValue); diff --git a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java index 48bba8a853..d2e2654cbc 100644 --- a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java @@ -65,6 +65,15 @@ public class SliderTest { } catch (Slider.ValueOutOfBoundsException e) { // TODO: handle exception } + } + + @Test + public void valueCanHaveLargePrecision() { + Slider slider = new Slider(); + slider.setResolution(20); + + slider.setValue(99.01234567891234567890123456789); + assertThat(slider.getValue(), is(99.01234567891234567890123456789)); } } -- cgit v1.2.3 From b2db17740aa8e7b33b208c73559c1d5d3461c192 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Mon, 2 Mar 2015 13:28:15 +0100 Subject: Improve performance of getMeasureTargetsJsArray (#16973). This change optimizes the method LayoutDependenyTree.getMeasureTargetsJsArray. The previous code dumps both MeasureQueues and then iterates over the vertical one and then checks if it is present in the horizontal one. If it is not present it pushes the element to the array (which usually invokes an arraycopy in js). The new code adds both Queues to a new FastStringSet which does deal with duplicates nicely. While this is not much faster than the dumps, it avoids the array allocations and the separate iteration for duplicate checking. Change-Id: I2f643a2d0b32e4c2517efff16c196387f38f0d8a --- .../vaadin/client/ui/layout/LayoutDependencyTree.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java index da3aed4bbc..af261c0208 100644 --- a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -690,19 +690,10 @@ public class LayoutDependencyTree { } public JsArrayString getMeasureTargetsJsArray() { - FastStringSet horizontalQueue = getMeasureQueue(HORIZONTAL); - JsArrayString measureTargets = horizontalQueue.dump(); - - JsArrayString verticalDump = getMeasureQueue(VERTICAL).dump(); - int length = verticalDump.length(); - for (int i = 0; i < length; i++) { - String connectorId = verticalDump.get(i); - if (!horizontalQueue.contains(connectorId)) { - measureTargets.push(connectorId); - } - } - - return measureTargets; + FastStringSet allMeasuredTargets = FastStringSet.create(); + allMeasuredTargets.addAll(getMeasureQueue(HORIZONTAL)); + allMeasuredTargets.addAll(getMeasureQueue(VERTICAL)); + return allMeasuredTargets.dump(); } public void logDependencyStatus(ComponentConnector connector) { -- cgit v1.2.3 From c2a85b37901a70fa3134c0dc2adfcff97e7b06e8 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Mon, 2 Mar 2015 10:45:28 +0100 Subject: LayoutManager uses shortcut when delaying overflow fixes (#16963). This change introduces an extracted method which will quick return if a component needs a delayedOverflowFix. Change-Id: I0d6ab100964a59e2f445a81271863a8212538d4d --- client/src/com/vaadin/client/LayoutManager.java | 27 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index f77b61a5a3..dfcf2cb5bb 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -605,15 +605,7 @@ public class LayoutManager { ComponentConnector componentConnector = (ComponentConnector) connectorMap .getConnector(connectorId); - // Delay the overflow fix if the involved connectors might still - // change - boolean connectorChangesExpected = !currentDependencyTree - .noMoreChangesExpected(componentConnector); - boolean parentChangesExcpected = componentConnector.getParent() instanceof ComponentConnector - && !currentDependencyTree - .noMoreChangesExpected((ComponentConnector) componentConnector - .getParent()); - if (connectorChangesExpected || parentChangesExcpected) { + if (delayOverflowFix(componentConnector)) { delayedOverflowFixes.add(connectorId); continue; } @@ -732,6 +724,23 @@ public class LayoutManager { return measureCount; } + /* + * Delay the overflow fix if the involved connectors might still change + */ + private boolean delayOverflowFix(ComponentConnector componentConnector) { + if (!currentDependencyTree.noMoreChangesExpected(componentConnector)) { + return true; + } + ServerConnector parent = componentConnector.getParent(); + if (parent instanceof ComponentConnector + && !currentDependencyTree + .noMoreChangesExpected((ComponentConnector) parent)) { + return true; + } + + return false; + } + private void measureConnector(ComponentConnector connector) { Profiler.enter("LayoutManager.measureConnector"); Element element = connector.getWidget().getElement(); -- cgit v1.2.3 From ed8ac01fbd34d4ef8654bc458b83773898aa55b4 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Mon, 2 Mar 2015 13:08:02 +0100 Subject: Improve performance of setNeedsMeasure (#16972). This change removes the method LayoutDependenyTree.setNeedsMeasure which takes a connectorId as first param. In all places where it is used, the ComponentConnector is actually known, so this change avoids looking it up over and over again. Also The lookup would need to lookup the ConnectorMap every time. Change-Id: I2593b0bede05cd69889ba68aac854cfba43f70b1 --- client/src/com/vaadin/client/LayoutManager.java | 17 ++++++++++------- .../vaadin/client/ui/layout/LayoutDependencyTree.java | 9 +++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index dfcf2cb5bb..828f0942b7 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -310,8 +310,11 @@ public class LayoutManager { dump = needsMeasure.dump(); dumpLength = dump.length(); for (int i = 0; i < dumpLength; i++) { - String layoutId = dump.get(i); - currentDependencyTree.setNeedsMeasure(layoutId, true); + ServerConnector connector = connectorMap.getConnector(dump.get(i)); + if (connector != null) { + currentDependencyTree.setNeedsMeasure( + (ComponentConnector) connector, true); + } } needsMeasure = FastStringSet.create(); @@ -661,7 +664,7 @@ public class LayoutManager { parentElement.getStyle().setProperty("overflow", originalOverflows.get(parentElement)); - layoutDependencyTree.setNeedsMeasure(connectorId, true); + layoutDependencyTree.setNeedsMeasure(componentConnector, true); } Profiler.leave("Overflow fix restore"); @@ -695,8 +698,7 @@ public class LayoutManager { measureConnector(connectors.get(i)); } for (int i = 0; i < connectorCount; i++) { - layoutDependencyTree.setNeedsMeasure(connectors.get(i) - .getConnectorId(), false); + layoutDependencyTree.setNeedsMeasure(connectors.get(i), false); } measureCount += connectorCount; @@ -715,8 +717,9 @@ public class LayoutManager { measureCount++; } for (int i = 0; i < length; i++) { - String connectorId = measureTargets.get(i); - layoutDependencyTree.setNeedsMeasure(connectorId, false); + ComponentConnector connector = (ComponentConnector) connectorMap + .getConnector(measureTargets.get(i)); + layoutDependencyTree.setNeedsMeasure(connector, false); } } Profiler.leave("Layout measure from tree"); diff --git a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java index af261c0208..07bb6688e3 100644 --- a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -429,6 +429,15 @@ public class LayoutDependencyTree { setNeedsVerticalMeasure(connector, needsMeasure); } + /** + * @param connectorId + * @param needsMeasure + * + * @deprecated As of 7.4.2, use + * {@link #setNeedsMeasure(ComponentConnector, boolean)} for + * improved performance. + */ + @Deprecated public void setNeedsMeasure(String connectorId, boolean needsMeasure) { ComponentConnector connector = (ComponentConnector) ConnectorMap.get( connection).getConnector(connectorId); -- cgit v1.2.3 From 5692572146f7029c51b129ff30c89dd30d9c788d Mon Sep 17 00:00:00 2001 From: Henrik Paul Date: Thu, 12 Mar 2015 14:22:29 +0200 Subject: Makes Connectors into DeferredWorker candidates (#17127) Change-Id: Ie24a85a2c4abc5e68af0bec2af4dcbcabee77c91 --- .../com/vaadin/client/ApplicationConnection.java | 215 +++++++++++---------- client/src/com/vaadin/client/DeferredWorker.java | 12 +- 2 files changed, 114 insertions(+), 113 deletions(-) diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index f88a3b6f63..1b3196e1c2 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -62,7 +62,6 @@ import com.google.gwt.user.client.Window.ClosingHandler; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConfiguration.ErrorMessage; -import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; import com.vaadin.client.ResourceLoader.ResourceLoadEvent; import com.vaadin.client.ResourceLoader.ResourceLoadListener; import com.vaadin.client.communication.HasJavaScriptConnectorHelper; @@ -94,7 +93,6 @@ import com.vaadin.client.ui.VOverlay; import com.vaadin.client.ui.dd.VDragAndDropManager; import com.vaadin.client.ui.ui.UIConnector; import com.vaadin.client.ui.window.WindowConnector; -import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.JsonConstants; import com.vaadin.shared.VaadinUriResolver; @@ -115,14 +113,14 @@ import elemental.json.JsonValue; * This is the client side communication "engine", managing client-server * communication with its server side counterpart * com.vaadin.server.VaadinService. - * + * * Client-side connectors receive updates from the corresponding server-side * connector (typically component) as state updates or RPC calls. The connector * has the possibility to communicate back with its server side counter part * through RPC calls. - * + * * TODO document better - * + * * Entry point classes (widgetsets) define onModuleLoad(). */ public class ApplicationConnection implements HasHandlers { @@ -166,12 +164,12 @@ public class ApplicationConnection implements HasHandlers { * A string that, if found in a non-JSON response to a UIDL request, will * cause the browser to refresh the page. If followed by a colon, optional * whitespace, and a URI, causes the browser to synchronously load the URI. - * + * *

* This allows, for instance, a servlet filter to redirect the application * to a custom login page when the session expires. For example: *

- * + * *
      * if (sessionExpired) {
      *     response.setHeader("Content-Type", "text/html");
@@ -354,7 +352,7 @@ public class ApplicationConnection implements HasHandlers {
     /**
      * Event triggered when a XHR request has finished with the status code of
      * the response.
-     *
+     * 
      * Useful for handlers observing network failures like online/off-line
      * monitors.
      */
@@ -410,12 +408,12 @@ public class ApplicationConnection implements HasHandlers {
     /**
      * Event triggered when a application is stopped by calling
      * {@link ApplicationConnection#setApplicationRunning(false)}.
-     *
+     * 
      * To listen for the event add a {@link ApplicationStoppedHandler} by
      * invoking
      * {@link ApplicationConnection#addHandler(ApplicationConnection.ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
      * to the {@link ApplicationConnection}
-     *
+     * 
      * @since 7.1.8
      * @author Vaadin Ltd
      */
@@ -442,7 +440,7 @@ public class ApplicationConnection implements HasHandlers {
         /**
          * Called when a communication error has occurred. Returning
          * true from this method suppresses error handling.
-         *
+         * 
          * @param details
          *            A string describing the error.
          * @param statusCode
@@ -457,7 +455,7 @@ public class ApplicationConnection implements HasHandlers {
      * A listener for listening to application stopped events. The listener can
      * be added to a {@link ApplicationConnection} by invoking
      * {@link ApplicationConnection#addHandler(ApplicationStoppedEvent.Type, ApplicationStoppedHandler)}
-     *
+     * 
      * @since 7.1.8
      * @author Vaadin Ltd
      */
@@ -467,7 +465,7 @@ public class ApplicationConnection implements HasHandlers {
          * Triggered when the {@link ApplicationConnection} marks a previously
          * running application as stopped by invoking
          * {@link ApplicationConnection#setApplicationRunning(false)}
-         *
+         * 
          * @param event
          *            the event triggered by the {@link ApplicationConnection}
          */
@@ -599,7 +597,7 @@ public class ApplicationConnection implements HasHandlers {
      * called once this application has started (first response received) or
      * failed to start. This ensures that the applications are started in order,
      * to avoid session-id problems.
-     *
+     * 
      */
     public void start() {
         String jsonText = configuration.getUIDL();
@@ -709,7 +707,7 @@ public class ApplicationConnection implements HasHandlers {
      * 
  • vaadin.postRequestHooks is a map of functions which gets * called after each XHR made by vaadin application. Note, that it is * attaching js functions responsibility to create the variable like this: - * + * *
          * if(!vaadin.postRequestHooks) {vaadin.postRequestHooks = new Object();}
          * postRequestHooks.myHook = function(appId) {
    @@ -720,7 +718,7 @@ public class ApplicationConnection implements HasHandlers {
          * 
    First parameter passed to these functions is the identifier * of Vaadin application that made the request. * - * + * * TODO make this multi-app aware */ private native void initializeClientHooks() @@ -751,7 +749,7 @@ public class ApplicationConnection implements HasHandlers { /** * Runs possibly registered client side post request hooks. This is expected * to be run after each uidl request made by Vaadin application. - * + * * @param appId */ private static native void runPostRequestHooks(String appId) @@ -771,7 +769,7 @@ public class ApplicationConnection implements HasHandlers { /** * If on Liferay and logged in, ask the client side session management * JavaScript to extend the session duration. - * + * * Otherwise, Liferay client side JavaScript will explicitly expire the * session even though the server side considers the session to be active. * See ticket #8305 for more information. @@ -790,7 +788,7 @@ public class ApplicationConnection implements HasHandlers { /** * Indicates whether or not there are currently active UIDL requests. Used * internally to sequence requests properly, seldom needed in Widgets. - * + * * @return true if there are active requests */ public boolean hasActiveRequest() { @@ -810,7 +808,7 @@ public class ApplicationConnection implements HasHandlers { /** * Requests an analyze of layouts, to find inconsistencies. Exclusively used * for debugging during development. - * + * * @deprecated as of 7.1. Replaced by {@link UIConnector#analyzeLayouts()} */ @Deprecated @@ -822,7 +820,7 @@ public class ApplicationConnection implements HasHandlers { * Sends a request to the server to print details to console that will help * the developer to locate the corresponding server-side connector in the * source code. - * + * * @param serverConnector * @deprecated as of 7.1. Replaced by * {@link UIConnector#showServerDebugInfo(ServerConnector)} @@ -834,7 +832,7 @@ public class ApplicationConnection implements HasHandlers { /** * Makes an UIDL request to the server. - * + * * @param reqInvocations * Data containing RPC invocations and all related information. * @param extraParams @@ -872,7 +870,7 @@ public class ApplicationConnection implements HasHandlers { /** * Sends an asynchronous or synchronous UIDL request to the server using the * given URI. - * + * * @param uri * The URI to use for the request. May includes GET parameters * @param payload @@ -947,8 +945,7 @@ public class ApplicationConnection implements HasHandlers { } }).schedule(100); } else { - handleError( - "Invalid status code 0 (server down?)", + handleError("Invalid status code 0 (server down?)", statusCode); } return; @@ -993,8 +990,8 @@ public class ApplicationConnection implements HasHandlers { } else if ((statusCode / 100) == 5) { // Something's wrong on the server, there's nothing the // client can do except maybe try again. - handleError("Server error. Error code: " - + statusCode, statusCode); + handleError("Server error. Error code: " + statusCode, + statusCode); return; } @@ -1039,7 +1036,7 @@ public class ApplicationConnection implements HasHandlers { /** * Handles received UIDL JSON text, parsing it, and passing it on to the * appropriate handlers, while logging timing information. - * + * * @param jsonText * @param statusCode */ @@ -1076,7 +1073,7 @@ public class ApplicationConnection implements HasHandlers { /** * Sends an asynchronous UIDL request to the server using the given URI. - * + * * @param uri * The URI to use for the request. May includes GET parameters * @param payload @@ -1211,7 +1208,7 @@ public class ApplicationConnection implements HasHandlers { /** * Checks whether or not the CSS is loaded. By default checks the size of * the loading indicator element. - * + * * @return */ protected boolean isCSSLoaded() { @@ -1221,12 +1218,12 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the communication error notification. - * + * * @param details * Optional details for debugging. * @param statusCode * The status code returned for the request - * + * */ protected void showCommunicationError(String details, int statusCode) { VConsole.error("Communication error: " + details); @@ -1235,7 +1232,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the authentication error notification. - * + * * @param details * Optional details for debugging. */ @@ -1246,7 +1243,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the session expiration notification. - * + * * @param details * Optional details for debugging. */ @@ -1257,7 +1254,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows an error notification. - * + * * @param details * Optional details for debugging. * @param message @@ -1270,7 +1267,7 @@ public class ApplicationConnection implements HasHandlers { /** * Shows the error notification. - * + * * @param details * Optional details for debugging. */ @@ -1357,7 +1354,7 @@ public class ApplicationConnection implements HasHandlers { /** * This method is called after applying uidl change set to application. - * + * * It will clean current and queued variable change sets. And send next * change set if it exists. */ @@ -1376,7 +1373,7 @@ public class ApplicationConnection implements HasHandlers { /** * Cleans given queue of variable changes of such changes that came from * components that do not exist anymore. - * + * * @param variableBurst */ private void cleanVariableBurst( @@ -1403,20 +1400,25 @@ public class ApplicationConnection implements HasHandlers { int size = connectors.size(); for (int i = 0; i < size; i++) { ServerConnector conn = connectors.get(i); - ComponentConnector compConn = null; + if (isWorkPending(conn)) { + return true; + } + if (conn instanceof ComponentConnector) { - compConn = (ComponentConnector) conn; - Widget wgt = compConn.getWidget(); - if (wgt instanceof DeferredWorker) { - if (((DeferredWorker) wgt).isWorkPending()) { - return true; - } + ComponentConnector compConn = (ComponentConnector) conn; + if (isWorkPending(compConn.getWidget())) { + return true; } } } return false; } + private static boolean isWorkPending(Object object) { + return object instanceof DeferredWorker + && ((DeferredWorker) object).isWorkPending(); + } + /** * Checks if deferred commands are (potentially) still being executed as a * result of an update from the server. Returns true if a deferred command @@ -1425,7 +1427,7 @@ public class ApplicationConnection implements HasHandlers { *

    * Used by the native "client.isActive" function. *

    - * + * * @return true if deferred commands are (potentially) being executed, false * otherwise */ @@ -1440,7 +1442,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns the loading indicator used by this ApplicationConnection - * + * * @return The loading indicator for this ApplicationConnection */ public VLoadingIndicator getLoadingIndicator() { @@ -1449,7 +1451,7 @@ public class ApplicationConnection implements HasHandlers { /** * Determines whether or not the loading indicator is showing. - * + * * @return true if the loading indicator is visible * @deprecated As of 7.1. Use {@link #getLoadingIndicator()} and * {@link VLoadingIndicator#isVisible()}.isVisible() instead. @@ -1483,7 +1485,7 @@ public class ApplicationConnection implements HasHandlers { * server is received. *

    * The initial id when no request has yet been processed is -1. - * + * * @return and id identifying the response */ public int getLastResponseId() { @@ -1923,13 +1925,13 @@ public class ApplicationConnection implements HasHandlers { /** * Sends the state change events created while updating the state * information. - * + * * This must be called after hierarchy change listeners have been * called. At least caption updates for the parent are strange if * fired from state change listeners and thus calls the parent * BEFORE the parent is aware of the child (through a * ConnectorHierarchyChangedEvent) - * + * * @param pendingStateChangeEvents * The events to send */ @@ -2285,7 +2287,7 @@ public class ApplicationConnection implements HasHandlers { * Updates the connector hierarchy and returns a list of events that * should be fired after update of the hierarchy and the state is * done. - * + * * @param json * The JSON containing the hierarchy information * @return A collection of events that should be fired when update @@ -2697,9 +2699,9 @@ public class ApplicationConnection implements HasHandlers { /** * Adds an explicit RPC method invocation to the send queue. - * + * * @since 7.0 - * + * * @param invocation * RPC method invocation * @param delayed @@ -2739,7 +2741,7 @@ public class ApplicationConnection implements HasHandlers { /** * Removes any pending invocation of the given method from the queue - * + * * @param invocation * The invocation to remove */ @@ -2757,12 +2759,12 @@ public class ApplicationConnection implements HasHandlers { /** * This method sends currently queued variable changes to server. It is * called when immediate variable update must happen. - * + * * To ensure correct order for variable changes (due servers multithreading * or network), we always wait for active request to be handler before * sending a new one. If there is an active request, we will put varible * "burst" to queue that will be purged after current request is handled. - * + * */ public void sendPendingVariableChanges() { if (!deferredSendPending) { @@ -2803,11 +2805,11 @@ public class ApplicationConnection implements HasHandlers { /** * Build the variable burst and send it to server. - * + * * When sync is forced, we also force sending of all pending variable-bursts * at the same time. This is ok as we can assume that DOM will never be * updated after this. - * + * * @param pendingInvocations * List of RPC method invocations to send */ @@ -2901,7 +2903,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -2923,7 +2925,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -2946,7 +2948,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -2969,7 +2971,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -2992,7 +2994,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3015,7 +3017,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3038,7 +3040,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3061,7 +3063,7 @@ public class ApplicationConnection implements HasHandlers { * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. *

    - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3078,13 +3080,13 @@ public class ApplicationConnection implements HasHandlers { /** * Sends a new value for the given paintables given variable to the server. - * + *

    * The update is actually queued to be sent at a suitable time. If immediate * is true, the update is sent as soon as possible. If immediate is false, * the update will be sent along with the next immediate update. - * + *

    * A null array is sent as an empty array. - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3101,14 +3103,13 @@ public class ApplicationConnection implements HasHandlers { /** * Sends a new value for the given paintables given variable to the server. - * + *

    * The update is actually queued to be sent at a suitable time. If immediate * is true, the update is sent as soon as possible. If immediate is false, - * the update will be sent along with the next immediate update.

    - * + * the update will be sent along with the next immediate update. + *

    * A null array is sent as an empty array. - * - * + * * @param paintableId * the id of the paintable that owns the variable * @param variableName @@ -3125,7 +3126,7 @@ public class ApplicationConnection implements HasHandlers { /** * Does absolutely nothing. Replaced by {@link LayoutManager}. - * + * * @param container * @deprecated As of 7.0, serves no purpose */ @@ -3147,7 +3148,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns false - * + * * @param paintable * @return false, always * @deprecated As of 7.0, serves no purpose @@ -3159,7 +3160,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns false - * + * * @param paintable * @return false, always * @deprecated As of 7.0, serves no purpose @@ -3180,16 +3181,16 @@ public class ApplicationConnection implements HasHandlers { /** * Get either an existing ComponentConnector or create a new * ComponentConnector with the given type and id. - * + * * If a ComponentConnector with the given id already exists, returns it. * Otherwise creates and registers a new ComponentConnector of the given * type. - * + * * @param connectorId * Id of the paintable * @param connectorType * Type of the connector, as passed from the server side - * + * * @return Either an existing ComponentConnector or a new ComponentConnector * of the given type */ @@ -3202,15 +3203,15 @@ public class ApplicationConnection implements HasHandlers { /** * Creates a new ServerConnector with the given type and id. - * + * * Creates and registers a new ServerConnector of the given type. Should * never be called with the connector id of an existing connector. - * + * * @param connectorId * Id of the new connector * @param connectorType * Type of the connector, as passed from the server side - * + * * @return A new ServerConnector of the given type */ private ServerConnector createAndRegisterConnector(String connectorId, @@ -3230,7 +3231,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets a recource that has been pre-loaded via UIDL, such as custom * layouts. - * + * * @param name * identifier of the resource to get * @return the resource @@ -3241,7 +3242,7 @@ public class ApplicationConnection implements HasHandlers { /** * Singleton method to get instance of app's context menu. - * + * * @return VContextMenu object */ public VContextMenu getContextMenu() { @@ -3256,7 +3257,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets an {@link Icon} instance corresponding to a URI. - * + * * @since 7.2 * @param uri * @return Icon object @@ -3278,7 +3279,7 @@ public class ApplicationConnection implements HasHandlers { * Translates custom protocols in UIDL URI's to be recognizable by browser. * All uri's from UIDL should be routed via this method before giving them * to browser due URI's in UIDL may contain custom protocols like theme://. - * + * * @param uidlUri * Vaadin URI from uidl * @return translated URI ready for browser @@ -3290,7 +3291,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the URI for the current theme. Can be used to reference theme * resources. - * + * * @return URI to the current theme */ public String getThemeUri() { @@ -3301,7 +3302,7 @@ public class ApplicationConnection implements HasHandlers { /** * Listens for Notification hide event, and redirects. Used for system * messages, such as session expired. - * + * */ private class NotificationRedirect implements VNotification.EventListener { String url; @@ -3330,7 +3331,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the token (aka double submit cookie) that the server uses to protect * against Cross Site Request Forgery attacks. - * + * * @return the CSRF token string */ public String getCsrfToken() { @@ -3340,7 +3341,7 @@ public class ApplicationConnection implements HasHandlers { /** * Use to notify that the given component's caption has changed; layouts may * have to be recalculated. - * + * * @param component * the Paintable whose caption has changed * @deprecated As of 7.0.2, has not had any effect for a long time @@ -3352,7 +3353,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the main view - * + * * @return the main view */ public UIConnector getUIConnector() { @@ -3361,7 +3362,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the {@link ApplicationConfiguration} for the current application. - * + * * @see ApplicationConfiguration * @return the configuration for this application */ @@ -3374,7 +3375,7 @@ public class ApplicationConnection implements HasHandlers { * list of events which has server side listeners is updated automatically * before the component is updated so the value is correct if called from * updatedFromUIDL. - * + * * @param paintable * The connector to register event listeners for * @param eventIdentifier @@ -3394,7 +3395,7 @@ public class ApplicationConnection implements HasHandlers { /** * Adds the get parameters to the uri and returns the new uri that contains * the parameters. - * + * * @param uri * The uri to which the parameters should be added. * @param extraParams @@ -3424,7 +3425,7 @@ public class ApplicationConnection implements HasHandlers { /** * Get VTooltip instance related to application connection - * + * * @return VTooltip instance */ public VTooltip getVTooltip() { @@ -3436,7 +3437,7 @@ public class ApplicationConnection implements HasHandlers { * this method is now handled by the state change event handler in * AbstractComponentConnector. The only function this method has is to * return true if the UIDL is a "cached" update. - * + * * @param component * @param uidl * @param manageCaption @@ -3487,7 +3488,7 @@ public class ApplicationConnection implements HasHandlers { * Schedules a heartbeat request to occur after the configured heartbeat * interval elapses if the interval is a positive number. Otherwise, does * nothing. - * + * * @deprecated as of 7.2, use {@link Heartbeat#schedule()} instead */ @Deprecated @@ -3501,7 +3502,7 @@ public class ApplicationConnection implements HasHandlers { * Heartbeat requests are used to inform the server that the client-side is * still alive. If the client page is closed or the connection lost, the * server will eventually close the inactive UI. - * + * * @deprecated as of 7.2, use {@link Heartbeat#send()} instead */ @Deprecated @@ -3525,7 +3526,7 @@ public class ApplicationConnection implements HasHandlers { /** * This method can be used to postpone rendering of a response for a short * period of time (e.g. to avoid the rendering process during animation). - * + * * @param lock */ public void suspendReponseHandling(Object lock) { @@ -3534,7 +3535,7 @@ public class ApplicationConnection implements HasHandlers { /** * Resumes the rendering process once all locks have been removed. - * + * * @param lock */ public void resumeResponseHandling(Object lock) { @@ -3585,7 +3586,7 @@ public class ApplicationConnection implements HasHandlers { /** * Sets the delegate that is called whenever a communication error occurrs. - * + * * @param delegate * the delegate. */ @@ -3628,7 +3629,7 @@ public class ApplicationConnection implements HasHandlers { /** * Gets the active connector for focused element in browser. - * + * * @return Connector for focused element or null. */ private ComponentConnector getActiveConnector() { @@ -3642,7 +3643,7 @@ public class ApplicationConnection implements HasHandlers { /** * Sets the status for the push connection. - * + * * @param enabled * true to enable the push connection; * false to disable the push connection. @@ -3655,7 +3656,7 @@ public class ApplicationConnection implements HasHandlers { push.init(this, pushState, new CommunicationErrorHandler() { @Override public boolean onError(String details, int statusCode) { - handleCommunicationError(details,statusCode); + handleCommunicationError(details, statusCode); return true; } }); @@ -3692,7 +3693,7 @@ public class ApplicationConnection implements HasHandlers { /** * Returns a human readable string representation of the method used to * communicate with the server. - * + * * @since 7.1 * @return A string representation of the current transport type */ diff --git a/client/src/com/vaadin/client/DeferredWorker.java b/client/src/com/vaadin/client/DeferredWorker.java index 8e78bd9bff..cc22cda2a2 100644 --- a/client/src/com/vaadin/client/DeferredWorker.java +++ b/client/src/com/vaadin/client/DeferredWorker.java @@ -16,18 +16,18 @@ package com.vaadin.client; /** - * Give widgets the possibility to indicate to the framework that there is work - * scheduled to be executed in the near future and that the framework should - * wait for this work to complete before assuming the UI has reached a steady - * state. + * Give widgets and connectors the possibility to indicate to the framework that + * there is work scheduled to be executed in the near future and that the + * framework should wait for this work to complete before assuming the UI has + * reached a steady state. * * @since 7.3 * @author Vaadin Ltd */ public interface DeferredWorker { /** - * Checks whether there are operations pending for this widget that must be - * executed before reaching a steady state. + * Checks whether there are operations pending for this widget or connector + * that must be executed before reaching a steady state. * * @returns true iff there are operations pending which must be * executed before reaching a steady state -- cgit v1.2.3