]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove AbstractComponent.immediate
authorPekka Hyvönen <pekka@vaadin.com>
Fri, 7 Oct 2016 13:06:01 +0000 (16:06 +0300)
committerVaadin Code Review <review@vaadin.com>
Thu, 13 Oct 2016 06:41:15 +0000 (06:41 +0000)
All components are now in immediate mode by default.
V7 compatibility components will use AbstractLegacyComponent that has immediate.
V7 ColorPickerPopup will not have setImmediate, since it extends V8 Window,
which is not in V7 compatibility packages.
Removed OutOfSync and ResynchronizeAfterAsyncRemoval Tests,
since those tested UI in not immediate mode, which is invalid now.
Removed WindowResizeListener, LazyWindowResize, test UIs,
since both used immediate and there were no test run for either.

Change-Id: Ie1c8cfa4c48461db944ff9b13efe8473c5a3298f

151 files changed:
client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java
client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java
client/src/main/java/com/vaadin/client/ui/VCheckBox.java
client/src/main/java/com/vaadin/client/ui/VDateField.java
client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java
client/src/main/java/com/vaadin/client/ui/VSlider.java
client/src/main/java/com/vaadin/client/ui/VTextualDate.java
client/src/main/java/com/vaadin/client/ui/VUI.java
client/src/main/java/com/vaadin/client/ui/VWindow.java
client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java
client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java
client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java
client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java
client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java
client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractFieldConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCheckBox.java [new file with mode: 0644]
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractLegacyComponent.java [new file with mode: 0644]
compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java
compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java
compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java
compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentDeclarativeTest.java [new file with mode: 0644]
compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentTest.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractLegacyComponentState.java [new file with mode: 0644]
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGradientState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGridState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/upload/UploadState.java
server/src/main/java/com/vaadin/server/DragAndDropService.java
server/src/main/java/com/vaadin/server/VariableOwner.java
server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
server/src/main/java/com/vaadin/ui/AbstractComponent.java
server/src/main/java/com/vaadin/ui/Component.java
server/src/main/java/com/vaadin/ui/TabSheet.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentTest.java [deleted file]
shared/src/main/java/com/vaadin/shared/AbstractComponentState.java
uitest/src/main/java/com/vaadin/tests/TestDateField.java
uitest/src/main/java/com/vaadin/tests/TestForWindowing.java
uitest/src/main/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemoval.java [deleted file]
uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java
uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java
uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java
uitest/src/main/java/com/vaadin/tests/components/OutOfSync.java [deleted file]
uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java
uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/EnableState.java
uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java
uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
uitest/src/main/java/com/vaadin/tests/components/button/ButtonUpdateAltText.java
uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarTest.java
uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java [deleted file]
uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxResetValue.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java
uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java
uitest/src/main/java/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java
uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldChangeResolution.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldIsValid.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRanges.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java
uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldRanges.java
uitest/src/main/java/com/vaadin/tests/components/datefield/LenientMode.java
uitest/src/main/java/com/vaadin/tests/components/datefield/LowResolution.java
uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java
uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java
uitest/src/main/java/com/vaadin/tests/components/formlayout/NestedFormLayouts.java
uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutExpandRatio.java
uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java
uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java
uitest/src/main/java/com/vaadin/tests/components/media/AudioTest.java
uitest/src/main/java/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java
uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
uitest/src/main/java/com/vaadin/tests/components/orderedlayout/VerticalLayoutWithEmptyLabel.java
uitest/src/main/java/com/vaadin/tests/components/panel/BasicPanelTest.java
uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java
uitest/src/main/java/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java
uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
uitest/src/main/java/com/vaadin/tests/components/table/AddItemToEmptyTable.java
uitest/src/main/java/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
uitest/src/main/java/com/vaadin/tests/components/table/DoublesInTable.java
uitest/src/main/java/com/vaadin/tests/components/table/EditableTableLeak.java
uitest/src/main/java/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java
uitest/src/main/java/com/vaadin/tests/components/table/Footer.java
uitest/src/main/java/com/vaadin/tests/components/table/FooterClick.java
uitest/src/main/java/com/vaadin/tests/components/table/HeaderClick.java
uitest/src/main/java/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
uitest/src/main/java/com/vaadin/tests/components/table/HeaderPositionWhenSorting.java
uitest/src/main/java/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
uitest/src/main/java/com/vaadin/tests/components/table/ItemClickEvents.java
uitest/src/main/java/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java
uitest/src/main/java/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
uitest/src/main/java/com/vaadin/tests/components/table/TableItemDescriptionGeneratorUI.java
uitest/src/main/java/com/vaadin/tests/components/table/TableScrollOnFocus.java
uitest/src/main/java/com/vaadin/tests/components/table/TableUndefinedSize.java
uitest/src/main/java/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java
uitest/src/main/java/com/vaadin/tests/components/table/ValueAfterClearingContainer.java
uitest/src/main/java/com/vaadin/tests/components/textarea/Wordwrap.java
uitest/src/main/java/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
uitest/src/main/java/com/vaadin/tests/components/textfield/SetTabIndex.java
uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
uitest/src/main/java/com/vaadin/tests/components/tree/TreeConnectors.java
uitest/src/main/java/com/vaadin/tests/components/tree/TreeFiltering.java
uitest/src/main/java/com/vaadin/tests/components/ui/IdOverrideTest.java
uitest/src/main/java/com/vaadin/tests/components/window/LazyWindowResize.java [deleted file]
uitest/src/main/java/com/vaadin/tests/components/window/WindowResizeListener.java [deleted file]
uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
uitest/src/main/java/com/vaadin/tests/dd/TreeDragStart.java
uitest/src/main/java/com/vaadin/tests/integration/EmbedSizeTest.java
uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayouts.java
uitest/src/main/java/com/vaadin/tests/layouts/CaptionsInLayoutsWaiAria.java
uitest/src/main/java/com/vaadin/tests/layouts/CssLayoutCustomCss.java
uitest/src/main/java/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
uitest/src/main/java/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java
uitest/src/main/java/com/vaadin/tests/push/TogglePush.java
uitest/src/main/java/com/vaadin/tests/themes/ButtonsTest.java
uitest/src/main/java/com/vaadin/tests/themes/valo/CalendarTest.java
uitest/src/main/java/com/vaadin/tests/themes/valo/Tabsheets.java
uitest/src/main/java/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/v7/grid/GridClientColumnRendererConnector.java
uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridCheckBoxDisplay.java
uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridDetailsLocation.java
uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridFastAsyncUpdate.java
uitest/src/test/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemovalTest.java [deleted file]
uitest/src/test/java/com/vaadin/tests/components/OutOfSyncTest.java [deleted file]
uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java [deleted file]

index ce07fc0baf9c53b87f402dc88aa5cbb048bee08b..250d9c53faf804de9c2f257e0f5d08a1de392291 100644 (file)
@@ -103,12 +103,6 @@ public class ServerRpcQueue {
      *
      * @param invocation
      *            RPC method invocation
-     * @param delayed
-     *            <code>false</code> to trigger sending within a short time
-     *            window (possibly combining subsequent calls to a single
-     *            request), <code>true</code> to let the framework delay sending
-     *            of RPC calls and variable changes until the next non-delayed
-     *            change
      * @param lastOnly
      *            <code>true</code> to remove all previously delayed invocations
      *            of the same method that were also enqueued with lastonly set
index 837b185f3532726ba4c7ddfef2e0202f086c26f0..5f75869ba4fd9ed4ead2ffae572a76d6df2aa896 100644 (file)
@@ -96,9 +96,6 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
     /** For internal use only. May be removed or replaced in the future. */
     public ApplicationConnection client;
 
-    /** For internal use only. May be removed or replaced in the future. */
-    public boolean immediate;
-
     /**
      * The current position of the split handle in either percentages or pixels
      * <p>
@@ -406,8 +403,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         int pixelPosition = DOM.getElementPropertyInt(splitter, "offsetTop");
 
         // reposition splitter in case it is out of box
-        if ((pixelPosition > 0 && pixelPosition + getSplitterSize() > wholeSize)
-                || (positionReversed && pixelPosition < 0)) {
+        if (pixelPosition > 0 && pixelPosition + getSplitterSize() > wholeSize
+                || positionReversed && pixelPosition < 0) {
             pixelPosition = wholeSize - getSplitterSize();
             if (pixelPosition < 0) {
                 pixelPosition = 0;
@@ -418,8 +415,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         }
 
         firstContainer.getStyle().setHeight(pixelPosition, Unit.PX);
-        int secondContainerHeight = (wholeSize - pixelPosition
-                - getSplitterSize());
+        int secondContainerHeight = wholeSize - pixelPosition
+                - getSplitterSize();
         if (secondContainerHeight < 0) {
             secondContainerHeight = 0;
         }
@@ -456,8 +453,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         int pixelPosition = DOM.getElementPropertyInt(splitter, "offsetLeft");
 
         // reposition splitter in case it is out of box
-        if ((pixelPosition > 0 && pixelPosition + getSplitterSize() > wholeSize)
-                || (positionReversed && pixelPosition < 0)) {
+        if (pixelPosition > 0 && pixelPosition + getSplitterSize() > wholeSize
+                || positionReversed && pixelPosition < 0) {
             pixelPosition = wholeSize - getSplitterSize();
             if (pixelPosition < 0) {
                 pixelPosition = 0;
@@ -468,8 +465,8 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         }
 
         firstContainer.getStyle().setWidth(pixelPosition, Unit.PX);
-        int secondContainerWidth = (wholeSize - pixelPosition
-                - getSplitterSize());
+        int secondContainerWidth = wholeSize - pixelPosition
+                - getSplitterSize();
         if (secondContainerWidth < 0) {
             secondContainerWidth = 0;
         }
@@ -667,7 +664,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         } else {
             // Reversed position
             if (positionReversed) {
-                position = (getOffsetWidth() - newX - getSplitterSize()) + "px";
+                position = getOffsetWidth() - newX - getSplitterSize() + "px";
             } else {
                 position = newX + "px";
             }
@@ -700,8 +697,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
         } else {
             // Reversed position
             if (positionReversed) {
-                position = (getOffsetHeight() - newY - getSplitterSize())
-                        + "px";
+                position = getOffsetHeight() - newY - getSplitterSize() + "px";
             } else {
                 position = newY + "px";
             }
@@ -789,7 +785,7 @@ public abstract class VAbstractSplitPanel extends ComplexPanel {
      * @return true if the browser requires a dragging curtain
      */
     private boolean isDraggingCurtainRequired() {
-        return (BrowserInfo.get().isGecko() || BrowserInfo.get().isWebkit());
+        return BrowserInfo.get().isGecko() || BrowserInfo.get().isWebkit();
     }
 
     /**
index 7f066e2a93227f72c7bb2a1a9c809565e68739ce..02dcfd72713046c956b1e563471192ab28c5a888 100644 (file)
@@ -37,9 +37,6 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox
     /** For internal use only. May be removed or replaced in the future. */
     public String id;
 
-    /** For internal use only. May be removed or replaced in the future. */
-    public boolean immediate;
-
     /** For internal use only. May be removed or replaced in the future. */
     public ApplicationConnection client;
 
@@ -54,8 +51,7 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox
 
         Element el = DOM.getFirstChild(getElement());
         while (el != null) {
-            DOM.sinkEvents(el,
-                    (DOM.getEventsSunk(el) | VTooltip.TOOLTIP_EVENTS));
+            DOM.sinkEvents(el, DOM.getEventsSunk(el) | VTooltip.TOOLTIP_EVENTS);
             el = DOM.getNextSibling(el);
         }
 
@@ -73,8 +69,8 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox
 
     @Override
     public void onBrowserEvent(Event event) {
-        if (icon != null && (event.getTypeInt() == Event.ONCLICK)
-                && (DOM.eventGetTarget(event) == icon.getElement())) {
+        if (icon != null && event.getTypeInt() == Event.ONCLICK
+                && DOM.eventGetTarget(event) == icon.getElement()) {
             // Click on icon should do nothing if widget is disabled
             if (isEnabled()) {
                 setValue(!getValue());
index ef7a131a7747bae93fbc75f3c4635ee75afd78d8..2f8c72081ee6d96440d044c128b83a846eba2b40 100644 (file)
@@ -34,9 +34,6 @@ public class VDateField extends FlowPanel implements Field, HasEnabled {
     /** For internal use only. May be removed or replaced in the future. */
     public ApplicationConnection client;
 
-    /** For internal use only. May be removed or replaced in the future. */
-    public boolean immediate;
-
     /** For internal use only. May be removed or replaced in the future. */
     public static String resolutionToString(Resolution res) {
         if (res == Resolution.DAY) {
@@ -113,14 +110,6 @@ public class VDateField extends FlowPanel implements Field, HasEnabled {
         this.date = date;
     }
 
-    public boolean isImmediate() {
-        return immediate;
-    }
-
-    public void setImmediate(boolean immediate) {
-        this.immediate = immediate;
-    }
-
     public boolean isReadonly() {
         return readonly;
     }
index d09de9a77105c483a927c1d19f702bc541aae672..18d896e4871e2e682ceb00187f9cc298c07747e4 100644 (file)
@@ -86,9 +86,7 @@ public class VDateFieldCalendar extends VDateField {
                             false);
                 }
             }
-            if (isImmediate()) {
-                getClient().sendPendingVariableChanges();
-            }
+            getClient().sendPendingVariableChanges();
         }
     }
 
index 920ffec832ea9da50601a9a396a419a585be49e7..bc0f53965790d1806f75de3ac3305cc9344cec87 100644 (file)
@@ -52,7 +52,6 @@ public class VSlider extends SimpleFocusablePanel
 
     protected String id;
 
-    protected boolean immediate;
     protected boolean disabled;
     protected boolean readonly;
 
@@ -214,7 +213,7 @@ public class VSlider extends SimpleFocusablePanel
                     @Override
                     public void execute() {
                         final Element p = getElement();
-                        if (p.getPropertyInt(domProperty) > (MIN_SIZE + 5)
+                        if (p.getPropertyInt(domProperty) > MIN_SIZE + 5
                                 || propertyNotNullOrEmpty(styleAttribute, p)) {
                             if (isVertical()) {
                                 setHeight();
@@ -283,10 +282,10 @@ public class VSlider extends SimpleFocusablePanel
             increaseValue(true);
         } else if (DOM.eventGetType(event) == Event.MOUSEEVENTS) {
             processBaseEvent(event);
-        } else if ((BrowserInfo.get().isGecko()
-                && DOM.eventGetType(event) == Event.ONKEYPRESS)
-                || (!BrowserInfo.get().isGecko()
-                        && DOM.eventGetType(event) == Event.ONKEYDOWN)) {
+        } else if (BrowserInfo.get().isGecko()
+                && DOM.eventGetType(event) == Event.ONKEYPRESS
+                || !BrowserInfo.get().isGecko()
+                        && DOM.eventGetType(event) == Event.ONKEYDOWN) {
 
             if (handleNavigation(event.getKeyCode(), event.getCtrlKey(),
                     event.getShiftKey())) {
@@ -406,10 +405,10 @@ public class VSlider extends SimpleFocusablePanel
         }
 
         if (isVertical()) {
-            v = ((baseSize - (coord - baseOffset))
-                    / (double) (baseSize - handleSize)) * (max - min) + min;
+            v = (baseSize - (coord - baseOffset))
+                    / (double) (baseSize - handleSize) * (max - min) + min;
         } else {
-            v = ((coord - baseOffset) / (double) (baseSize - handleSize))
+            v = (coord - baseOffset) / (double) (baseSize - handleSize)
                     * (max - min) + min;
         }
 
@@ -475,8 +474,8 @@ public class VSlider extends SimpleFocusablePanel
             return false;
         }
 
-        if ((keycode == getNavigationUpKey() && isVertical())
-                || (keycode == getNavigationRightKey() && !isVertical())) {
+        if (keycode == getNavigationUpKey() && isVertical()
+                || keycode == getNavigationRightKey() && !isVertical()) {
             if (shift) {
                 for (int a = 0; a < acceleration; a++) {
                     increaseValue(false);
@@ -487,7 +486,7 @@ public class VSlider extends SimpleFocusablePanel
             }
             return true;
         } else if (keycode == getNavigationDownKey() && isVertical()
-                || (keycode == getNavigationLeftKey() && !isVertical())) {
+                || keycode == getNavigationLeftKey() && !isVertical()) {
             if (shift) {
                 for (int a = 0; a < acceleration; a++) {
                     decreaseValue(false);
@@ -554,10 +553,6 @@ public class VSlider extends SimpleFocusablePanel
         this.id = id;
     }
 
-    public void setImmediate(boolean immediate) {
-        this.immediate = immediate;
-    }
-
     public void setDisabled(boolean disabled) {
         this.disabled = disabled;
     }
@@ -614,7 +609,7 @@ public class VSlider extends SimpleFocusablePanel
                 : "offsetWidth";
         final int handleSize = handle.getPropertyInt(domProperty);
         final int baseSize = base.getPropertyInt(domProperty)
-                - (2 * BASE_BORDER_WIDTH);
+                - 2 * BASE_BORDER_WIDTH;
 
         final int range = baseSize - handleSize;
         double v = value.doubleValue();
index 95776981940aa0c757481a5874a29f95cbafb5de..7b83a5622dee4e1b3df1eaf13801accf0cb2d016 100644 (file)
@@ -258,16 +258,16 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler,
         Date currentDate = getDate();
         getClient().updateVariable(getId(), "year",
                 currentDate != null ? currentDate.getYear() + 1900 : -1,
-                currentResolution == Resolution.YEAR && immediate);
+                currentResolution == Resolution.YEAR);
         if (currentResolution.compareTo(Resolution.MONTH) <= 0) {
             getClient().updateVariable(getId(), "month",
                     currentDate != null ? currentDate.getMonth() + 1 : -1,
-                    currentResolution == Resolution.MONTH && immediate);
+                    currentResolution == Resolution.MONTH);
         }
         if (currentResolution.compareTo(Resolution.DAY) <= 0) {
             getClient().updateVariable(getId(), "day",
                     currentDate != null ? currentDate.getDate() : -1,
-                    currentResolution == Resolution.DAY && immediate);
+                    currentResolution == Resolution.DAY);
         }
     }
 
index 585631a6b65bef21e21ffa537e853d4bc4ff5ee4..ad4077d3961e2896457cfa637355d33cc8ff686a 100644 (file)
@@ -96,9 +96,6 @@ public class VUI extends SimplePanel implements ResizeHandler,
     /** stored height of parent for embedded application auto-resize */
     private int parentHeight;
 
-    /** For internal use only. May be removed or replaced in the future. */
-    public boolean immediate;
-
     /** For internal use only. May be removed or replaced in the future. */
     public boolean resizeLazy = false;
 
index e9767a6baca43744f8bec8455d7d030d11916b5f..8f1292ca1d9baabdc29c94a5687e3f0cdc58dc53 100644 (file)
@@ -188,9 +188,6 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
      */
     public boolean centered = false;
 
-    /** For internal use only. May be removed or replaced in the future. */
-    public boolean immediate;
-
     private Element wrapper;
 
     /** For internal use only. May be removed or replaced in the future. */
@@ -548,7 +545,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
 
     private static void focusTopmostModalWindow() {
         VWindow topmost = getTopmostWindow();
-        if ((topmost != null) && (topmost.vaadinModality)) {
+        if (topmost != null && topmost.vaadinModality) {
             topmost.focus();
         }
     }
@@ -1109,7 +1106,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
         if (updateVariables) {
             // sending width back always as pixels, no need for unit
             client.updateVariable(id, "width", w, false);
-            client.updateVariable(id, "height", h, immediate);
+            client.updateVariable(id, "height", h, true);
         }
 
         if (updateVariables || !resizeLazy) {
index 3c36ffd4fe85698fa41652d4cb13eede4ef37208..cf39e5ee212a664dcded7dd5f67c701d99e58dfe 100644 (file)
@@ -109,7 +109,6 @@ public class CheckBoxConnector extends AbstractFieldConnector
         VCaption.setCaptionText(getWidget(), getState());
 
         getWidget().setValue(getState().checked);
-        getWidget().immediate = getState().immediate;
     }
 
     @Override
@@ -140,9 +139,7 @@ public class CheckBoxConnector extends AbstractFieldConnector
                             getWidget().getElement());
             getRpcProxy(CheckBoxServerRpc.class).setChecked(getState().checked,
                     details);
-            if (getState().immediate) {
-                getConnection().sendPendingVariableChanges();
-            }
+            getConnection().sendPendingVariableChanges();
         }
     }
 
index 9d9bdb4d7a71abbf31d0b549f656b55745ea848c..5e0fe7cc2e380b4be37d475d0ddbfc092025c305 100644 (file)
@@ -38,7 +38,6 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector
         // Save details
         getWidget().client = client;
         getWidget().paintableId = uidl.getId();
-        getWidget().immediate = getState().immediate;
 
         getWidget().setReadonly(isReadOnly());
         getWidget().setEnabled(isEnabled());
index c5972c9f61caec853c8c3c9e75363f39ef69023c..71612831764b619f34b300d01f86ecab292bca25 100644 (file)
@@ -56,9 +56,7 @@ public class DateFieldConnector extends TextualDateConnector {
                  * a day/enter/clicking outside of popup) then the new value is
                  * communicated to the server.
                  */
-                if (getWidget().isImmediate()) {
-                    getConnection().getServerRpcQueue().flush();
-                }
+                getConnection().getServerRpcQueue().flush();
             }
         });
     }
index 79888479958715e107c4db333ea1cc3d0fc0632f..a77870ec2fdf329c7d760780e6a42f9bee79915e 100644 (file)
@@ -81,7 +81,6 @@ public class SliderConnector extends AbstractFieldConnector
         super.onStateChanged(stateChangeEvent);
 
         getWidget().setId(getConnectorId());
-        getWidget().setImmediate(getState().immediate);
         getWidget().setDisabled(!isEnabled());
         getWidget().setReadOnly(isReadOnly());
         getWidget().setOrientation(getState().orientation);
index ec6b86880bb69ca6323f2942334d1b3d69e8058f..86cf5adf98ab1b50918d02da004b95d34a7ea63b 100644 (file)
@@ -124,8 +124,6 @@ public abstract class AbstractSplitPanelConnector extends
     public void onStateChanged(StateChangeEvent stateChangeEvent) {
         super.onStateChanged(stateChangeEvent);
 
-        getWidget().immediate = getState().immediate;
-
         getWidget().setEnabled(isEnabled());
 
         clickEventHandler.handleEventHandlerRegistration();
index 26f99bfb94da0cfb517378c8c14e203f01183593..3770c28446815a6b017915331216eb1d528c01fe 100644 (file)
@@ -175,9 +175,7 @@ public class UIConnector extends AbstractSingleComponentContainerConnector
                 getRpcProxy(UIServerRpc.class).resize(event.getHeight(),
                         event.getWidth(), Window.getClientWidth(),
                         Window.getClientHeight());
-                if (getState().immediate || getPageState().hasResizeListeners) {
-                    getConnection().getServerRpcQueue().flush();
-                }
+                getConnection().getServerRpcQueue().flush();
             }
         });
         getWidget().addScrollHandler(new ScrollHandler() {
@@ -211,7 +209,6 @@ public class UIConnector extends AbstractSingleComponentContainerConnector
         boolean firstPaint = getWidget().connection == null;
         getWidget().connection = client;
 
-        getWidget().immediate = getState().immediate;
         getWidget().resizeLazy = uidl.hasAttribute(UIConstants.RESIZE_LAZY);
         // this also implicitly removes old styles
         String styles = "";
index 7d9094e583a4ce3d1c64c7ab953053ab840a4ef1..eed89f090c457882feba188b216130b1c7055e07 100644 (file)
@@ -218,7 +218,7 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector
         }
 
         ComponentConnector content = getContent();
-        boolean hasContent = (content != null);
+        boolean hasContent = content != null;
         Element contentElement = window.contentPanel.getElement();
 
         Style contentStyle = window.contents.getStyle();
@@ -388,8 +388,6 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector
 
         clickEventHandler.handleEventHandlerRegistration();
 
-        window.immediate = state.immediate;
-
         window.setClosable(!isReadOnly());
         // initialize position from state
         updateWindowPosition();
index 36d8f17d004ab7fdb166707631be5ccd1f5d53e8..7f96e63d0a120ca858861c0a7a92b1d22b459b59 100644 (file)
  */
 package com.vaadin.v7.client.ui;
 
+import com.google.gwt.user.client.ui.Focusable;
 import com.vaadin.client.StyleConstants;
-import com.vaadin.client.ui.AbstractComponentConnector;
+import com.vaadin.client.annotations.OnStateChange;
 import com.vaadin.client.ui.HasErrorIndicator;
 import com.vaadin.client.ui.HasRequiredIndicator;
 import com.vaadin.v7.shared.AbstractFieldState;
 
 @Deprecated
-public abstract class AbstractFieldConnector extends AbstractComponentConnector
+public abstract class AbstractFieldConnector
+        extends AbstractLegacyComponentConnector
         implements HasRequiredIndicator, HasErrorIndicator {
 
     @Override
@@ -71,4 +73,14 @@ public abstract class AbstractFieldConnector extends AbstractComponentConnector
         getWidget().setStyleName(StyleConstants.REQUIRED,
                 isRequiredIndicatorVisible());
     }
+
+    @OnStateChange("tabIndex")
+    void updateTabIndex() {
+        // AbstractFieldState is not inheriting TabIndexState because of
+        // AbstractLegacyComponentState, thus need to set tab index here
+        // (instead of AbstractComponentConnector)
+        if (getWidget() instanceof Focusable) {
+            ((Focusable) getWidget()).setTabIndex(getState().tabIndex);
+        }
+    }
 }
index a9fe473ad4df5ffb7a8acfd8540a5f65ed9257ee..5e27f26282bf7cce025e6be51a5c9885627db433 100644 (file)
@@ -18,6 +18,7 @@ package com.vaadin.v7.client.ui;
 import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.client.ui.AbstractConnector;
 import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * Legacy connector for Vaadin 7 compatibility connectors. Needed because
@@ -26,7 +27,9 @@ import com.vaadin.shared.communication.ServerRpc;
  *
  * @author Vaadin Ltd
  * @since 8.0
+ * @deprecated only used for Vaadin 7 compatiblity components
  */
+@Deprecated
 public class AbstractLegacyComponentConnector
         extends AbstractComponentConnector {
 
@@ -36,4 +39,9 @@ public class AbstractLegacyComponentConnector
     protected <T extends ServerRpc> T getRpcProxy(Class<T> rpcInterface) {
         return super.getRpcProxy(rpcInterface);
     }
+
+    @Override
+    public AbstractLegacyComponentState getState() {
+        return (AbstractLegacyComponentState) super.getState();
+    }
 }
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCheckBox.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCheckBox.java
new file mode 100644 (file)
index 0000000..60a0d06
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.v7.client.ui;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.vaadin.client.ApplicationConnection;
+import com.vaadin.client.BrowserInfo;
+import com.vaadin.client.Util;
+import com.vaadin.client.VTooltip;
+import com.vaadin.client.ui.Field;
+import com.vaadin.client.ui.Icon;
+import com.vaadin.client.ui.aria.AriaHelper;
+import com.vaadin.client.ui.aria.HandlesAriaInvalid;
+import com.vaadin.client.ui.aria.HandlesAriaRequired;
+
+public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox
+        implements Field, HandlesAriaInvalid, HandlesAriaRequired {
+
+    public static final String CLASSNAME = "v-checkbox";
+
+    /** For internal use only. May be removed or replaced in the future. */
+    public String id;
+
+    /** For internal use only. May be removed or replaced in the future. */
+    public boolean immediate;
+
+    /** For internal use only. May be removed or replaced in the future. */
+    public ApplicationConnection client;
+
+    /** For internal use only. May be removed or replaced in the future. */
+    public Element errorIndicatorElement;
+
+    /** For internal use only. May be removed or replaced in the future. */
+    public Icon icon;
+
+    public VCheckBox() {
+        setStyleName(CLASSNAME);
+
+        Element el = DOM.getFirstChild(getElement());
+        while (el != null) {
+            DOM.sinkEvents(el, DOM.getEventsSunk(el) | VTooltip.TOOLTIP_EVENTS);
+            el = DOM.getNextSibling(el);
+        }
+
+        if (BrowserInfo.get().isWebkit()) {
+            // Webkit does not focus non-text input elements on click
+            // (#11854)
+            addClickHandler(new ClickHandler() {
+                @Override
+                public void onClick(ClickEvent event) {
+                    setFocus(true);
+                }
+            });
+        }
+    }
+
+    @Override
+    public void onBrowserEvent(Event event) {
+        if (icon != null && event.getTypeInt() == Event.ONCLICK
+                && DOM.eventGetTarget(event) == icon.getElement()) {
+            // Click on icon should do nothing if widget is disabled
+            if (isEnabled()) {
+                setValue(!getValue());
+            }
+        }
+        super.onBrowserEvent(event);
+        if (event.getTypeInt() == Event.ONLOAD) {
+            Util.notifyParentOfSizeChange(this, true);
+        }
+    }
+
+    /**
+     * Gives access to the input element.
+     *
+     * @return Element of the CheckBox itself
+     */
+    private Element getCheckBoxElement() {
+        // FIXME: Would love to use a better way to access the checkbox element
+        return getElement().getFirstChildElement();
+    }
+
+    @Override
+    public void setAriaRequired(boolean required) {
+        AriaHelper.handleInputRequired(getCheckBoxElement(), required);
+    }
+
+    @Override
+    public void setAriaInvalid(boolean invalid) {
+        AriaHelper.handleInputInvalid(getCheckBoxElement(), invalid);
+    }
+}
index 62e8e123db3eb9deac36a08b980c266e2a2f30b1..0e50bd639d488dd59ff5a0b92bc2c570d58c9985 100644 (file)
@@ -39,12 +39,12 @@ import com.vaadin.client.VConsole;
 import com.vaadin.client.WidgetUtil;
 import com.vaadin.client.communication.RpcProxy;
 import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.client.ui.Action;
 import com.vaadin.client.ui.ActionOwner;
 import com.vaadin.client.ui.SimpleManagedLayout;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.client.ui.VCalendar;
 import com.vaadin.v7.client.ui.VCalendar.BackwardListener;
 import com.vaadin.v7.client.ui.VCalendar.DateClickListener;
@@ -82,14 +82,14 @@ import com.vaadin.v7.ui.Calendar;
  * @author Vaadin Ltd.
  */
 @Connect(value = Calendar.class, loadStyle = LoadStyle.LAZY)
-public class CalendarConnector extends AbstractComponentConnector
+public class CalendarConnector extends AbstractLegacyComponentConnector
         implements ActionOwner, SimpleManagedLayout, Paintable {
 
     private CalendarServerRpc rpc = RpcProxy.create(CalendarServerRpc.class,
             this);
 
-    private final HashMap<String, String> actionMap = new HashMap<String, String>();
-    private HashMap<Object, String> tooltips = new HashMap<Object, String>();
+    private final HashMap<String, String> actionMap = new HashMap<>();
+    private HashMap<Object, String> tooltips = new HashMap<>();
 
     private static final String DROPHANDLER_ACCEPT_CRITERIA_PAINT_TAG = "-ac";
 
@@ -469,8 +469,8 @@ public class CalendarConnector extends AbstractComponentConnector
     }
 
     private Action[] getActionsBetween(Date start, Date end) {
-        List<Action> actions = new ArrayList<Action>();
-        List<String> ids = new ArrayList<String>();
+        List<Action> actions = new ArrayList<>();
+        List<String> ids = new ArrayList<>();
 
         for (int i = 0; i < actionKeys.size(); i++) {
             String actionKey = actionKeys.get(i);
@@ -525,7 +525,7 @@ public class CalendarConnector extends AbstractComponentConnector
         return actions.toArray(new Action[actions.size()]);
     }
 
-    private List<String> actionKeys = new ArrayList<String>();
+    private List<String> actionKeys = new ArrayList<>();
 
     private void updateActionMap(List<CalendarState.Action> actions) {
         actionMap.clear();
@@ -624,7 +624,7 @@ public class CalendarConnector extends AbstractComponentConnector
      */
     @Override
     public Action[] getActions() {
-        List<Action> actions = new ArrayList<Action>();
+        List<Action> actions = new ArrayList<>();
         for (int i = 0; i < actionKeys.size(); i++) {
             final String actionKey = actionKeys.get(i);
             final VCalendarAction a = new VCalendarAction(this, rpc, actionKey);
@@ -655,7 +655,7 @@ public class CalendarConnector extends AbstractComponentConnector
 
     private List<CalendarEvent> calendarEventListOf(
             List<CalendarState.Event> events, boolean format24h) {
-        List<CalendarEvent> list = new ArrayList<CalendarEvent>(events.size());
+        List<CalendarEvent> list = new ArrayList<>(events.size());
         for (CalendarState.Event event : events) {
             final String dateFrom = event.dateFrom;
             final String dateTo = event.dateTo;
@@ -680,7 +680,7 @@ public class CalendarConnector extends AbstractComponentConnector
     }
 
     private List<CalendarDay> calendarDayListOf(List<CalendarState.Day> days) {
-        List<CalendarDay> list = new ArrayList<CalendarDay>(days.size());
+        List<CalendarDay> list = new ArrayList<>(days.size());
         for (CalendarState.Day day : days) {
             CalendarDay d = new CalendarDay(day.date, day.localizedDateFormat,
                     day.dayOfWeek, day.week, day.yearOfWeek);
index 5d103e419fc8534aaad0cddbb3cbf99ec5ee424d..d2a761ba0abd939bf4140168f535b20070efdb75 100644 (file)
@@ -27,11 +27,11 @@ import com.vaadin.client.annotations.OnStateChange;
 import com.vaadin.client.communication.StateChangeEvent;
 import com.vaadin.client.ui.ConnectorFocusAndBlurHandler;
 import com.vaadin.client.ui.Icon;
-import com.vaadin.client.ui.VCheckBox;
 import com.vaadin.shared.EventId;
 import com.vaadin.shared.MouseEventDetails;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.v7.client.ui.AbstractFieldConnector;
+import com.vaadin.v7.client.ui.VCheckBox;
 import com.vaadin.v7.shared.ui.checkbox.CheckBoxServerRpc;
 import com.vaadin.v7.shared.ui.checkbox.CheckBoxState;
 import com.vaadin.v7.ui.CheckBox;
index aa5e878312771939080c0c1e43b46e16a62814da..bd51cecf5a47a3df729184c06ba72fa46d6d6916 100644 (file)
@@ -18,7 +18,7 @@ package com.vaadin.v7.client.ui.colorpicker;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.AbstractComponentConnector;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.shared.ui.colorpicker.ColorPickerState;
 
 /**
@@ -29,7 +29,7 @@ import com.vaadin.v7.shared.ui.colorpicker.ColorPickerState;
  */
 @Deprecated
 public abstract class AbstractColorPickerConnector
-        extends AbstractComponentConnector implements ClickHandler {
+        extends AbstractLegacyComponentConnector implements ClickHandler {
 
     private static final String DEFAULT_WIDTH_STYLE = "v-default-caption-width";
 
index 014e4b6f04877be8c6c68b41bd65ce116b533708..f71ac4d05e54e95b66b880a7b042d5aefe441e43 100644 (file)
@@ -21,10 +21,10 @@ import com.google.gwt.event.dom.client.MouseUpHandler;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.communication.RpcProxy;
 import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.client.ui.colorpicker.VColorPickerGradient;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGradientServerRpc;
 import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGradientState;
 
@@ -37,8 +37,8 @@ import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGradientState;
  * @since 7.0.0
  */
 @Connect(value = com.vaadin.v7.ui.components.colorpicker.ColorPickerGradient.class, loadStyle = LoadStyle.LAZY)
-public class ColorPickerGradientConnector extends AbstractComponentConnector
-        implements MouseUpHandler {
+public class ColorPickerGradientConnector
+        extends AbstractLegacyComponentConnector implements MouseUpHandler {
 
     private ColorPickerGradientServerRpc rpc = RpcProxy
             .create(ColorPickerGradientServerRpc.class, this);
index 561f28af3a0d41e6ff9d1120ac4dce8bbaa2aaff..8d7c94cb2f710dcd69e36ef247eb46d8e48f5767 100644 (file)
@@ -21,10 +21,10 @@ import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.user.client.ui.Widget;
 import com.vaadin.client.communication.RpcProxy;
 import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.client.ui.colorpicker.VColorPickerGrid;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGridServerRpc;
 import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGridState;
 
@@ -37,7 +37,7 @@ import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGridState;
  * @since 7.0.0
  */
 @Connect(value = com.vaadin.v7.ui.components.colorpicker.ColorPickerGrid.class, loadStyle = LoadStyle.LAZY)
-public class ColorPickerGridConnector extends AbstractComponentConnector
+public class ColorPickerGridConnector extends AbstractLegacyComponentConnector
         implements ClickHandler {
 
     private ColorPickerGridServerRpc rpc = RpcProxy
index 7e37aa5f77f4846bbee26b53d23b1f5be0328899..9ef43775bf3f4b0a17233943ed72a9562beeb4b0 100644 (file)
@@ -20,15 +20,15 @@ import com.google.gwt.dom.client.PreElement;
 import com.vaadin.client.Profiler;
 import com.vaadin.client.WidgetUtil;
 import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.client.ui.VLabel;
 import com.vaadin.v7.shared.ui.label.LabelState;
 import com.vaadin.v7.ui.Label;
 
 @Connect(value = Label.class, loadStyle = LoadStyle.EAGER)
-public class LabelConnector extends AbstractComponentConnector {
+public class LabelConnector extends AbstractLegacyComponentConnector {
 
     @Override
     public LabelState getState() {
index d8d491ff3129e8add6f94f435f2d1a64774dc029..668ffd568af00c57315c959d432d16ede4cb9c16 100644 (file)
@@ -22,7 +22,6 @@ import java.util.Collection;
 import org.jsoup.nodes.Attributes;
 import org.jsoup.nodes.Element;
 
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.UI;
 import com.vaadin.ui.Window.CloseEvent;
 import com.vaadin.ui.Window.CloseListener;
@@ -43,7 +42,7 @@ import com.vaadin.v7.ui.components.colorpicker.ColorSelector;
  * @since 7.0.0
  */
 @Deprecated
-public abstract class AbstractColorPicker extends AbstractComponent
+public abstract class AbstractColorPicker extends AbstractLegacyComponent
         implements CloseListener, ColorSelector {
     private static final Method COLOR_CHANGE_METHOD;
     static {
@@ -478,7 +477,6 @@ public abstract class AbstractColorPicker extends AbstractComponent
                 window.setHistoryVisible(historyVisible);
                 window.setPreviewVisible(textfieldVisible);
 
-                window.setImmediate(true);
                 window.addCloseListener(this);
                 window.addColorChangeListener(new ColorChangeListener() {
                     @Override
@@ -576,7 +574,7 @@ public abstract class AbstractColorPicker extends AbstractComponent
         DesignAttributeHandler.writeAttribute("color", attribute,
                 color.getCSS(), Color.WHITE.getCSS(), String.class);
         DesignAttributeHandler.writeAttribute("popup-style", attribute,
-                (popupStyle == PopupStyle.POPUP_NORMAL ? "normal" : "simple"),
+                popupStyle == PopupStyle.POPUP_NORMAL ? "normal" : "simple",
                 "normal", String.class);
         DesignAttributeHandler.writeAttribute("position", attribute,
                 positionX + "," + positionY, "0,0", String.class);
index 180c1f15b8afb58c06bdd0d631ad444bfc720802..8ac94f659223003d57ba36ad1ad0a8d236056540 100644 (file)
@@ -37,7 +37,6 @@ import com.vaadin.server.AbstractErrorMessage;
 import com.vaadin.server.CompositeErrorMessage;
 import com.vaadin.server.ErrorMessage;
 import com.vaadin.shared.util.SharedUtil;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.declarative.DesignAttributeHandler;
 import com.vaadin.ui.declarative.DesignContext;
@@ -83,7 +82,7 @@ import com.vaadin.v7.shared.AbstractFieldState;
  */
 @SuppressWarnings("serial")
 @Deprecated
-public abstract class AbstractField<T> extends AbstractComponent
+public abstract class AbstractField<T> extends AbstractLegacyComponent
         implements Field<T>, Property.ReadOnlyStatusChangeListener,
         Property.ReadOnlyStatusChangeNotifier, Action.ShortcutNotifier {
 
@@ -211,7 +210,7 @@ public abstract class AbstractField<T> extends AbstractComponent
     @Override
     public boolean isReadOnly() {
         return super.isReadOnly()
-                || (dataSource != null && dataSource.isReadOnly());
+                || dataSource != null && dataSource.isReadOnly();
     }
 
     /**
@@ -253,7 +252,7 @@ public abstract class AbstractField<T> extends AbstractComponent
     public void commit()
             throws Buffered.SourceException, InvalidValueException {
         if (dataSource != null && !dataSource.isReadOnly()) {
-            if ((isInvalidCommitted() || isValid())) {
+            if (isInvalidCommitted() || isValid()) {
                 try {
 
                     // Commits the value to datasource.
@@ -662,7 +661,7 @@ public abstract class AbstractField<T> extends AbstractComponent
 
         // Fires value change if the value has changed
         T value = getInternalValue();
-        if ((value != oldValue) && ((value != null && !value.equals(oldValue))
+        if (value != oldValue && (value != null && !value.equals(oldValue)
                 || value == null)) {
             fireValueChange(false);
         }
@@ -1521,7 +1520,7 @@ public abstract class AbstractField<T> extends AbstractComponent
 
     @Override
     public boolean isEmpty() {
-        return (getFieldValue() == null);
+        return getFieldValue() == null;
     }
 
     @Override
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractLegacyComponent.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractLegacyComponent.java
new file mode 100644 (file)
index 0000000..11ac309
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.v7.ui;
+
+import org.jsoup.nodes.Attributes;
+import org.jsoup.nodes.Element;
+
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.declarative.DesignAttributeHandler;
+import com.vaadin.ui.declarative.DesignContext;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
+
+/**
+ * An abstract base class for compatibility components.
+ * <p>
+ * Used since immediate property has been removed in Vaadin 8 from
+ * {@link AbstractComponent}.
+ *
+ * @author Vaadin Ltd
+ * @since 8.0
+ * @deprecated only used for Vaadin 7 compatiblity components
+ */
+@Deprecated
+public class AbstractLegacyComponent extends AbstractComponent {
+
+    private Boolean explicitImmediateValue;
+
+    /**
+     * Returns the explicitly set immediate value.
+     *
+     * @return the explicitly set immediate value or null if
+     *         {@link #setImmediate(boolean)} has not been explicitly invoked
+     */
+    protected Boolean getExplicitImmediateValue() {
+        return explicitImmediateValue;
+    }
+
+    /**
+     * Returns the immediate mode of the component.
+     * <p>
+     * Since Vaadin 8, the default mode is immediate.
+     *
+     * @return true if the component is in immediate mode (explicitly or
+     *         implicitly set), false if the component if not in immediate mode
+     */
+    public boolean isImmediate() {
+        if (explicitImmediateValue != null) {
+            return explicitImmediateValue;
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * Sets the component's immediate mode to the specified status.
+     * <p>
+     * Since Vaadin 8, the default mode is immediate.
+     *
+     * @param immediate
+     *            the boolean value specifying if the component should be in the
+     *            immediate mode after the call.
+     */
+    public void setImmediate(boolean immediate) {
+        explicitImmediateValue = immediate;
+        getState().immediate = immediate;
+    }
+
+    @Override
+    public void readDesign(Element design, DesignContext designContext) {
+        super.readDesign(design, designContext);
+
+        Attributes attr = design.attributes();
+        // handle immediate
+        if (attr.hasKey("immediate")) {
+            setImmediate(DesignAttributeHandler.getFormatter()
+                    .parse(attr.get("immediate"), Boolean.class));
+        }
+    }
+
+    @Override
+    public void writeDesign(Element design, DesignContext designContext) {
+        super.writeDesign(design, designContext);
+
+        AbstractLegacyComponent def = designContext.getDefaultInstance(this);
+        Attributes attr = design.attributes();
+        // handle immediate
+        if (explicitImmediateValue != null) {
+            DesignAttributeHandler.writeAttribute("immediate", attr,
+                    explicitImmediateValue, def.isImmediate(), Boolean.class);
+        }
+    }
+
+    @Override
+    public void beforeClientResponse(boolean initial) {
+        super.beforeClientResponse(initial);
+        getState().immediate = isImmediate();
+    }
+
+    @Override
+    protected AbstractLegacyComponentState getState() {
+        return (AbstractLegacyComponentState) super.getState();
+    }
+
+    @Override
+    protected AbstractLegacyComponentState getState(boolean markAsDirty) {
+        return (AbstractLegacyComponentState) super.getState(markAsDirty);
+    }
+}
index d8ffd0b1e8442ef75c08e9beb57d3876109f8cfb..da6443da29ca53303dc814c5823c75b3b89bfbf3 100644 (file)
@@ -49,7 +49,6 @@ import com.vaadin.event.dd.TargetDetails;
 import com.vaadin.server.KeyMapper;
 import com.vaadin.server.PaintException;
 import com.vaadin.server.PaintTarget;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.LegacyComponent;
 import com.vaadin.ui.declarative.DesignAttributeHandler;
 import com.vaadin.ui.declarative.DesignContext;
@@ -119,7 +118,7 @@ import com.vaadin.v7.ui.components.calendar.handler.BasicWeekClickHandler;
  */
 @SuppressWarnings("serial")
 @Deprecated
-public class Calendar extends AbstractComponent
+public class Calendar extends AbstractLegacyComponent
         implements CalendarComponentEvents.NavigationNotifier,
         CalendarComponentEvents.EventMoveNotifier,
         CalendarComponentEvents.RangeSelectNotifier,
@@ -440,7 +439,7 @@ public class Calendar extends AbstractComponent
     }
 
     private void setupCalendarEvents() {
-        int durationInDays = (int) (((endDate.getTime()) - startDate.getTime())
+        int durationInDays = (int) ((endDate.getTime() - startDate.getTime())
                 / DateConstants.DAYINMILLIS);
         durationInDays++;
         if (durationInDays > 60) {
@@ -503,7 +502,7 @@ public class Calendar extends AbstractComponent
             endDate = getEndDate();
         }
 
-        int durationInDays = (int) (((endDate.getTime()) - startDate.getTime())
+        int durationInDays = (int) ((endDate.getTime() - startDate.getTime())
                 / DateConstants.DAYINMILLIS);
         durationInDays++;
         if (durationInDays > 60) {
@@ -524,7 +523,7 @@ public class Calendar extends AbstractComponent
         df_date.setTimeZone(currentCalendar.getTimeZone());
         df_time.setTimeZone(currentCalendar.getTimeZone());
 
-        state.now = (df_date.format(now) + " " + df_time.format(now));
+        state.now = df_date.format(now) + " " + df_time.format(now);
 
         Date firstDateToShow = expandStartDate(startDate, durationInDays > 7);
         Date lastDateToShow = expandEndDate(endDate, durationInDays > 7);
@@ -570,7 +569,7 @@ public class Calendar extends AbstractComponent
                     cal.add(java.util.Calendar.SECOND, -1);
                     Date end = cal.getTime();
 
-                    boolean monthView = (durationInDays > 7);
+                    boolean monthView = durationInDays > 7;
 
                     /**
                      * If in day or week view add actions for each half-an-hour.
@@ -903,9 +902,9 @@ public class Calendar extends AbstractComponent
      *            The date caption pattern.
      */
     public void setWeeklyCaptionFormat(String dateFormatPattern) {
-        if ((weeklyCaptionFormat == null && dateFormatPattern != null)
-                || (weeklyCaptionFormat != null
-                        && !weeklyCaptionFormat.equals(dateFormatPattern))) {
+        if (weeklyCaptionFormat == null && dateFormatPattern != null
+                || weeklyCaptionFormat != null
+                        && !weeklyCaptionFormat.equals(dateFormatPattern)) {
             weeklyCaptionFormat = dateFormatPattern;
             markAsDirty();
         }
@@ -932,7 +931,7 @@ public class Calendar extends AbstractComponent
 
         // monday first
         if (calendar.getFirstDayOfWeek() == java.util.Calendar.MONDAY) {
-            fow = (fow == java.util.Calendar.SUNDAY) ? 7 : fow - 1;
+            fow = fow == java.util.Calendar.SUNDAY ? 7 : fow - 1;
         }
 
         return fow;
@@ -1985,8 +1984,7 @@ public class Calendar extends AbstractComponent
 
         if (currentTimeFormat != null) {
             design.attr("time-format",
-                    (currentTimeFormat == TimeFormat.Format12H ? "12h"
-                            : "24h"));
+                    currentTimeFormat == TimeFormat.Format12H ? "12h" : "24h");
         }
         if (startDate != null) {
             design.attr("start-date", df_date.format(getStartDate()));
index e9bdf8771ef2e148ddf6721d75ff8295097c677b..579bc063b8eb1b6a472c4dec45371293e17be720 100644 (file)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2000-2016 Vaadin Ltd.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -55,7 +55,7 @@ import com.vaadin.v7.shared.form.FormState;
 
 /**
  * Form component provides easy way of creating and managing sets fields.
- * 
+ *
  * <p>
  * <code>Form</code> is a container for fields implementing {@link Field}
  * interface. It provides support for any layouts and provides buffering
@@ -64,7 +64,7 @@ import com.vaadin.v7.shared.form.FormState;
  * setting immediateness, etc. Also direct mechanism for replacing existing
  * fields with selections is given.
  * </p>
- * 
+ *
  * <p>
  * <code>Form</code> provides customizable editor for classes implementing
  * {@link com.vaadin.data.Item} interface. Also the form itself implements this
@@ -78,7 +78,7 @@ import com.vaadin.v7.shared.form.FormState;
  * properties of any class following bean pattern, can be accessed trough
  * {@link com.vaadin.data.util.BeanItem}.
  * </p>
- * 
+ *
  * @author Vaadin Ltd.
  * @since 3.0
  * @deprecated As of 7.0, use {@link FieldGroup} instead of {@link Form} for
@@ -134,7 +134,7 @@ public class Form extends AbstractField<Object>
     /**
      * Form needs to repaint itself if child fields value changes due possible
      * change in form validity.
-     * 
+     *
      * TODO introduce ValidityChangeEvent (#6239) and start using it instead.
      * See e.g. DateField#notifyFormOfValidityChange().
      */
@@ -164,7 +164,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Constructs a new form with default layout.
-     * 
+     *
      * <p>
      * By default the form uses {@link FormLayout}.
      * </p>
@@ -176,7 +176,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Constructs a new form with given {@link Layout}.
-     * 
+     *
      * @param formLayout
      *            the layout of the form.
      */
@@ -187,7 +187,7 @@ public class Form extends AbstractField<Object>
     /**
      * Constructs a new form with given {@link Layout} and
      * {@link FormFieldFactory}.
-     * 
+     *
      * @param formLayout
      *            the layout of the form.
      * @param fieldFactory
@@ -231,7 +231,7 @@ public class Form extends AbstractField<Object>
     /**
      * The error message of a Form is the error of the first field with a
      * non-empty error.
-     * 
+     *
      * Empty error messages of the contained fields are skipped, because an
      * empty error indicator would be confusing to the user, especially if there
      * are errors that have something to display. This is also the reason why
@@ -284,15 +284,15 @@ public class Form extends AbstractField<Object>
 
     /**
      * Controls the making validation visible implicitly on commit.
-     * 
+     *
      * Having commit() call setValidationVisible(true) implicitly is the default
      * behaviour. You can disable the implicit setting by setting this property
      * as false.
-     * 
+     *
      * It is useful, because you usually want to start with the form free of
      * errors and only display them after the user clicks Ok. You can disable
      * the implicit setting by setting this property as false.
-     * 
+     *
      * @param makeVisible
      *            If true (default), validation is made visible when commit() is
      *            called. If false, the visibility is left as it is.
@@ -303,9 +303,9 @@ public class Form extends AbstractField<Object>
 
     /**
      * Is validation made automatically visible on commit?
-     * 
+     *
      * See setValidationVisibleOnCommit().
-     * 
+     *
      * @return true if validation is made automatically visible on commit.
      */
     public boolean isValidationVisibleOnCommit() {
@@ -339,7 +339,7 @@ public class Form extends AbstractField<Object>
         // Try to commit all
         for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) {
             try {
-                final Field<?> f = (fields.get(i.next()));
+                final Field<?> f = fields.get(i.next());
                 // Commit only non-readonly fields.
                 if (!f.isReadOnly()) {
                     f.commit();
@@ -387,7 +387,7 @@ public class Form extends AbstractField<Object>
         // Try to discard all changes
         for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) {
             try {
-                (fields.get(i.next())).discard();
+                fields.get(i.next()).discard();
             } catch (final Buffered.SourceException e) {
                 if (problems == null) {
                     problems = new LinkedList<>();
@@ -445,14 +445,14 @@ public class Form extends AbstractField<Object>
             this.buffered = buffered;
             for (final Iterator<Object> i = propertyIds.iterator(); i
                     .hasNext();) {
-                (fields.get(i.next())).setBuffered(buffered);
+                fields.get(i.next()).setBuffered(buffered);
             }
         }
     }
 
     /**
      * Adds a new property to form and create corresponding field.
-     * 
+     *
      * @see com.vaadin.data.Item#addItemProperty(Object, Property)
      */
     @Override
@@ -488,16 +488,16 @@ public class Form extends AbstractField<Object>
 
     /**
      * Registers the field with the form and adds the field to the form layout.
-     * 
+     *
      * <p>
      * The property id must not be already used in the form.
      * </p>
-     * 
+     *
      * <p>
      * This field is added to the layout using the
      * {@link #attachField(Object, Field)} method.
      * </p>
-     * 
+     *
      * @param propertyId
      *            the Property id the the field.
      * @param field
@@ -512,12 +512,12 @@ public class Form extends AbstractField<Object>
     /**
      * Register the field with the form. All registered fields are validated
      * when the form is validated and also committed when the form is committed.
-     * 
+     *
      * <p>
      * The property id must not be already used in the form.
      * </p>
-     * 
-     * 
+     *
+     *
      * @param propertyId
      *            the Property id of the field.
      * @param field
@@ -539,8 +539,8 @@ public class Form extends AbstractField<Object>
         // form.
         // Should this also include invalidCommitted (#3993)?
         field.setBuffered(buffered);
-        if (isImmediate() && field instanceof AbstractComponent) {
-            ((AbstractComponent) field).setImmediate(true);
+        if (isImmediate() && field instanceof AbstractLegacyComponent) {
+            ((AbstractLegacyComponent) field).setImmediate(true);
         }
     }
 
@@ -553,11 +553,11 @@ public class Form extends AbstractField<Object>
      * CustomLayout location given by the string representation of the property
      * id using {@link CustomLayout#addComponent(Component, String)}.
      * </p>
-     * 
+     *
      * <p>
      * Override this method to control how the fields are added to the layout.
      * </p>
-     * 
+     *
      * @param propertyId
      * @param field
      */
@@ -577,13 +577,13 @@ public class Form extends AbstractField<Object>
 
     /**
      * The property identified by the property id.
-     * 
+     *
      * <p>
      * The property data source of the field specified with property id is
      * returned. If there is a (with specified property id) having no data
      * source, the field is returned instead of the data source.
      * </p>
-     * 
+     *
      * @see com.vaadin.data.Item#getItemProperty(Object)
      */
     @Override
@@ -604,7 +604,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Gets the field identified by the propertyid.
-     * 
+     *
      * @param propertyId
      *            the id of the property.
      */
@@ -620,7 +620,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Removes the property and corresponding field from the form.
-     * 
+     *
      * @see com.vaadin.data.Item#removeItemProperty(Object)
      */
     @Override
@@ -647,7 +647,7 @@ public class Form extends AbstractField<Object>
      * Override this method to control how the fields are removed from the
      * layout.
      * </p>
-     * 
+     *
      * @param field
      *            the field to be detached from the forms layout.
      */
@@ -660,7 +660,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Removes all properties and fields from the form.
-     * 
+     *
      * @return the Success of the operation. Removal of all fields succeeded if
      *         (and only if) the return value is <code>true</code>.
      */
@@ -685,12 +685,12 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the item datasource for the form.
-     * 
+     *
      * <p>
      * Setting item datasource clears any fields, the form might contain and
      * adds all the properties as fields to the form.
      * </p>
-     * 
+     *
      * @see com.vaadin.data.Item.Viewer#setItemDataSource(Item)
      */
     @Override
@@ -702,13 +702,13 @@ public class Form extends AbstractField<Object>
     /**
      * Set the item datasource for the form, but limit the form contents to
      * specified properties of the item.
-     * 
+     *
      * <p>
      * Setting item datasource clears any fields, the form might contain and
      * adds the specified the properties as fields to the form, in the specified
      * order.
      * </p>
-     * 
+     *
      * @see com.vaadin.data.Item.Viewer#setItemDataSource(Item)
      */
     public void setItemDataSource(Item newDataSource,
@@ -759,7 +759,7 @@ public class Form extends AbstractField<Object>
      * property straight to Field. If Property.Viewer type property (e.g.
      * PropertyFormatter) is already set for field, the property is bound to
      * that Property.Viewer.
-     * 
+     *
      * @param propertyId
      * @param property
      * @param field
@@ -771,7 +771,7 @@ public class Form extends AbstractField<Object>
         // expect developer has e.g. PropertyFormatter that he wishes to use and
         // assign the property to the Viewer instead.
         boolean hasFilterProperty = field.getPropertyDataSource() != null
-                && (field.getPropertyDataSource() instanceof Property.Viewer);
+                && field.getPropertyDataSource() instanceof Property.Viewer;
         if (hasFilterProperty) {
             ((Property.Viewer) field.getPropertyDataSource())
                     .setPropertyDataSource(property);
@@ -782,12 +782,12 @@ public class Form extends AbstractField<Object>
 
     /**
      * Gets the layout of the form.
-     * 
+     *
      * <p>
      * By default form uses <code>OrderedLayout</code> with <code>form</code>
      * -style.
      * </p>
-     * 
+     *
      * @return the Layout of the form.
      */
     public Layout getLayout() {
@@ -796,11 +796,11 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the layout of the form.
-     * 
+     *
      * <p>
      * If set to null then Form uses a FormLayout by default.
      * </p>
-     * 
+     *
      * @param layout
      *            the layout of the form.
      */
@@ -839,16 +839,16 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the form field to be selectable from static list of changes.
-     * 
+     *
      * <p>
      * The list values and descriptions are given as array. The value-array must
      * contain the current value of the field and the lengths of the arrays must
      * match. Null values are not supported.
      * </p>
-     * 
+     *
      * Note: since Vaadin 7.0, returns an {@link AbstractSelect} instead of a
      * {@link Select}.
-     * 
+     *
      * @param propertyId
      *            the id of the property.
      * @param values
@@ -883,7 +883,7 @@ public class Form extends AbstractField<Object>
         boolean isMultiselect = false;
         for (int i = 0; i < values.length && !found; i++) {
             if (values[i] == value
-                    || (value != null && value.equals(values[i]))) {
+                    || value != null && value.equals(values[i])) {
                 found = true;
             }
         }
@@ -895,7 +895,7 @@ public class Form extends AbstractField<Object>
                     found = false;
                     for (int i = 0; i < values.length && !found; i++) {
                         if (values[i] == val
-                                || (val != null && val.equals(values[i]))) {
+                                || val != null && val.equals(values[i])) {
                             found = true;
                         }
                     }
@@ -958,20 +958,20 @@ public class Form extends AbstractField<Object>
 
     /**
      * Checks the validity of the Form and all of its fields.
-     * 
+     *
      * @see com.vaadin.legacy.data.Validatable#validate()
      */
     @Override
     public void validate() throws Validator.InvalidValueException {
         super.validate();
         for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) {
-            (fields.get(i.next())).validate();
+            fields.get(i.next()).validate();
         }
     }
 
     /**
      * Checks the validabtable object accept invalid values.
-     * 
+     *
      * @see com.vaadin.legacy.data.Validatable#isInvalidAllowed()
      */
     @Override
@@ -981,7 +981,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Should the validabtable object accept invalid values.
-     * 
+     *
      * @see com.vaadin.legacy.data.Validatable#setInvalidAllowed(boolean)
      */
     @Override
@@ -992,24 +992,24 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the component's to read-only mode to the specified state.
-     * 
+     *
      * @see com.vaadin.ui.Component#setReadOnly(boolean)
      */
     @Override
     public void setReadOnly(boolean readOnly) {
         super.setReadOnly(readOnly);
         for (final Iterator<?> i = propertyIds.iterator(); i.hasNext();) {
-            (fields.get(i.next())).setReadOnly(readOnly);
+            fields.get(i.next()).setReadOnly(readOnly);
         }
     }
 
     /**
      * Sets the field factory used by this Form to genarate Fields for
      * properties.
-     * 
+     *
      * {@link FormFieldFactory} is used to create fields for form properties.
      * {@link DefaultFieldFactory} is used by default.
-     * 
+     *
      * @param fieldFactory
      *            the new factory used to create the fields.
      * @see Field
@@ -1021,7 +1021,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Get the field factory of the form.
-     * 
+     *
      * @return the FormFieldFactory Factory used to create the fields.
      */
     public FormFieldFactory getFormFieldFactory() {
@@ -1030,7 +1030,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Gets the field type.
-     * 
+     *
      * @see com.vaadin.legacy.ui.AbstractField#getType()
      */
     @Override
@@ -1043,9 +1043,9 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the internal value.
-     * 
+     *
      * This is relevant when the Form is used as Field.
-     * 
+     *
      * @see com.vaadin.legacy.ui.AbstractField#setInternalValue(java.lang.Object)
      */
     @Override
@@ -1067,7 +1067,7 @@ public class Form extends AbstractField<Object>
      * Gets the first focusable field in form. If there are enabled,
      * non-read-only fields, the first one of them is returned. Otherwise, the
      * field for the first property (or null if none) is returned.
-     * 
+     *
      * @return the Field.
      */
     private Field<?> getFirstFocusableField() {
@@ -1093,9 +1093,9 @@ public class Form extends AbstractField<Object>
 
     /**
      * Updates the internal form datasource.
-     * 
+     *
      * Method setFormDataSource.
-     * 
+     *
      * @param data
      * @param properties
      */
@@ -1121,7 +1121,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Returns the visibleProperties.
-     * 
+     *
      * @return the Collection of visible Item properites.
      */
     public Collection<?> getVisibleItemProperties() {
@@ -1130,7 +1130,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the visibleProperties.
-     * 
+     *
      * @param visibleProperties
      *            the visibleProperties to set.
      */
@@ -1145,7 +1145,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the visibleProperties.
-     * 
+     *
      * @param visibleProperties
      *            the visibleProperties to set.
      */
@@ -1159,7 +1159,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Focuses the first field in the form.
-     * 
+     *
      * @see com.vaadin.ui.Component.Focusable#focus()
      */
     @Override
@@ -1172,7 +1172,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Sets the Tabulator index of this Focusable component.
-     * 
+     *
      * @see com.vaadin.ui.Component.Focusable#setTabIndex(int)
      */
     @Override
@@ -1180,7 +1180,7 @@ public class Form extends AbstractField<Object>
         super.setTabIndex(tabIndex);
         for (final Iterator<?> i = getItemPropertyIds().iterator(); i
                 .hasNext();) {
-            (getField(i.next())).setTabIndex(tabIndex);
+            getField(i.next()).setTabIndex(tabIndex);
         }
     }
 
@@ -1193,8 +1193,8 @@ public class Form extends AbstractField<Object>
         super.setImmediate(immediate);
         for (Iterator<Field<?>> i = fields.values().iterator(); i.hasNext();) {
             Field<?> f = i.next();
-            if (f instanceof AbstractComponent) {
-                ((AbstractComponent) f).setImmediate(immediate);
+            if (f instanceof AbstractLegacyComponent) {
+                ((AbstractLegacyComponent) f).setImmediate(immediate);
             }
         }
     }
@@ -1203,7 +1203,7 @@ public class Form extends AbstractField<Object>
      * {@inheritDoc}
      * <p>
      * A Form is empty if all of its fields are empty.
-     * 
+     *
      */
     @Override
     public boolean isEmpty() {
@@ -1222,7 +1222,7 @@ public class Form extends AbstractField<Object>
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see com.vaadin.ui.AbstractField#clear()
      */
     @Override
@@ -1237,7 +1237,7 @@ public class Form extends AbstractField<Object>
 
     /**
      * Adding validators directly to form is not supported.
-     * 
+     *
      * Add the validators to form fields instead.
      */
     @Override
@@ -1248,7 +1248,7 @@ public class Form extends AbstractField<Object>
     /**
      * Returns a layout that is rendered below normal form contents. This area
      * can be used for example to include buttons related to form contents.
-     * 
+     *
      * @return layout rendered below normal form contents or null if no footer
      *         is used
      */
@@ -1259,7 +1259,7 @@ public class Form extends AbstractField<Object>
     /**
      * Sets the layout that is rendered below normal form contents. No footer is
      * rendered if this is set to null, .
-     * 
+     *
      * @param footer
      *            the new footer layout
      */
@@ -1295,7 +1295,7 @@ public class Form extends AbstractField<Object>
      * {@link AbstractField}. The ownActionManager handles Actions attached to
      * this Form specifically, while the ActionManager in AbstractField
      * delegates to the containing Window (i.e global Actions).
-     * 
+     *
      * @return
      */
     protected ActionManager getOwnActionManager() {
index 9836f33d20f92488820712c156dca39a061496b0..559df2487527f94dbc6acd16d4eda9ccc081d38e 100644 (file)
@@ -23,7 +23,6 @@ import java.util.Locale;
 import org.jsoup.nodes.Element;
 
 import com.vaadin.shared.util.SharedUtil;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.declarative.DesignContext;
 import com.vaadin.ui.declarative.DesignFormatter;
@@ -57,7 +56,7 @@ import com.vaadin.v7.shared.ui.label.LabelState;
  */
 @SuppressWarnings("serial")
 @Deprecated
-public class Label extends AbstractComponent implements Property<String>,
+public class Label extends AbstractLegacyComponent implements Property<String>,
         Property.Viewer, Property.ValueChangeListener,
         Property.ValueChangeNotifier, Comparable<Label> {
 
index d3bc4b147363067d789d64140cbc5d423b1c2d19..9483ac3eca8f8e4f7318dc03eef3c4b2454b875c 100644 (file)
@@ -31,7 +31,6 @@ import com.vaadin.server.PaintTarget;
 import com.vaadin.server.StreamVariable.StreamingProgressEvent;
 import com.vaadin.shared.EventId;
 import com.vaadin.shared.Registration;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.LegacyComponent;
 import com.vaadin.util.ReflectTools;
@@ -79,7 +78,7 @@ import com.vaadin.v7.shared.ui.upload.UploadState;
  */
 @SuppressWarnings("serial")
 @Deprecated
-public class Upload extends AbstractComponent
+public class Upload extends AbstractLegacyComponent
         implements Component.Focusable, LegacyComponent {
 
     /**
index 03f920c92ba4badffac77ee4b94decbca16da4a1..a6f35fa6f92061e00d43c3a81f6af3d376466fe0 100644 (file)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2000-2016 Vaadin Ltd.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -45,12 +45,12 @@ import com.vaadin.v7.ui.Slider.ValueOutOfBoundsException;
 
 /**
  * A component that represents color selection popup within a color picker.
- * 
+ *
  * @since 7.0.0
  */
 @Deprecated
-public class ColorPickerPopup extends Window implements ClickListener,
-        ColorChangeListener, ColorSelector {
+public class ColorPickerPopup extends Window
+        implements ClickListener, ColorChangeListener, ColorSelector {
 
     private static final String STYLENAME = "v-colorpicker-popup";
 
@@ -155,7 +155,6 @@ public class ColorPickerPopup extends Window implements ClickListener,
         setContent(layout);
         setStyleName(STYLENAME);
         setResizable(false);
-        setImmediate(true);
         // Create the history
         history = new ColorPickerHistory();
         history.addColorChangeListener(this);
@@ -257,7 +256,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Creates the RGB tab.
-     * 
+     *
      * @return the component
      */
     private Component createRGBTab(Color color) {
@@ -287,8 +286,8 @@ public class ColorPickerPopup extends Window implements ClickListener,
             public void valueChange(ValueChangeEvent event) {
                 double red = (Double) event.getProperty().getValue();
                 if (!updatingColors) {
-                    Color newColor = new Color((int) red, selectedColor
-                            .getGreen(), selectedColor.getBlue());
+                    Color newColor = new Color((int) red,
+                            selectedColor.getGreen(), selectedColor.getBlue());
                     setColor(newColor);
                 }
             }
@@ -338,7 +337,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Creates the hsv tab.
-     * 
+     *
      * @return the component
      */
     private Component createHSVTab(Color color) {
@@ -372,16 +371,16 @@ public class ColorPickerPopup extends Window implements ClickListener,
             @Override
             public void valueChange(ValueChangeEvent event) {
                 if (!updatingColors) {
-                    float hue = (Float.parseFloat(event.getProperty()
-                            .getValue().toString())) / 360f;
-                    float saturation = (Float.parseFloat(saturationSlider
-                            .getValue().toString())) / 100f;
-                    float value = (Float.parseFloat(valueSlider.getValue()
-                            .toString())) / 100f;
+                    float hue = Float.parseFloat(
+                            event.getProperty().getValue().toString()) / 360f;
+                    float saturation = Float.parseFloat(
+                            saturationSlider.getValue().toString()) / 100f;
+                    float value = Float.parseFloat(
+                            valueSlider.getValue().toString()) / 100f;
 
                     // Set the color
-                    Color color = new Color(Color.HSVtoRGB(hue, saturation,
-                            value));
+                    Color color = new Color(
+                            Color.HSVtoRGB(hue, saturation, value));
                     setColor(color);
 
                     /*
@@ -403,14 +402,14 @@ public class ColorPickerPopup extends Window implements ClickListener,
             @Override
             public void valueChange(ValueChangeEvent event) {
                 if (!updatingColors) {
-                    float hue = (Float.parseFloat(hueSlider.getValue()
-                            .toString())) / 360f;
-                    float saturation = (Float.parseFloat(event.getProperty()
-                            .getValue().toString())) / 100f;
-                    float value = (Float.parseFloat(valueSlider.getValue()
-                            .toString())) / 100f;
-                    Color color = new Color(Color.HSVtoRGB(hue, saturation,
-                            value));
+                    float hue = Float
+                            .parseFloat(hueSlider.getValue().toString()) / 360f;
+                    float saturation = Float.parseFloat(
+                            event.getProperty().getValue().toString()) / 100f;
+                    float value = Float.parseFloat(
+                            valueSlider.getValue().toString()) / 100f;
+                    Color color = new Color(
+                            Color.HSVtoRGB(hue, saturation, value));
                     setColor(color);
                 }
             }
@@ -424,15 +423,15 @@ public class ColorPickerPopup extends Window implements ClickListener,
             @Override
             public void valueChange(ValueChangeEvent event) {
                 if (!updatingColors) {
-                    float hue = (Float.parseFloat(hueSlider.getValue()
-                            .toString())) / 360f;
-                    float saturation = (Float.parseFloat(saturationSlider
-                            .getValue().toString())) / 100f;
-                    float value = (Float.parseFloat(event.getProperty()
-                            .getValue().toString())) / 100f;
-
-                    Color color = new Color(Color.HSVtoRGB(hue, saturation,
-                            value));
+                    float hue = Float
+                            .parseFloat(hueSlider.getValue().toString()) / 360f;
+                    float saturation = Float.parseFloat(
+                            saturationSlider.getValue().toString()) / 100f;
+                    float value = Float.parseFloat(
+                            event.getProperty().getValue().toString()) / 100f;
+
+                    Color color = new Color(
+                            Color.HSVtoRGB(hue, saturation, value));
                     setColor(color);
                 }
             }
@@ -446,7 +445,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Creates the select tab.
-     * 
+     *
      * @return the component
      */
     private Component createSelectTab() {
@@ -505,7 +504,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Gets the history.
-     * 
+     *
      * @return the history
      */
     public ColorPickerHistory getHistory() {
@@ -536,7 +535,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Gets the color history.
-     * 
+     *
      * @return the color history
      */
     public List<Color> getColorHistory() {
@@ -569,10 +568,10 @@ public class ColorPickerPopup extends Window implements ClickListener,
             blueSlider.setValue(((Integer) color.getBlue()).doubleValue());
             greenSlider.setValue(((Integer) color.getGreen()).doubleValue());
         } catch (ValueOutOfBoundsException e) {
-            getLogger().log(
-                    Level.WARNING,
+            getLogger().log(Level.WARNING,
                     "Unable to set RGB color value to " + color.getRed() + ","
-                            + color.getGreen() + "," + color.getBlue(), e);
+                            + color.getGreen() + "," + color.getBlue(),
+                    e);
         }
     }
 
@@ -582,10 +581,8 @@ public class ColorPickerPopup extends Window implements ClickListener,
             saturationSlider.setValue(((Float) (hsv[1] * 100f)).doubleValue());
             valueSlider.setValue(((Float) (hsv[2] * 100f)).doubleValue());
         } catch (ValueOutOfBoundsException e) {
-            getLogger().log(
-                    Level.WARNING,
-                    "Unable to set HSV color value to " + hsv[0] + "," + hsv[1]
-                            + "," + hsv[2], e);
+            getLogger().log(Level.WARNING, "Unable to set HSV color value to "
+                    + hsv[0] + "," + hsv[1] + "," + hsv[2], e);
         }
     }
 
@@ -601,7 +598,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Checks the visibility of the given tab
-     * 
+     *
      * @param tab
      *            The tab to check
      * @return true if tab is visible, false otherwise
@@ -618,7 +615,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * How many tabs are visible
-     * 
+     *
      * @return The number of tabs visible
      */
     private int tabsNumVisible() {
@@ -640,7 +637,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Set RGB tab visibility
-     * 
+     *
      * @param visible
      *            The visibility of the RGB tab
      */
@@ -656,7 +653,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Set HSV tab visibility
-     * 
+     *
      * @param visible
      *            The visibility of the HSV tab
      */
@@ -672,7 +669,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Set Swatches tab visibility
-     * 
+     *
      * @param visible
      *            The visibility of the Swatches tab
      */
@@ -688,7 +685,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Set the History visibility
-     * 
+     *
      * @param visible
      */
     public void setHistoryVisible(boolean visible) {
@@ -698,7 +695,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
     /**
      * Set the preview visibility
-     * 
+     *
      * @param visible
      */
     public void setPreviewVisible(boolean visible) {
@@ -712,7 +709,7 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
         @Override
         public Color calculate(int x, int y) {
-            float h = (x / 220f);
+            float h = x / 220f;
             float s = 1f;
             float v = 1f;
 
@@ -764,8 +761,8 @@ public class ColorPickerPopup extends Window implements ClickListener,
 
         @Override
         public Color calculate(int x, int y) {
-            float saturation = 1f - (y / 220.0f);
-            float value = (x / 220.0f);
+            float saturation = 1f - y / 220.0f;
+            float value = x / 220.0f;
             float hue = Float.parseFloat(hueSlider.getValue().toString())
                     / 360f;
 
index 2b627efbe7f1b2b67f43870d09a2148e61cf6670..9a6e3598e823d12eb7cedc163867d799256cfb17 100644 (file)
@@ -59,7 +59,6 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector,
 
     private ColorPickerPreview() {
         setStyleName("v-colorpicker-preview");
-        setImmediate(true);
         field = new TextField();
         field.setImmediate(true);
         field.setSizeFull();
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentDeclarativeTest.java b/compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentDeclarativeTest.java
new file mode 100644 (file)
index 0000000..0577a57
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.v7.ui;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.lang.reflect.Field;
+import java.nio.charset.Charset;
+import java.util.Locale;
+
+import org.jsoup.nodes.Attributes;
+import org.jsoup.nodes.Element;
+import org.jsoup.parser.Tag;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.vaadin.server.ErrorMessage.ErrorLevel;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.FileResource;
+import com.vaadin.server.Responsive;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.UserError;
+import com.vaadin.tests.design.DeclarativeTestBase;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.declarative.Design;
+import com.vaadin.ui.declarative.DesignContext;
+
+/**
+ * Test cases for reading and writing the properties of AbstractComponent.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class AbstractLegacyComponentDeclarativeTest
+        extends DeclarativeTestBase<AbstractLegacyComponent> {
+
+    private AbstractLegacyComponent component;
+
+    @Before
+    public void setUp() {
+        NativeSelect ns = new NativeSelect();
+        component = ns;
+    }
+
+    @Test
+    public void testEmptyDesign() {
+        String design = "<vaadin7-native-select>";
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testProperties() {
+        String design = "<vaadin7-native-select id=\"testId\" primary-style-name=\"test-style\" "
+                + "caption=\"test-caption\" locale=\"fi_FI\" description=\"test-description\" "
+                + "error=\"<div>test-error</div>\" />";
+        component.setId("testId");
+        component.setPrimaryStyleName("test-style");
+        component.setCaption("test-caption");
+        component.setLocale(new Locale("fi", "FI"));
+        component.setDescription("test-description");
+        component.setComponentError(new UserError("<div>test-error</div>",
+                com.vaadin.server.AbstractErrorMessage.ContentMode.HTML,
+                ErrorLevel.ERROR));
+        component.setImmediate(true);
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testReadImmediate() {
+        // Additional tests for the immediate property, including
+        // explicit immediate values
+        String[] design = { "<vaadin7-native-select/>",
+                "<vaadin7-native-select immediate=\"false\"/>",
+                "<vaadin7-native-select immediate=\"true\"/>",
+                "<vaadin7-native-select immediate />" };
+        Boolean[] explicitImmediate = { null, Boolean.FALSE, Boolean.TRUE,
+                Boolean.TRUE };
+        boolean[] immediate = { true, false, true, true };
+        for (int i = 0; i < design.length; i++) {
+            component = (AbstractLegacyComponent) Design
+                    .read(new ByteArrayInputStream(
+                            design[i].getBytes(Charset.forName("UTF-8"))));
+            assertEquals(immediate[i], component.isImmediate());
+            assertEquals(explicitImmediate[i], getExplicitImmediate(component));
+        }
+    }
+
+    @Test
+    public void testExternalIcon() {
+        String design = "<vaadin7-native-select icon=\"http://example.com/example.gif\"/>";
+        component.setIcon(
+                new ExternalResource("http://example.com/example.gif"));
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testThemeIcon() {
+        String design = "<vaadin7-native-select icon=\"theme://example.gif\"/>";
+        component.setIcon(new ThemeResource("example.gif"));
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testFileResourceIcon() {
+        String design = "<vaadin7-native-select icon=\"img/example.gif\"/>";
+        component.setIcon(new FileResource(new File("img/example.gif")));
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testWidthAndHeight() {
+        String design = "<vaadin7-native-select width=\"70%\" height=\"12px\"/>";
+        component.setWidth("70%");
+        component.setHeight("12px");
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testSizeFull() {
+        String design = "<vaadin7-native-select size-full />";
+        component.setSizeFull();
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testHeightFull() {
+        String design = "<vaadin7-native-select height-full width=\"20px\"/>";
+        component.setHeight("100%");
+        component.setWidth("20px");
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testWidthFull() {
+        String design = "<vaadin7-native-select caption=\"Foo\" caption-as-html width-full height=\"20px\"></vaadin7-native-select>";
+        AbstractLegacyComponent component = new NativeSelect();
+        component.setCaptionAsHtml(true);
+        component.setCaption("Foo");
+        component.setHeight("20px");
+        component.setWidth("100%");
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testResponsive() {
+        String design = "<vaadin7-native-select responsive />";
+        Responsive.makeResponsive(component);
+        testRead(design, component);
+        testWrite(design, component);
+    }
+
+    @Test
+    public void testResponsiveFalse() {
+        String design = "<vaadin7-native-select responsive =\"false\"/>";
+        // Only test read as the attribute responsive=false would not be written
+        testRead(design, component);
+    }
+
+    @Test
+    public void testReadAlreadyResponsive() {
+        AbstractComponent component = new Label();
+        Responsive.makeResponsive(component);
+        Element design = createDesign(true);
+        component.readDesign(design, new DesignContext());
+        assertEquals("Component should have only one extension", 1,
+                component.getExtensions().size());
+    }
+
+    @Test
+    public void testUnknownProperties() {
+        String design = "<vaadin7-native-select foo=\"bar\"/>";
+
+        DesignContext context = readAndReturnContext(design);
+        NativeSelect ns = (NativeSelect) context.getRootComponent();
+        assertTrue("Custom attribute was preserved in custom attributes",
+                context.getCustomAttributes(ns).containsKey("foo"));
+
+        testWrite(ns, design, context);
+    }
+
+    private Element createDesign(boolean responsive) {
+        Attributes attributes = new Attributes();
+        attributes.put("responsive", responsive);
+        Element node = new Element(Tag.valueOf("vaadin-label"), "", attributes);
+        return node;
+    }
+
+    private Boolean getExplicitImmediate(AbstractLegacyComponent component) {
+        try {
+            Field immediate = AbstractLegacyComponent.class
+                    .getDeclaredField("explicitImmediateValue");
+            immediate.setAccessible(true);
+            return (Boolean) immediate.get(component);
+        } catch (Exception e) {
+            throw new RuntimeException(
+                    "Getting the field explicitImmediateValue failed.");
+        }
+    }
+}
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentTest.java b/compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentTest.java
new file mode 100644 (file)
index 0000000..1a683ad
--- /dev/null
@@ -0,0 +1,21 @@
+package com.vaadin.v7.ui;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class AbstractLegacyComponentTest {
+    AbstractLegacyComponent component = new AbstractLegacyComponent() {
+    };
+
+    @Test
+    public void testImmediate() {
+        assertTrue("Component should be immediate by default",
+                component.isImmediate());
+        component.setImmediate(false);
+        assertFalse(
+                "Explicitly non-immediate component should not be immediate",
+                component.isImmediate());
+    }
+}
index 4ba42eba46e1b6f1041b4f0ba0d748316e8eee99..36e65acabedfb895caada7f5b382b65e473e8f08 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.vaadin.v7.shared;
 
-import com.vaadin.shared.ui.TabIndexState;
+import com.vaadin.shared.annotations.NoLayout;
 
 /**
  * Shared state for {@link com.vaadin.ui.AbstractField}.
@@ -24,9 +24,14 @@ import com.vaadin.shared.ui.TabIndexState;
  * @since 7.0.0
  *
  */
-public class AbstractFieldState extends TabIndexState {
+public class AbstractFieldState extends AbstractLegacyComponentState {
     public boolean propertyReadOnly = false;
     public boolean hideErrors = false;
     public boolean required = false;
     public boolean modified = false;
+    /**
+     * The <i>tabulator index</i> of the field.
+     */
+    @NoLayout
+    public int tabIndex = 0;
 }
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractLegacyComponentState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractLegacyComponentState.java
new file mode 100644 (file)
index 0000000..adb6d96
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.v7.shared;
+
+import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.shared.annotations.NoLayout;
+
+/**
+ * Shared state for AbstractLegacyComponent.
+ *
+ * @author Vaadin Ltd
+ * @since 8.0
+ * @deprecated only used for Vaadin 7 compatiblity components
+ */
+@Deprecated
+public class AbstractLegacyComponentState extends AbstractComponentState {
+    @NoLayout
+    public boolean immediate = false;
+}
index df62f84bbd440253193f8f3bd2131492de3c0fb1..dd15c09b7f0ad3e69605ff21e47a3698b125962a 100644 (file)
@@ -17,13 +17,13 @@ package com.vaadin.v7.shared.ui.calendar;
 
 import java.util.List;
 
-import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * @since 7.1.0
  * @author Vaadin Ltd.
  */
-public class CalendarState extends AbstractComponentState {
+public class CalendarState extends AbstractLegacyComponentState {
 
     public boolean format24H;
     public String[] dayNames;
index 0e418504f7d84e9b34406602530678e519dd4730..ba6a404519aed5e1a6cb017098a5e6b01af8e19e 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.vaadin.v7.shared.ui.colorpicker;
 
-import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * Default shared state implementation for ColorPickerGradient.
@@ -23,7 +23,7 @@ import com.vaadin.shared.AbstractComponentState;
  * @since 7.0.0
  */
 @Deprecated
-public class ColorPickerGradientState extends AbstractComponentState {
+public class ColorPickerGradientState extends AbstractLegacyComponentState {
 
     public int cursorX;
 
index d822d6efc3394d077da271950f68bf8a4c1e663e..0dfcfadd9417b27aa06c92ccf8dc3608b0b39443 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.vaadin.v7.shared.ui.colorpicker;
 
-import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * Default shared state implementation for ColorPickerGrid.
@@ -23,7 +23,7 @@ import com.vaadin.shared.AbstractComponentState;
  * @since 7.0.0
  */
 @Deprecated
-public class ColorPickerGridState extends AbstractComponentState {
+public class ColorPickerGridState extends AbstractLegacyComponentState {
 
     public int rowCount;
 
index 84e3b846cacfef9ec54444c15ea39becff313164..be8fb79a183e226afdd71325dffdea310a12f195 100644 (file)
@@ -15,8 +15,8 @@
  */
 package com.vaadin.v7.shared.ui.colorpicker;
 
-import com.vaadin.shared.AbstractComponentState;
 import com.vaadin.shared.annotations.DelegateToWidget;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * Default shared state implementation for AbstractColorPicker.
@@ -24,7 +24,7 @@ import com.vaadin.shared.annotations.DelegateToWidget;
  * @since 7.0.0
  */
 @Deprecated
-public class ColorPickerState extends AbstractComponentState {
+public class ColorPickerState extends AbstractLegacyComponentState {
     {
         primaryStyleName = "v-colorpicker";
     }
index 64cc3b5ee5ca5ff505dbe7523157c88c481a258b..2bded7f1462e536295241ed0ed414190e06730c5 100644 (file)
@@ -15,9 +15,9 @@
  */
 package com.vaadin.v7.shared.ui.label;
 
-import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
-public class LabelState extends AbstractComponentState {
+public class LabelState extends AbstractLegacyComponentState {
     {
         primaryStyleName = "v-label";
     }
index 2a6cb0ea667761a24f2ae2959515383921c95b8e..90e4f1358dc679681f929b98e65910a7b6635996 100644 (file)
  */
 package com.vaadin.v7.shared.ui.upload;
 
-import com.vaadin.shared.AbstractComponentState;
+import com.vaadin.v7.shared.AbstractLegacyComponentState;
 
 /**
  * Shared state for the Upload component.
  *
  * @since 7.6
  */
-public class UploadState extends AbstractComponentState {
+public class UploadState extends AbstractLegacyComponentState {
 
     {
         primaryStyleName = "v-upload";
index d23c87e468daea6ec8c31f43cc90a3a1eace6c28..f43c68fd6f973d2c0f5dcd63f433df116d75e0dd 100644 (file)
@@ -110,7 +110,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector {
      */
     private void handleDropRequest(DropTarget dropTarget,
             Map<String, Object> variables) {
-        DropHandler dropHandler = (dropTarget).getDropHandler();
+        DropHandler dropHandler = dropTarget.getDropHandler();
         if (dropHandler == null) {
             // No dropHandler returned so no drop can be performed.
             getLogger().log(Level.FINE,
@@ -217,16 +217,22 @@ public class DragAndDropService implements VariableOwner, ClientConnector {
         return transferable;
     }
 
+    /**
+     * <p>
+     * Tests if the variable owner is enabled or not. The terminal should not
+     * send any variable changes to disabled variable owners.
+     * </p>
+     * Implementation detail: this method is originally from the VariableOwner
+     * class, which has been removed in Vaadin 8.
+     *
+     * @return <code>true</code> if the variable owner is enabled,
+     *         <code>false</code> if not
+     */
     @Override
     public boolean isEnabled() {
         return isConnectorEnabled();
     }
 
-    @Override
-    public boolean isImmediate() {
-        return true;
-    }
-
     public void printJSONResponse(Writer outWriter) throws IOException {
         if (isDirty()) {
 
index c431d37b964dd55125b065fad31a0d57159ac228..d92b353cd4be3959c97ac16e9c36603db758ad8f 100644 (file)
@@ -62,24 +62,4 @@ public interface VariableOwner extends Serializable {
      */
     public boolean isEnabled();
 
-    /**
-     * <p>
-     * Tests if the variable owner is in immediate mode or not. Being in
-     * immediate mode means that all variable changes are required to be sent
-     * back from the terminal immediately when they occur.
-     * </p>
-     *
-     * <p>
-     * <strong>Note:</strong> <code>VariableOwner</code> does not include a set-
-     * method for the immediateness property. This is because not all
-     * VariableOwners wish to offer the functionality. Such VariableOwners are
-     * never in the immediate mode, thus they always return <code>false</code>
-     * in {@link #isImmediate()}.
-     * </p>
-     *
-     * @return <code>true</code> if the component is in immediate mode,
-     *         <code>false</code> if not.
-     */
-    public boolean isImmediate();
-
 }
index 6814a96796b8dc6903d4308a8415a43c2980d343..dd482a5bd036ed1027462ba925d9875e1fd82faf 100644 (file)
@@ -154,7 +154,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
 
     /**
      * Returns the current selected color of this color picker.
-     * 
+     *
      * @return the selected color, not null
      */
     @Override
@@ -165,7 +165,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
     /**
      * Sets the selected color of this color picker. If the new color is not
      * equal to getValue(), fires a value change event.
-     * 
+     *
      * @param color
      *            the new selected color, not null
      */
@@ -191,7 +191,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
     /**
      * Returns true if the component shows the default caption (css-code for the
      * currently selected color, e.g. #ffffff) if no other caption is available.
-     * 
+     *
      * @return {@code true} if the default caption is enabled, {@code false}
      *         otherwise
      */
@@ -447,7 +447,6 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
                 window.setHistoryVisible(historyVisible);
                 window.setPreviewVisible(textfieldVisible);
 
-                window.setImmediate(true);
                 window.addCloseListener(
                         event -> getState().popupVisible = false);
                 window.addValueChangeListener(
@@ -515,7 +514,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
         DesignAttributeHandler.writeAttribute("color", attribute,
                 getValue().getCSS(), Color.WHITE.getCSS(), String.class);
         DesignAttributeHandler.writeAttribute("popup-style", attribute,
-                (popupStyle == PopupStyle.POPUP_NORMAL ? "normal" : "simple"),
+                popupStyle == PopupStyle.POPUP_NORMAL ? "normal" : "simple",
                 "normal", String.class);
         DesignAttributeHandler.writeAttribute("position", attribute,
                 positionX + "," + positionY, "0,0", String.class);
index f794cab51b7807110a0174e1afe724bcb7ca5340..0681612996e54d027c8d67657d6b0f31e644b40c 100644 (file)
@@ -118,8 +118,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
 
     private HasComponents parent;
 
-    private Boolean explicitImmediateValue;
-
     protected static final String DESIGN_ATTR_PLAIN_TEXT = "plain-text";
 
     /* Constructor */
@@ -434,7 +432,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
             return false;
         } else if (!super.isConnectorEnabled()) {
             return false;
-        } else if ((getParent() instanceof SelectiveRenderer)
+        } else if (getParent() instanceof SelectiveRenderer
                 && !((SelectiveRenderer) getParent()).isRendered(this)) {
             return false;
         } else {
@@ -442,44 +440,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
         }
     }
 
-    /**
-     * Returns the explicitly set immediate value.
-     *
-     * @return the explicitly set immediate value or null if
-     *         {@link #setImmediate(boolean)} has not been explicitly invoked
-     */
-    protected Boolean getExplicitImmediateValue() {
-        return explicitImmediateValue;
-    }
-
-    /**
-     * Returns the immediate mode of the component.
-     * <p>
-     * Since Vaadin 8, the default mode is immediate.
-     *
-     * @return true if the component is in immediate mode (explicitly or
-     *         implicitly set), false if the component if not in immediate mode
-     */
-    public boolean isImmediate() {
-        if (explicitImmediateValue != null) {
-            return explicitImmediateValue;
-        } else {
-            return true;
-        }
-    }
-
-    /**
-     * Sets the component's immediate mode to the specified status.
-     *
-     * @param immediate
-     *            the boolean value specifying if the component should be in the
-     *            immediate mode after the call.
-     */
-    public void setImmediate(boolean immediate) {
-        explicitImmediateValue = immediate;
-        getState().immediate = immediate;
-    }
-
     /*
      * (non-Javadoc)
      *
@@ -771,8 +731,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
         } else {
             getState().errorMessage = null;
         }
-
-        getState().immediate = isImmediate();
     }
 
     /* General event framework */
@@ -1002,11 +960,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
             }
 
         }
-        // handle immediate
-        if (attr.hasKey("immediate")) {
-            setImmediate(DesignAttributeHandler.getFormatter()
-                    .parse(attr.get("immediate"), Boolean.class));
-        }
 
         // handle locale
         if (attr.hasKey("locale")) {
@@ -1289,11 +1242,6 @@ public abstract class AbstractComponent extends AbstractClientConnector
         for (String attribute : getDefaultAttributes()) {
             DesignAttributeHandler.writeAttribute(this, attribute, attr, def);
         }
-        // handle immediate
-        if (explicitImmediateValue != null) {
-            DesignAttributeHandler.writeAttribute("immediate", attr,
-                    explicitImmediateValue, def.isImmediate(), Boolean.class);
-        }
         // handle locale
         if (getLocale() != null && (getParent() == null
                 || !getLocale().equals(getParent().getLocale()))) {
index ffca8b808cd12b27b501c5bc34420d629aa3ff3e..5822a7b0787d60494d8b02b49c6d143c0cb84700 100644 (file)
@@ -858,7 +858,6 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
      *         // Some miscellaneous component
      *         TextField name = new TextField(&quot;Say it all here&quot;);
      *         name.addListener(this);
-     *         name.setImmediate(true);
      *         layout.addComponent(name);
      *
      *         // Handle button clicks as generic events instead
@@ -940,7 +939,6 @@ public interface Component extends ClientConnector, Sizeable, Serializable {
      *         // Some miscellaneous component
      *         TextField name = new TextField(&quot;Say it all here&quot;);
      *         name.addListener(this);
-     *         name.setImmediate(true);
      *         layout.addComponent(name);
      *
      *         // Handle button clicks as generic events instead
index 79fe6227a18ed0e3a78fdda3ba346f35c898fe89..747f294666bcb396f228e30e60b5ed9a5fc33cc9 100644 (file)
@@ -142,7 +142,6 @@ public class TabSheet extends AbstractComponentContainer
 
         // expand horizontally by default
         setWidth(100, UNITS_PERCENTAGE);
-        setImmediate(true);
         setCloseHandler(new CloseHandler() {
 
             @Override
index 4460b21d3349b2d393c19ab3acc08e2310655404..4cb79b92494f8c2fabc18be23bad5b871c7d552f 100644 (file)
@@ -139,7 +139,6 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
         setContent(layout);
         setStyleName(STYLENAME);
         setResizable(false);
-        setImmediate(true);
         // Create the history
         history = new ColorPickerHistory();
         history.addValueChangeListener(this::colorChanged);
@@ -147,7 +146,7 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
     /**
      * Instantiates a new color picker popup.
-     * 
+     *
      * @param initialColor
      *            the initially selected color
      */
@@ -307,7 +306,6 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
     private Slider createRGBSlider(String caption, String styleName) {
         Slider redSlider = new Slider(caption, 0, 255);
-        redSlider.setImmediate(true);
         redSlider.setStyleName("rgb-slider");
         redSlider.setWidth("220px");
         redSlider.addStyleName(styleName);
@@ -345,16 +343,14 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
         hueSlider.setStyleName("hsv-slider");
         hueSlider.addStyleName("hue-slider");
         hueSlider.setWidth("220px");
-        hueSlider.setImmediate(true);
         hueSlider.addValueChangeListener(event -> {
             if (!updatingColors) {
-                float hue = (Float.parseFloat(event.getValue().toString()))
+                float hue = Float.parseFloat(event.getValue().toString())
                         / 360f;
-                float saturation = (Float
-                        .parseFloat(saturationSlider.getValue().toString()))
-                        / 100f;
-                float value = (Float
-                        .parseFloat(valueSlider.getValue().toString())) / 100f;
+                float saturation = Float.parseFloat(
+                        saturationSlider.getValue().toString()) / 100f;
+                float value = Float
+                        .parseFloat(valueSlider.getValue().toString()) / 100f;
 
                 // Set the color
                 Color newColor = new Color(
@@ -374,15 +370,14 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
         saturationSlider.setStyleName("hsv-slider");
         saturationSlider.setWidth("220px");
-        saturationSlider.setImmediate(true);
         saturationSlider.addValueChangeListener(event -> {
             if (!updatingColors) {
-                float hue = (Float.parseFloat(hueSlider.getValue().toString()))
+                float hue = Float.parseFloat(hueSlider.getValue().toString())
                         / 360f;
-                float saturation = (Float
-                        .parseFloat(event.getValue().toString())) / 100f;
-                float value = (Float
-                        .parseFloat(valueSlider.getValue().toString())) / 100f;
+                float saturation = Float.parseFloat(event.getValue().toString())
+                        / 100f;
+                float value = Float
+                        .parseFloat(valueSlider.getValue().toString()) / 100f;
                 Color newColor = new Color(
                         Color.HSVtoRGB(hue, saturation, value));
                 setValue(newColor);
@@ -392,15 +387,13 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
         valueSlider.setStyleName("hsv-slider");
         valueSlider.setWidth("220px");
-        valueSlider.setImmediate(true);
         valueSlider.addValueChangeListener(event -> {
             if (!updatingColors) {
-                float hue = (Float.parseFloat(hueSlider.getValue().toString()))
+                float hue = Float.parseFloat(hueSlider.getValue().toString())
                         / 360f;
-                float saturation = (Float
-                        .parseFloat(saturationSlider.getValue().toString()))
-                        / 100f;
-                float value = (Float.parseFloat(event.getValue().toString()))
+                float saturation = Float.parseFloat(
+                        saturationSlider.getValue().toString()) / 100f;
+                float value = Float.parseFloat(event.getValue().toString())
                         / 100f;
 
                 Color newColor = new Color(
@@ -647,7 +640,7 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
         @Override
         public Color calculate(int x, int y) {
-            float h = (x / 220f);
+            float h = x / 220f;
             float s = 1f;
             float v = 1f;
 
@@ -699,8 +692,8 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
         @Override
         public Color calculate(int x, int y) {
-            float saturation = 1f - (y / 220.0f);
-            float value = (x / 220.0f);
+            float saturation = 1f - y / 220.0f;
+            float value = x / 220.0f;
             float hue = Float.parseFloat(hueSlider.getValue().toString())
                     / 360f;
 
index 3d743f7365a69d68995dbe5be0637f1b17e3c4e8..a76f19e0e21975c501ca656063262fe842a38aed 100644 (file)
@@ -46,9 +46,7 @@ public class ColorPickerPreview extends CssLayout implements HasValue<Color> {
 
     private ColorPickerPreview() {
         setStyleName("v-colorpicker-preview");
-        setImmediate(true);
         field = new TextField();
-        field.setImmediate(true);
         field.setSizeFull();
         field.setStyleName("v-colorpicker-preview-textfield");
         field.setData(this);
@@ -162,8 +160,8 @@ public class ColorPickerPreview extends CssLayout implements HasValue<Color> {
                 }
 
                 oldValue = value;
-                fireEvent(new ValueChange<>((Component) field.getData(),
-                        color, event.isUserOriginated()));
+                fireEvent(new ValueChange<>((Component) field.getData(), color,
+                        event.isUserOriginated()));
             }
 
         } catch (NumberFormatException nfe) {
index 3822251de35a403b619e48f8b393755e58ca766d..b13499983e656b6d3c0086a68de903297a3fe605 100644 (file)
@@ -19,7 +19,6 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.lang.reflect.Field;
 import java.nio.charset.Charset;
 import java.util.Locale;
 
@@ -83,7 +82,6 @@ public class AbstractComponentDeclarativeTest
         component.setComponentError(new UserError("<div>test-error</div>",
                 com.vaadin.server.AbstractErrorMessage.ContentMode.HTML,
                 ErrorLevel.ERROR));
-        component.setImmediate(true);
         testRead(design, component);
         testWrite(design, component);
     }
@@ -103,8 +101,6 @@ public class AbstractComponentDeclarativeTest
             component = (AbstractComponent) Design
                     .read(new ByteArrayInputStream(
                             design[i].getBytes(Charset.forName("UTF-8"))));
-            assertEquals(immediate[i], component.isImmediate());
-            assertEquals(explicitImmediate[i], getExplicitImmediate(component));
         }
     }
 
@@ -246,15 +242,4 @@ public class AbstractComponentDeclarativeTest
         return node;
     }
 
-    private Boolean getExplicitImmediate(AbstractComponent component) {
-        try {
-            Field immediate = AbstractComponent.class
-                    .getDeclaredField("explicitImmediateValue");
-            immediate.setAccessible(true);
-            return (Boolean) immediate.get(component);
-        } catch (Exception e) {
-            throw new RuntimeException(
-                    "Getting the field explicitImmediateValue failed.");
-        }
-    }
 }
diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentTest.java
deleted file mode 100644 (file)
index 1cc48ee..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.vaadin.tests.server.component.abstractcomponent;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.vaadin.ui.AbstractComponent;
-
-public class AbstractComponentTest {
-    AbstractComponent component = new AbstractComponent() {
-    };
-
-    @Test
-    public void testImmediate() {
-        assertTrue("Component should be immediate by default",
-                component.isImmediate());
-        component.setImmediate(false);
-        assertFalse(
-                "Explicitly non-immediate component should not be immediate",
-                component.isImmediate());
-    }
-}
index f077e540ab581b45723f11056bcf90c031d93df0..bcf28859893f769922068c70c04761316c36694a 100644 (file)
@@ -33,8 +33,6 @@ public class AbstractComponentState extends SharedState {
     public String width = "";
     public boolean readOnly = false;
     @NoLayout
-    public boolean immediate = false;
-    @NoLayout
     public String description = "";
     // Note: for the caption, there is a difference between null and an empty
     // string!
index c3d96a6214a721c7fc6bc7453a37ced712eb9e5a..c0df8484ec3aeca0273fc77cd389b8f7ed65966b 100644 (file)
@@ -52,7 +52,6 @@ public class TestDateField extends CustomComponent {
         df.setCaption("DateField caption " + df);
         df.setDescription("DateField description " + df);
         df.setComponentError(errorMsg);
-        df.setImmediate(true);
         // FIXME: bug #1138 this makes datefield to render with unknown
         // component (UIDL tree debug)
         df.addStyleName("thisShouldBeHarmless");
index c23413a87dc517e34f10bf3306d0a73d7954ba46..52cf961c85d3408ed2394ac4e522d8024e90390c 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2000-2016 Vaadin Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -95,7 +95,6 @@ public class TestForWindowing extends CustomComponent {
                         s.setMax(13);
                         s.setMin(12);
                         s.setResolution(2);
-                        s.setImmediate(true);
                         // s.setOrientation(Slider.ORIENTATION_VERTICAL);
                         // s.setArrows(false);
 
diff --git a/uitest/src/main/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemoval.java b/uitest/src/main/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemoval.java
deleted file mode 100644 (file)
index 2e76ed4..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.vaadin.tests.application;
-
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.Set;
-
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractTestUIWithLog;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.ConnectorTracker;
-import com.vaadin.ui.Window;
-
-public class ResynchronizeAfterAsyncRemoval extends AbstractTestUIWithLog {
-
-    @Override
-    public void setup(VaadinRequest vaadinRequest) {
-        final Window window = new Window("Asynchronously removed window");
-        // without this, the size info sent in the background removes the
-        // window immediately after showing it, making the test fail
-        setImmediate(false);
-        window.center();
-
-        // The window will enqueue a non-immediate message reporting its current
-        // position.
-        addWindow(window);
-
-        // Remove window immediately when the current response is sent
-        runAfterResponse(new Runnable() {
-            @Override
-            public void run() {
-                removeWindow(window);
-            }
-        });
-
-        // Clicking the button will trigger sending the window coordinates, but
-        // the window is already removed at that point.
-        addComponent(new Button("Am I dirty?", new Button.ClickListener() {
-            @Override
-            public void buttonClick(ClickEvent event) {
-                log("Window removed: " + (window.getParent() == null));
-
-                boolean dirty = getUI().getConnectorTracker()
-                        .isDirty(event.getButton());
-                log("Dirty: " + dirty);
-            }
-        }));
-        addComponent(new Button("Log unregistered connector count",
-                new Button.ClickListener() {
-                    @Override
-                    public void buttonClick(ClickEvent event) {
-                        logUnregisteredConnectorCount();
-                    }
-                }));
-    }
-
-    private void logUnregisteredConnectorCount() {
-        int count = 0;
-
-        Map<Integer, Set<String>> unregisterIdMap = getUnregisterIdMap();
-        for (Set<String> set : unregisterIdMap.values()) {
-            count += set.size();
-        }
-        log("syncId: " + getConnectorTracker().getCurrentSyncId());
-        log("Unregistered connector count: " + count);
-    }
-
-    @SuppressWarnings("unchecked")
-    private Map<Integer, Set<String>> getUnregisterIdMap() {
-        try {
-            ConnectorTracker tracker = getConnectorTracker();
-            Field field = tracker.getClass()
-                    .getDeclaredField("syncIdToUnregisteredConnectorIds");
-            field.setAccessible(true);
-            return (Map<Integer, Set<String>>) field.get(tracker);
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
\ No newline at end of file
index de0f70ef887862b255ebb3594cb11cb22d409f19..e18fabee5b0df57810ccb869ac39afd926820188 100644 (file)
@@ -228,8 +228,6 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends
      * when overriding.
      */
     protected void createActions() {
-        createBooleanAction("Immediate", CATEGORY_STATE, true,
-                immediateCommand);
         createBooleanAction("Enabled", CATEGORY_STATE, true, enabledCommand);
         createBooleanAction("Readonly", CATEGORY_STATE, false, readonlyCommand);
         createBooleanAction("Visible", CATEGORY_STATE, true, visibleCommand);
@@ -543,7 +541,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends
     }
 
     protected boolean isSelected(MenuItem item) {
-        return (item.getIcon() != null);
+        return item.getIcon() != null;
     }
 
     private <VALUETYPE> MenuBar.Command singleSelectMenuCommand(
@@ -686,8 +684,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> extends
                     Registration registration;
 
                     @Override
-                    public void execute(T c, Boolean enabled,
-                            Object data) {
+                    public void execute(T c, Boolean enabled, Object data) {
                         if (enabled) {
                             registration = addListener.apply(c);
                         } else if (registration != null) {
index bf5ef2df138939e4f816cddb111b5df46d507020..8dce9c73e2872852754da9b2ae39b6e673bb545a 100644 (file)
@@ -82,17 +82,14 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
 
     /* COMMANDS */
 
-    protected Command<T, String> widthCommand = (t, value, data) -> t.setWidth(
-            value);
+    protected Command<T, String> widthCommand = (t, value, data) -> t
+            .setWidth(value);
     protected Command<T, String> heightCommand = (t, value, data) -> t
             .setHeight(value);
 
     protected Command<T, Boolean> enabledCommand = (c, enabled, data) -> c
             .setEnabled(enabled);
 
-    protected Command<T, Boolean> immediateCommand = (c, immediate, data) -> c
-            .setImmediate(immediate);
-
     protected Command<T, Boolean> errorIndicatorCommand = (c, enabled,
             data) -> {
         if (enabled) {
@@ -131,8 +128,8 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
     protected Command<T, Boolean> visibleCommand = (c, enabled, data) -> c
             .setVisible(enabled);
 
-    protected Command<T, Resource> iconCommand = (c, value, data) -> c.setIcon(
-            value);
+    protected Command<T, Resource> iconCommand = (c, value, data) -> c
+            .setIcon(value);
     protected Command<T, String> captionCommand = (c, value, data) -> c
             .setCaption(value);
 
index ab63c2ae42aef1f992872ba8a16cc59d60ba5488..1010a42e7d0468ff560bf9014de7b4f40ae947bf 100644 (file)
@@ -113,7 +113,6 @@ public abstract class ComponentTestCase<T extends AbstractComponent>
                 event -> doCommand(command, event.getValue()));
 
         checkBox.setValue(initialState);
-        checkBox.setImmediate(true);
 
         checkBox.setId("checkboxaction-" + caption);
         // Set default value for all components
@@ -135,7 +134,6 @@ public abstract class ComponentTestCase<T extends AbstractComponent>
         });
 
         button.setId("buttonaction-" + caption);
-        button.setImmediate(true);
 
         return button;
     }
diff --git a/uitest/src/main/java/com/vaadin/tests/components/OutOfSync.java b/uitest/src/main/java/com/vaadin/tests/components/OutOfSync.java
deleted file mode 100644 (file)
index 8b71c53..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.vaadin.tests.components;
-
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Notification;
-
-public class OutOfSync extends AbstractReindeerTestUI {
-
-    @Override
-    protected void setup(VaadinRequest request) {
-        // Without this, there is an extra request from the UI that changes the
-        // request sequence compared to what the test expects
-        setImmediate(false);
-
-        Button b = new Button("Click me after 1s to be out of sync");
-        b.addClickListener(new ClickListener() {
-
-            @Override
-            public void buttonClick(ClickEvent event) {
-                Notification.show("This code will never be reached");
-            }
-        });
-        setContent(b);
-        Thread t = new Thread(new Runnable() {
-
-            @Override
-            public void run() {
-                try {
-                    Thread.sleep(500);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-                // Remove button but prevent repaint -> causes out of sync
-                // issues
-                getSession().lock();
-                try {
-                    setContent(null);
-                    getConnectorTracker().markClean(OutOfSync.this);
-                } finally {
-                    getSession().unlock();
-                }
-            }
-        });
-        t.start();
-    }
-
-    @Override
-    protected String getTestDescription() {
-        return "Click the button after 1s when it has been removed server side (causing synchronization problems)";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return 10780;
-    }
-
-}
index a440b36d599ce08a0ef31c33c9c8c6c2bdf0b980..c37bd5b144ded1f1aa0d0643634e39eec447793c 100644 (file)
@@ -41,7 +41,6 @@ public class AbsoluteLayoutHideComponent extends AbstractReindeerTestUI {
     @Override
     protected void setup(VaadinRequest request) {
         mainLayout = new AbsoluteLayout();
-        mainLayout.setImmediate(true);
         mainLayout.setWidth("100%");
         mainLayout.setHeight("100%");
 
@@ -70,7 +69,6 @@ public class AbsoluteLayoutHideComponent extends AbstractReindeerTestUI {
         // btnLogin
         Button btnLogin = new Button();
         btnLogin.setCaption("Login");
-        btnLogin.setImmediate(false);
         btnLogin.setWidth("-1px");
         btnLogin.setHeight("-1px");
         btnLogin.addClickListener(new Button.ClickListener() {
@@ -112,7 +110,6 @@ public class AbsoluteLayoutHideComponent extends AbstractReindeerTestUI {
         GridLayout gridButtons = new GridLayout(2, 3);
 
         Button btn1 = new Button("Button one");
-        btn1.setImmediate(true);
         btn1.addClickListener(new Button.ClickListener() {
 
             @Override
@@ -122,7 +119,6 @@ public class AbsoluteLayoutHideComponent extends AbstractReindeerTestUI {
         gridButtons.addComponent(btn1, 0, 0);
 
         Button btn2 = new Button("Button two");
-        btn2.setImmediate(true);
         btn2.addClickListener(new Button.ClickListener() {
 
             @Override
@@ -132,7 +128,6 @@ public class AbsoluteLayoutHideComponent extends AbstractReindeerTestUI {
         gridButtons.addComponent(btn2, 0, 1);
 
         Button btn3 = new Button("Button three");
-        btn3.setImmediate(true);
         btn3.addClickListener(new Button.ClickListener() {
 
             @Override
index 5424efc2cb6e6ce12a11dca4a45573a3b2e98c36..4bde83dff21cae2b6a5ddb27cbbf9f6dd247cec3 100644 (file)
@@ -24,22 +24,18 @@ public class EnableState extends AbstractTestCase {
             button.setEnabled(enabled);
             // button.requestRepaint();
         });
-        enable.setImmediate(true);
 
         CheckBox caption = new CheckBox("Toggle button caption", true);
         caption.addValueChangeListener(
                 event -> button.setCaption(button.getCaption() + "+"));
-        caption.setImmediate(true);
 
         CheckBox visible = new CheckBox("Toggle panel visibility", true);
         visible.addValueChangeListener(
                 event -> panel.setVisible(event.getValue()));
-        visible.setImmediate(true);
 
         CheckBox panelEnable = new CheckBox("Toggle panel enabled", true);
         panelEnable.addValueChangeListener(
                 event -> panel.setEnabled(event.getValue()));
-        panelEnable.setImmediate(true);
 
         mainWindow.addComponent(enable);
         mainWindow.addComponent(caption);
index 71fc98c504d6f4309302305ba9396aaedc36ad27..175ee9db6777d300101b532e4ca8b01c43da30fd 100644 (file)
@@ -17,14 +17,14 @@ import com.vaadin.ui.VerticalLayout;
 import com.vaadin.v7.ui.Field;
 import com.vaadin.v7.ui.TextField;
 
-public class RequiredIndicatorForFieldsWithoutCaption extends AbstractReindeerTestUI {
+public class RequiredIndicatorForFieldsWithoutCaption
+        extends AbstractReindeerTestUI {
     private Set<Field> fields = new HashSet<>();
 
     @Override
     protected void setup(VaadinRequest request) {
 
         CheckBox required = new CheckBox("Fields required", true);
-        required.setImmediate(true);
         required.addValueChangeListener(event -> {
             boolean newRequired = event.getValue();
             for (Field f : fields) {
index 1b6a81551a9efe1a57fe3a5d536d69f1d7c1ee1a..b5ed6a3461dddab87d427f9979495e0fcc737656 100644 (file)
@@ -44,7 +44,6 @@ public class ButtonMouseDetails extends TestBase {
         getLayout().setSpacing(true);
 
         Button button = new Button("CLICK ME!", clickListener);
-        button.setImmediate(true);
         addComponent(button);
 
         addComponent(out);
index 44e8fc3ecf0eda447f342959b3fd2ce806ffc5d2..fbe073a4b2aa9409486ef3e06b64ddb4d9a85eb7 100644 (file)
@@ -49,7 +49,6 @@ public class ButtonUpdateAltText extends AbstractReindeerTestUI {
         addComponent(btn);
 
         final CheckBox enable = new CheckBox("Enable alt text", true);
-        enable.setImmediate(true);
         enable.addValueChangeListener(event -> {
             if (event.getValue()) {
                 btn.setIconAlternateText("alt text");
index b099de70e5e7651ab6b39ec0e9f16a1fa1a0c466..8393cc4d94d1638bc4692245e7ce97e7aefafd9d 100644 (file)
@@ -207,7 +207,7 @@ public class CalendarTest extends UI {
             setLocale(defaultLocale);
         }
 
-        if (parameters.containsKey(("secondsResolution"))) {
+        if (parameters.containsKey("secondsResolution")) {
             useSecondResolution = true;
         }
 
@@ -437,7 +437,6 @@ public class CalendarTest extends UI {
 
     private void initHideWeekEndButton() {
         hideWeekendsButton = new CheckBox("Hide weekends");
-        hideWeekendsButton.setImmediate(true);
         hideWeekendsButton.addValueChangeListener(
                 event -> setWeekendsHidden(hideWeekendsButton.getValue()));
     }
@@ -457,14 +456,12 @@ public class CalendarTest extends UI {
 
     private void initReadOnlyButton() {
         readOnlyButton = new CheckBox("Read-only mode");
-        readOnlyButton.setImmediate(true);
         readOnlyButton.addValueChangeListener(event -> calendarComponent
                 .setReadOnly(readOnlyButton.getValue()));
     }
 
     private void initDisabledButton() {
         disabledButton = new CheckBox("Disabled");
-        disabledButton.setImmediate(true);
         disabledButton.addValueChangeListener(event -> calendarComponent
                 .setEnabled(!disabledButton.getValue()));
     }
@@ -534,7 +531,6 @@ public class CalendarTest extends UI {
 
     private CheckBox createCheckBox(String caption) {
         CheckBox cb = new CheckBox(caption);
-        cb.setImmediate(true);
         return cb;
     }
 
diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java
deleted file mode 100644 (file)
index 7cd127f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2000-2016 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.components.checkbox;
-
-import com.vaadin.data.HasValue;
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractReindeerTestUI;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Label;
-
-public class CheckBoxImmediate extends AbstractReindeerTestUI {
-    private int count = 0;
-
-    @Override
-    protected void setup(VaadinRequest request) {
-        final Label status = new Label("Events received: " + count);
-        status.setId("count");
-        addComponent(status);
-
-        CheckBox cb = new CheckBox("Non-immediate");
-        HasValue.ValueChangeListener<Boolean> listener = event -> {
-            count++;
-            status.setValue("Events received: " + count);
-        };
-        cb.addValueChangeListener(listener);
-        cb.setImmediate(false);
-        addComponent(cb);
-
-        cb = new CheckBox("Immediate");
-        cb.addValueChangeListener(listener);
-        cb.setImmediate(true);
-        addComponent(cb);
-    }
-
-    @Override
-    protected String getTestDescription() {
-        return "Test for verifying that a non-immediate CheckBox does not send value change to server immediately.";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return 18102;
-    }
-
-}
index 2b9c2a38a2a0a091c7a564534e5ad008cbc1f404..e8b99258f7c7816b9ef122d64956d0861f955887 100644 (file)
@@ -227,7 +227,6 @@ public class ColorPickerTestUI extends AbstractReindeerTestUI {
             rgbVisible = event.getValue();
             setPopupVisibilities();
         });
-        rgbBox.setImmediate(true);
         rgbBox.setId("rgbBox");
         optLayout.addComponent(rgbBox);
 
@@ -236,7 +235,6 @@ public class ColorPickerTestUI extends AbstractReindeerTestUI {
             hsvVisible = event.getValue();
             setPopupVisibilities();
         });
-        hsvBox.setImmediate(true);
         hsvBox.setId("hsvBox");
         optLayout.addComponent(hsvBox);
 
@@ -245,7 +243,6 @@ public class ColorPickerTestUI extends AbstractReindeerTestUI {
             swaVisible = event.getValue();
             setPopupVisibilities();
         });
-        swaBox.setImmediate(true);
         swaBox.setId("swaBox");
         optLayout.addComponent(swaBox);
 
@@ -254,7 +251,6 @@ public class ColorPickerTestUI extends AbstractReindeerTestUI {
             historyVisible = event.getValue();
             setPopupVisibilities();
         });
-        hisBox.setImmediate(true);
         hisBox.setId("hisBox");
         optLayout.addComponent(hisBox);
 
@@ -263,7 +259,6 @@ public class ColorPickerTestUI extends AbstractReindeerTestUI {
             txtfieldVisible = event.getValue();
             setPopupVisibilities();
         });
-        txtBox.setImmediate(true);
         txtBox.setId("txtBox");
         optLayout.addComponent(txtBox);
 
index 7514ee850bbabd0bce3ce6860de220cbcc8d2105..65c7592f03de7aa2f3b73e84074dc6c479cf78a0 100644 (file)
@@ -30,7 +30,6 @@ public class ComboBoxCursorPositionReset extends AbstractReindeerTestUI {
         setContent(root);
 
         ComboBox<String> combo = new ComboBox<>();
-        combo.setImmediate(true);
         root.addComponent(combo);
         combo.setItems("Hello World", "Please click on the text");
 
index adfb1204090fe6330d2c11b58af62bcc61160fff..14cf564d8d0089650347282f3375d5ca2c9ad72a 100644 (file)
@@ -25,7 +25,6 @@ public class ComboBoxParentDisable extends AbstractTestUIWithLog {
         combo.setItems("Item 1", "Item 2", "Item 3", "Item 4");
         combo.addValueChangeListener(
                 event -> log.log("you made a selection change"));
-        combo.setImmediate(true);
 
         Button btn1 = new Button("Click me");
         btn1.addClickListener(event -> log.log("you clicked me"));
index 06d2d72b80e10b3040d2b8b952939ddce993776e..720780bb3bdc391df5e7b94aede25b604d561063 100644 (file)
@@ -23,7 +23,6 @@ public class ComboBoxResetValue extends AbstractReindeerTestUI {
         final ComboBox cbNullSelectionNotAllowed = getComboBoxWithNullSelectionNotAllowed();
 
         Button b = new Button("Reset");
-        b.setImmediate(true);
         b.addClickListener(new ClickListener() {
             @Override
             public void buttonClick(ClickEvent event) {
index 98ddb6be8270a6daf345368daa3e90ea651d32ea..8072db9de4235f32e2a703372f3102c13b553849 100644 (file)
@@ -11,7 +11,6 @@ public class ComboboxPrimaryStyleNames extends TestBase {
     protected void setup() {
         final ComboBox<String> box = new ComboBox(null,
                 DataSource.create("Value 1", "Value 2", "Value 3", "Value 4"));
-        box.setImmediate(true);
         box.setPrimaryStyleName("my-combobox");
 
         addComponent(box);
index a3d6546853bf033a648acb16e8da956dea9be73f..a9a76506e9c1d866ea06b534b42dae0b85bed989 100644 (file)
@@ -76,7 +76,6 @@ public class Comboboxes extends ComponentTestCase<ComboBox> {
         addTestComponent(s8);
 
         ComboBox<StringBean> s9 = new PageLength0ComboBox();
-        s9.setImmediate(true);
         s9.setCaption("Pagelength 0");
         populate(s9, 15);
         s9.setItemCaptionGenerator(StringBean::getValue);
index 3a3a6bb3ea1cd1e6c6f7de1ff12ed78d69a62b3c..c9ab24011a2d937eacfc7dc479896f2ea2e9a53f 100644 (file)
@@ -19,7 +19,6 @@ public class RemovalOfSelectedIcon extends TestBase {
         addComponent(cb2);
 
         Button btClear = new Button("Clear button");
-        btClear.setImmediate(true);
         btClear.addClickListener(new Button.ClickListener() {
 
             @Override
index f28ad7b1045a5b5eb39d2eab7b44111d8c05c66b..8403f60ce6ba686e6d011a4d1fe4677832751eef 100644 (file)
@@ -145,7 +145,6 @@ public class CustomDateFormats extends TestBase {
         df.setLocale(locale);
         df.setWidth("300px");
         df.setDateFormat(pattern);
-        df.setImmediate(true);
         String debugId = pattern.replace('/', 'X');
         // only certain characters are allowed in debug IDs
         debugId = debugId.replaceAll("[^-a-zA-Z .'_]", "X");
index 51a117f78fb1a44966cb80c3a2cae94350f68f35..fdbd945c3ca30400e827d3048f2cb52f5209fbb9 100644 (file)
@@ -37,7 +37,6 @@ public class DateFieldChangeResolution extends AbstractReindeerTestUI {
         final AbstractDateField dateField = new DateField("Enter date");
         dateField.setResolution(Resolution.YEAR);
         dateField.setId(DATEFIELD_ID);
-        dateField.setImmediate(true);
         addComponent(dateField);
 
         Label l = new Label("Select resolution");
index 05429612603f16adae779f92386fc86aba29178b..60a84dd6794a9a598c30b5419aa4d434dce8f523 100644 (file)
@@ -27,7 +27,6 @@ public class DateFieldIsValid extends AbstractTestUIWithLog {
     @Override
     protected void setup(VaadinRequest request) {
         final AbstractDateField dateField = new TestDateField("Insert Date: ");
-        dateField.setImmediate(true);
         dateField.setDateFormat(pattern);
 
         dateField.addValueChangeListener(event -> log("valueChange: value: "
index dceb6f1bb9b38b458c5a5f3732ef8addffe2c5a0..e53403dbca7919edfc39717ca3e4c07b6fa7f466 100644 (file)
@@ -70,9 +70,7 @@ public class DateFieldRangeValidation extends TestBase {
                 "From inclusive", bi.getItemProperty("fromInclusive"));
         CheckBox toInclusive = new CheckBoxWithPropertyDataSource(
                 "To inclusive", bi.getItemProperty("toInclusive"));
-        fromInclusive.setImmediate(true);
         fromInclusive.addValueChangeListener(refreshField);
-        toInclusive.setImmediate(true);
         toInclusive.addValueChangeListener(refreshField);
 
         PopupDateField toField = createDateField();
index da75872d4ab257ff0236f8a7bb5136fdb26349d7..cfd46f11b454878dd740f9082688f736b3caae34 100644 (file)
@@ -13,7 +13,6 @@ import com.vaadin.tests.components.TestDateField;
 import com.vaadin.ui.AbstractDateField;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CheckBox;
 import com.vaadin.ui.GridLayout;
 import com.vaadin.ui.HorizontalLayout;
 import com.vaadin.ui.InlineDateField;
@@ -35,7 +34,6 @@ public class DateFieldRanges extends AbstractReindeerTestUI {
     private AbstractDateField fromRange = new TestDateField("Range start");
     private AbstractDateField toRange = new TestDateField("Range end");
     private AbstractDateField valueDF = new TestDateField("Value");
-    private CheckBox immediateCB = new CheckBox("Immediate");
     private Button recreate = new Button("Recreate static datefields");
     private Button clearRangeButton = new Button("Clear range");
 
@@ -73,33 +71,23 @@ public class DateFieldRanges extends AbstractReindeerTestUI {
         });
 
         fromRange.setValue(null);
-        fromRange.setImmediate(true);
         fromRange.addValueChangeListener(event -> {
             inlineDynamicDateField.setRangeStart(fromRange.getValue());
             dynamicDateField.setRangeStart(fromRange.getValue());
         });
 
         toRange.setValue(null);
-        toRange.setImmediate(true);
         toRange.addValueChangeListener(event -> {
             inlineDynamicDateField.setRangeEnd(toRange.getValue());
             dynamicDateField.setRangeEnd(toRange.getValue());
         });
 
         valueDF.setValue(null);
-        valueDF.setImmediate(true);
         valueDF.addValueChangeListener(event -> {
             inlineDynamicDateField.setValue(valueDF.getValue());
             dynamicDateField.setValue(valueDF.getValue());
         });
 
-        immediateCB.setValue(true);
-        immediateCB.setImmediate(true);
-        immediateCB.addValueChangeListener(event -> {
-            inlineDynamicDateField.setImmediate(immediateCB.getValue());
-            dynamicDateField.setImmediate(immediateCB.getValue());
-        });
-
         recreate.addClickListener(new Button.ClickListener() {
 
             @Override
@@ -132,7 +120,6 @@ public class DateFieldRanges extends AbstractReindeerTestUI {
         fromRange.setId("fromRange");
         toRange.setId("toRange");
         valueDF.setId("valueDF");
-        immediateCB.setId("immediateCB");
         recreate.setId("recreate");
         clearRangeButton.setId("clearRangeButton");
         dynamicDateField.setId("dynamicDateField");
@@ -162,7 +149,6 @@ public class DateFieldRanges extends AbstractReindeerTestUI {
         hl.addComponent(fromRange);
         hl.addComponent(toRange);
         hl.addComponent(valueDF);
-        hl.addComponent(immediateCB);
         hl.addComponent(recreate);
         hl.addComponent(clearRangeButton);
         addComponent(hl);
@@ -227,14 +213,11 @@ public class DateFieldRanges extends AbstractReindeerTestUI {
         LocalDate toVal = toRange.getValue();
         LocalDate value = valueDF.getValue();
         Resolution r = (Resolution) resoSelect.getValue();
-        boolean immediate = immediateCB.getValue();
 
         df.setValue(value);
         df.setResolution(r);
         df.setRangeStart(fromVal);
         df.setRangeEnd(toVal);
-        df.setImmediate(immediate);
-
     }
 
 }
index 53f8bb1cb2faef29668a82dc2476269d9bcc2534..5eccb0252255602087954ff74b956454d1ce00dc 100644 (file)
@@ -67,20 +67,16 @@ public class DateFieldUnparsableDate extends TestBase {
     protected void setup() {
         MyDateField df = new MyDateField(
                 "Returns the old value for invalid dates");
-        df.setImmediate(true);
         addComponent(df);
 
         MyDateField2 df2 = new MyDateField2("Returns empty for invalid dates");
-        df2.setImmediate(true);
         addComponent(df2);
 
         MyDateField3 df3 = new MyDateField3(
                 "Throws an exception for invalid dates");
-        df3.setImmediate(true);
         addComponent(df3);
 
         MyDateField4 df4 = new MyDateField4("Can convert 'today'");
-        df4.setImmediate(true);
         addComponent(df4);
 
     }
index e484f19f3da0f548707380c38bb3321df50e871b..6b28c9a700f8d2c83b3e51b2edc07557d60634e1 100644 (file)
@@ -37,11 +37,6 @@ public class DisabledParentLayout extends AbstractReindeerTestUI {
 
         final VerticalLayout pane = new VerticalLayout();
         AbstractDateField dateField = new TestDateField();
-        // If the field is immediate, the UI behaves differently (the value is
-        // updated and an error is indicated earlier instead of showing the date
-        // selector on the first click as the test expects. Keeping as
-        // non-immediate to test the old expected behavior.
-        dateField.setImmediate(false);
         pane.addComponent(dateField);
 
         content.addComponent(pane);
index df2faec965724ce34a8d730e9ec7838f17a2a667..395e682089088fe365da987b39112e6a56f758e4 100644 (file)
@@ -113,7 +113,6 @@ public class LegacyDateFieldRanges extends AbstractReindeerTestUI {
         });
 
         immediateCB.setValue(true);
-        immediateCB.setImmediate(true);
         immediateCB.addValueChangeListener(event -> {
             inlineDynamicDateField.setImmediate(immediateCB.getValue());
             dynamicDateField.setImmediate(immediateCB.getValue());
index a9d978c9e415b98c7a32022991973d34bbb702f4..ea503f42841e0cbaffc4e38e17245adce2bf5975 100644 (file)
@@ -35,7 +35,6 @@ public class LenientMode extends TestBase
         df.setLocale(new Locale("fi"));
         df.setResolution(Resolution.DAY);
         df.setLenient(true);
-        df.setImmediate(true);
         df.setValue(d);
 
         AbstractDateField df2 = new TestDateField("Normal ");
@@ -43,7 +42,6 @@ public class LenientMode extends TestBase
         df2.setResolution(Resolution.DAY);
         // df2.setLenient(false);
         df2.setValue(null);
-        df2.setImmediate(true);
         df2.setValue(d);
 
         addComponent(df);
@@ -55,14 +53,12 @@ public class LenientMode extends TestBase
         df = new TestDateField("Lenient with time");
         df.setLocale(new Locale("fi"));
         df.setLenient(true);
-        df.setImmediate(true);
         df.setValue(d);
 
         df2 = new TestDateField("Normal with time");
         df2.setLocale(new Locale("fi"));
         // df2.setLenient(false);
         df2.setValue(null);
-        df2.setImmediate(true);
         df2.setValue(d);
 
         addComponent(df);
index da2fad276c613fbcea1a7d77d6cb5100afacfadf..e0158f45fe089681759109cbc00e85d7630267c0 100644 (file)
@@ -5,7 +5,6 @@ import java.time.LocalDate;
 import com.vaadin.shared.ui.datefield.Resolution;
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
 import com.vaadin.ui.DateField;
 import com.vaadin.ui.InlineDateField;
 
@@ -19,7 +18,6 @@ public class LowResolution extends TestBase {
         dateField.setResolution(Resolution.MONTH);
         dateField.addValueChangeListener(event -> getMainWindow()
                 .showNotification("Date now" + event.getValue()));
-        dateField.setImmediate(true);
         getLayout().addComponent(dateField);
 
         final DateField dateField3 = new DateField();
@@ -27,7 +25,6 @@ public class LowResolution extends TestBase {
         dateField3.setResolution(Resolution.YEAR);
         dateField3.addValueChangeListener(event -> getMainWindow()
                 .showNotification("Date now" + event.getValue()));
-        dateField3.setImmediate(true);
         getLayout().addComponent(dateField3);
 
         final InlineDateField dateField2 = new InlineDateField();
@@ -35,20 +32,8 @@ public class LowResolution extends TestBase {
         dateField2.setResolution(Resolution.MONTH);
         dateField2.addValueChangeListener(event -> getMainWindow()
                 .showNotification("Date now" + event.getValue()));
-        dateField2.setImmediate(true);
         getLayout().addComponent(dateField2);
 
-        CheckBox immediate = new CheckBox(
-                "Immediate (use sync button to change fields) ");
-        immediate.setValue(true);
-        immediate.addListener(event -> {
-            boolean newImmediate = !dateField.isImmediate();
-            dateField.setImmediate(newImmediate);
-            dateField2.setImmediate(newImmediate);
-            dateField3.setImmediate(newImmediate);
-        });
-
-        getLayout().addComponent(immediate);
         getLayout().addComponent(new Button("sync"));
 
     }
index ee9c385b0519518de98d7717fa33a75d2ea99271..8958f024dec651563531436b13c3b26216163fe7 100644 (file)
@@ -38,7 +38,6 @@ public class DragAndDropDisable extends AbstractReindeerTestUI {
 
             final CheckBox enabled = new CheckBox("Enabled", true);
             addComponent(enabled);
-            enabled.setImmediate(true);
             enabled.addValueChangeListener(
                     event -> dnd.setEnabled(event.getValue()));
 
@@ -72,7 +71,6 @@ public class DragAndDropDisable extends AbstractReindeerTestUI {
 
             final CheckBox enabled = new CheckBox("Enabled", true);
             addComponent(enabled);
-            enabled.setImmediate(true);
             enabled.addValueChangeListener(
                     event -> dnd.setEnabled(event.getValue()));
 
@@ -116,7 +114,6 @@ public class DragAndDropDisable extends AbstractReindeerTestUI {
             });
             final CheckBox enabled = new CheckBox("Enabled", true);
             addComponent(enabled);
-            enabled.setImmediate(true);
             enabled.addValueChangeListener(
                     event -> tbl.setEnabled(event.getValue()));
         }
index a93f3814d4de7a243d6066acee8495d39649f50f..8a3c009d4655b621666f4fa2f05687c8c81f79ef 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2000-2016 Vaadin Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -17,8 +17,8 @@ package com.vaadin.tests.components.formlayout;
 
 import com.vaadin.server.VaadinRequest;
 import com.vaadin.tests.components.AbstractReindeerTestUI;
-import com.vaadin.ui.FormLayout;
 import com.vaadin.ui.DateField;
+import com.vaadin.ui.FormLayout;
 
 public class FormLayoutErrorHover extends AbstractReindeerTestUI {
 
@@ -26,7 +26,6 @@ public class FormLayoutErrorHover extends AbstractReindeerTestUI {
     protected void setup(VaadinRequest request) {
         FormLayout formLayout = new FormLayout();
         DateField fromDate = new DateField("Date");
-        fromDate.setImmediate(true);
         formLayout.addComponent(fromDate);
 
         addComponent(formLayout);
index da4d77e4879092dbaa0b9c40ccda9c3ee1fb4367..368c6ac98393c6d2971b8a01274ee2794a0fa55f 100644 (file)
@@ -60,14 +60,12 @@ public class NestedFormLayouts extends AbstractReindeerTestUI {
 
         final CheckBox spacingCheckBox = new CheckBox("Spacings", false);
         spacingCheckBox.setId("spacings");
-        spacingCheckBox.setImmediate(true);
         spacingCheckBox.addValueChangeListener(
                 event -> setLayoutSpacing(spacingCheckBox.getValue()));
         addComponent(spacingCheckBox);
 
         final CheckBox marginCheckBox = new CheckBox("Margins", false);
         marginCheckBox.setId("margins");
-        marginCheckBox.setImmediate(true);
         marginCheckBox.addValueChangeListener(
                 event -> setLayoutMargin(marginCheckBox.getValue()));
         addComponent(marginCheckBox);
index eb95470db231bb8c0db9c121aec58fbc1101a2e0..b8904411642f11c31893afe975576c41b027b7a8 100644 (file)
@@ -39,14 +39,11 @@ public class GridLayoutExpandRatio extends AbstractReindeerTestUI {
         gridLayout = new GridLayout(ROWS, COLS);
         gridLayout.setHideEmptyRowsAndColumns(true);
 
-        layout.setImmediate(true);
-        gridLayout.setImmediate(true);
         gridLayout2 = new GridLayout(4, 4);
         gridLayout2.setHideEmptyRowsAndColumns(true);
         for (int i = 0; i < ROWS; i++) {
             for (int j = 0; j < COLS; j++) {
                 Label label = new Label("Slot " + i + " " + j);
-                label.setImmediate(true);
                 labels[i][j] = label;
                 gridLayout.addComponent(label, j, i);
                 if (!(i == 2 || j == 2)) {
index ef01bac0b075ebb00bebc492860b07f896c5fe62..9bd52751529ff91adf01674d6c9c925091bb7065 100644 (file)
@@ -44,7 +44,6 @@ public class GridLayoutScrollPosition extends AbstractReindeerTestUI {
                 "Hide / Show toggleable components");
         visibilityToggleCheckBox.setId("visibility-toggle");
         visibilityToggleCheckBox.setHeight("2000px");
-        visibilityToggleCheckBox.setImmediate(true);
         visibilityToggleCheckBox.setValue(false); // Initially unchecked
         gridLayout.addComponent(visibilityToggleCheckBox);
 
index 8d9f9b0c89ec82b603b4e4500cc49e828cefe52b..29c226fd8c37826505a11268f0c1a3e4638e3089 100644 (file)
@@ -50,7 +50,6 @@ public class JavaScriptResizeListener extends AbstractReindeerTestUI {
                 }));
         addComponent(new CheckBox("Listener active") {
             {
-                setImmediate(true);
                 addValueChangeListener(event -> resizeJsComponent
                         .setListenerEnabled(event.getValue()));
             }
index df2fc4b01127d7f84a3cfedebdc7488cb32bc2c2..f81eea87466b5120cce2cafa6e89604f3aab8e37 100644 (file)
@@ -51,25 +51,21 @@ public class AudioTest extends TestBase {
         checkBox.setValue(audio.isShowControls());
         checkBox.addValueChangeListener(
                 event -> audio.setShowControls(event.getValue()));
-        checkBox.setImmediate(true);
         addComponent(checkBox);
         checkBox = new CheckBox("HtmlContentAllowed");
         checkBox.setValue(audio.isHtmlContentAllowed());
         checkBox.addValueChangeListener(
                 event -> audio.setHtmlContentAllowed(event.getValue()));
-        checkBox.setImmediate(true);
         addComponent(checkBox);
         checkBox = new CheckBox("muted");
         checkBox.setValue(audio.isMuted());
         checkBox.addValueChangeListener(
                 event -> audio.setMuted(event.getValue()));
-        checkBox.setImmediate(true);
         addComponent(checkBox);
         checkBox = new CheckBox("autoplay");
         checkBox.setValue(audio.isAutoplay());
         checkBox.addValueChangeListener(
                 event -> audio.setAutoplay(event.getValue()));
-        checkBox.setImmediate(true);
         addComponent(checkBox);
 
         Button b = new Button("Change", new Button.ClickListener() {
index b3aa3643642856f9684a074ff5ef2cc9f95e021c..ce231aad3b89cdf73a18fa174983782fdfbb843a 100644 (file)
@@ -36,7 +36,6 @@ public class ReadOnlyOptionGroup extends AbstractReindeerTestUI {
         optionGroup.setNewItemsAllowed(true);
 
         final CheckBox readOnlyCheckbox = new CheckBox("read-only");
-        readOnlyCheckbox.setImmediate(true);
         readOnlyCheckbox.addValueChangeListener(
                 event -> optionGroup.setReadOnly(readOnlyCheckbox.getValue()));
         readOnlyCheckbox.setValue(Boolean.TRUE);
index 8ef5608fce7ad4a6f324ff4a09b797efef7812a8..61512eabbf301b53651b9f18003f7f5f1aa8ca7b 100644 (file)
@@ -102,7 +102,6 @@ public class BoxLayoutTest extends AbstractReindeerTestUI {
         header.addComponent(title);
 
         final CheckBox vertical = new CheckBox("Vertical", !horizontal);
-        vertical.setImmediate(true);
         vertical.addValueChangeListener(event -> {
             view.removeAllComponents();
 
@@ -200,13 +199,11 @@ public class BoxLayoutTest extends AbstractReindeerTestUI {
 
         final CheckBox margin = new CheckBox("Margin", false);
         margin.addValueChangeListener(event -> l.setMargin(event.getValue()));
-        margin.setImmediate(true);
         layout.addComponent(margin);
         layout.addComponent(margin);
 
         final CheckBox spacing = new CheckBox("Spacing", false);
         spacing.addValueChangeListener(event -> l.setSpacing(event.getValue()));
-        spacing.setImmediate(true);
         layout.addComponent(spacing);
 
         // Cell controls
@@ -238,13 +235,12 @@ public class BoxLayoutTest extends AbstractReindeerTestUI {
                 if (target == null) {
                     return;
                 }
-                l.setComponentAlignment(target, ((Alignment) align.getValue()));
+                l.setComponentAlignment(target, (Alignment) align.getValue());
             }
         });
         cell.addComponent(align);
 
         expand = new CheckBox("Expand");
-        expand.setImmediate(true);
         expand.setEnabled(false);
         expand.addValueChangeListener(event -> {
             if (target != null) {
@@ -343,7 +339,6 @@ public class BoxLayoutTest extends AbstractReindeerTestUI {
         component.addComponent(componentDescription);
 
         componentError = new CheckBox("Error");
-        componentError.setImmediate(true);
         componentError.setEnabled(false);
         componentError.addValueChangeListener(event -> {
             if (target != null) {
@@ -354,7 +349,6 @@ public class BoxLayoutTest extends AbstractReindeerTestUI {
         component.addComponent(componentError);
 
         componentRequired = new CheckBox("Required");
-        componentRequired.setImmediate(true);
         componentRequired.setEnabled(false);
         componentRequired.addValueChangeListener(event -> {
             if (target != null && target instanceof AbstractField) {
index c563673d195ec70ab63c4e4c655757c865c3c448..f1702d6b524527304c3240cd92d005537f53d2fa 100644 (file)
@@ -191,9 +191,6 @@ public class VerticalLayoutWithEmptyLabel extends AbstractReindeerTestUI {
             filterFoobarField.setMaxLength(16);
             // this.filterFoobarField.setStyleName("pexp-fixed-width");
 
-            // Configure incoming checkbox
-            incomingOnlyField.setImmediate(true);
-
             // Add filter inputs for phone # and foobar ID
             tableControlsLayout.addComponent(filterPhoneField);
             tableControlsLayout.addComponent(filterFoobarField);
index c2ca47ae7918cc3ad4eee4bfecb2bde2f3fb4dc0..4fc83a96addef8efe393d048a225a700c6807f14 100644 (file)
@@ -39,7 +39,6 @@ public class BasicPanelTest extends TestBase {
         panel.setContent(panelLayout);
 
         final CheckBox heightSelection = new CheckBox("Undefined height");
-        heightSelection.setImmediate(true);
         heightSelection.addValueChangeListener(event -> {
             if (heightSelection.getValue() == Boolean.TRUE) {
                 panel.setHeight(null);
@@ -66,7 +65,6 @@ public class BasicPanelTest extends TestBase {
 
         panel.setScrollTop(50);
         panel.setScrollLeft(50);
-        panel.setImmediate(true);
 
         updateLabelText();
     }
index 49c5a87860c4aa38dc386e42c171580218be4c0b..5b380706076375ba1bceef105af1d5032f401dab 100644 (file)
@@ -2,9 +2,9 @@ package com.vaadin.tests.components.richtextarea;
 
 import com.vaadin.server.VaadinRequest;
 import com.vaadin.tests.components.AbstractReindeerTestUI;
+import com.vaadin.ui.RichTextArea;
 import com.vaadin.v7.shared.ui.progressindicator.ProgressIndicatorServerRpc;
 import com.vaadin.v7.ui.ProgressIndicator;
-import com.vaadin.ui.RichTextArea;
 
 public class RichTextAreaUpdateWhileTyping extends AbstractReindeerTestUI {
 
@@ -30,7 +30,6 @@ public class RichTextAreaUpdateWhileTyping extends AbstractReindeerTestUI {
 
         rta = new RichTextArea();
         rta.setId("rta");
-        rta.setImmediate(true);
         addComponent(rta);
     }
 
index 6c6952ddb822f608311623a3ba99da1943f55268..188f6171069210dcd65c54d950298a6f1219e40f 100644 (file)
@@ -41,7 +41,6 @@ public class SliderUpdateFromValueChange extends AbstractReindeerTestUI {
             slider.markAsDirty();
 
         });
-        slider.setImmediate(true);
         slider.setWidth(200, Unit.PIXELS);
 
         addComponent(slider);
index e5ebef01fa2d31b405e0e176bee6b6a45559a68f..10d8ea9a8523549544ce44b00d69f64b5a334d65 100644 (file)
@@ -23,7 +23,6 @@ public class SplitPanelReversePosition extends TestBase {
 
         final HorizontalSplitPanel hsplit = new HorizontalSplitPanel();
         hsplit.setSizeFull();
-        hsplit.setImmediate(true);
         hsplit.setSplitPosition(100, Sizeable.UNITS_PIXELS, hsplitReversed);
         hsplit.addSplitterClickListener(
                 new HorizontalSplitPanel.SplitterClickListener() {
@@ -40,7 +39,6 @@ public class SplitPanelReversePosition extends TestBase {
 
         final VerticalSplitPanel vsplit = new VerticalSplitPanel();
         vsplit.setSizeFull();
-        vsplit.setImmediate(true);
         vsplit.setSplitPosition(10, Sizeable.UNITS_PERCENTAGE, vsplitReversed);
         vsplit.addSplitterClickListener(new SplitterClickListener() {
             @Override
index 8f1c70fff652047c7275af1e40b45ecbb53968ea..02789e931910a0240b66e6073e79f8944e834361 100644 (file)
@@ -15,7 +15,6 @@ public class AddItemToEmptyTable extends TestBase {
     protected void setup() {
         CheckBox cb = new CheckBox("Set first column width");
         cb.setValue(false);
-        cb.setImmediate(true);
         cb.addValueChangeListener(event -> {
             if (event.getValue()) {
                 rightTable.setColumnWidth("name", 150);
@@ -27,7 +26,6 @@ public class AddItemToEmptyTable extends TestBase {
 
         cb = new CheckBox("Set second column width");
         cb.setValue(true);
-        cb.setImmediate(true);
         cb.addValueChangeListener(event -> {
             if (event.getValue()) {
                 rightTable.setColumnWidth("info", 20);
index 33609273107447a8c13d08fed4412db17455dddf..2d3ac270d6f3e262a3818b003b73ff45f76f6ee3 100644 (file)
@@ -42,7 +42,6 @@ public class ColumnHeaderAlignments extends TestBase {
             barTable.setFooterVisible(visible);
             bazTable.setFooterVisible(visible);
         });
-        footers.setImmediate(true);
         addComponent(footers);
         HorizontalLayout tables = new HorizontalLayout();
         fooTable = createTable(null);
index 6bc84db6e9ab90546e5ad09ac17c14a95ee75e38..9bcbd6e2f548682cd9daede7f861dfeab6fd1d3b 100644 (file)
@@ -38,12 +38,10 @@ public class DoublesInTable extends TestBase {
     @Override
     protected void setup() {
         editMode = new CheckBox("Edit mode");
-        editMode.setImmediate(true);
         editMode.addValueChangeListener(
                 event -> table.setEditable(editMode.getValue()));
 
         useCustomConverters = new CheckBox("Use custom converters");
-        useCustomConverters.setImmediate(true);
         useCustomConverters.addValueChangeListener(event -> recreateTable());
 
         localeSelect = createLocaleSelect();
@@ -77,23 +75,22 @@ public class DoublesInTable extends TestBase {
     }
 
     private static BeanItemContainer<Person> createContainer(int nr) {
-        BeanItemContainer<Person> bic = new BeanItemContainer<>(
-                Person.class);
+        BeanItemContainer<Person> bic = new BeanItemContainer<>(Person.class);
         for (int i = 1; i <= nr; i++) {
             Person p = new Person();
             p.setFirstName("First " + i);
             p.setLastName("Last " + i);
             p.setAge(i);
-            p.setDeceased((i % 5 - 2) == 0);
+            p.setDeceased(i % 5 - 2 == 0);
             p.setEmail("person" + i + "@mail.com");
             p.setRent(new BigDecimal(i * 1250.25));
             p.setSalary(3000 + i);
-            p.setSex((i % 4) == 0 ? Sex.MALE : Sex.FEMALE);
+            p.setSex(i % 4 == 0 ? Sex.MALE : Sex.FEMALE);
             p.setBirthDate(new Date(2011 - 1900 - p.getAge(), 11 - 1, 24));
             if (i % 42 == 0) {
                 p.setSex(Sex.UNKNOWN);
             }
-            String city = "City " + (i / 10);
+            String city = "City " + i / 10;
             Country country = Country.FINLAND;
             Address address = new Address("Street " + i, 12345 + i * 2, city,
                     country);
index 1b142e5f6bd607e59064d9e4f932df9f445b0df0..1460d184dc932877a921c403399b12076f0ebc38 100644 (file)
@@ -83,7 +83,6 @@ public class EditableTableLeak extends TestBase {
     @Override
     protected void setup() {
         addComponent(useFieldFactory);
-        useFieldFactory.setImmediate(true);
         useFieldFactory.addValueChangeListener(event -> {
             if (useFieldFactory.getValue()) {
                 table.setTableFieldFactory(new CachingFieldFactory());
index 015a8c213aed9463acbbd71c7bd8d6fea0427713..3c122bc844359045178c72cc05284f560160ec15 100644 (file)
@@ -137,7 +137,6 @@ public class EmptyRowsWhenScrolling extends UI {
         private AbsoluteLayout buildMainLayout() {
             // common part: create layout
             mainLayout = new AbsoluteLayout();
-            mainLayout.setImmediate(false);
             mainLayout.setWidth("100%");
             mainLayout.setHeight("100%");
 
@@ -156,7 +155,6 @@ public class EmptyRowsWhenScrolling extends UI {
         private VerticalLayout buildVerticalLayout_1() {
             // common part: create layout
             verticalLayout_1 = new VerticalLayout();
-            verticalLayout_1.setImmediate(false);
             verticalLayout_1.setWidth("100.0%");
             verticalLayout_1.setHeight("100.0%");
             verticalLayout_1.setMargin(false);
@@ -180,7 +178,6 @@ public class EmptyRowsWhenScrolling extends UI {
         private HorizontalLayout buildHorizontalLayout_1() {
             // common part: create layout
             horizontalLayout_1 = new HorizontalLayout();
-            horizontalLayout_1.setImmediate(false);
             horizontalLayout_1.setWidth("100.0%");
             horizontalLayout_1.setHeight("-1px");
             horizontalLayout_1.setMargin(false);
@@ -188,7 +185,6 @@ public class EmptyRowsWhenScrolling extends UI {
             // btnRefreshTable
             setBtnRefreshTable(new Button());
             getBtnRefreshTable().setCaption("Reload table row cache");
-            getBtnRefreshTable().setImmediate(false);
             getBtnRefreshTable().setWidth("-1px");
             getBtnRefreshTable().setHeight("-1px");
             horizontalLayout_1.addComponent(getBtnRefreshTable());
index 4ba73268f4f1a6aa954ac52574fd6581970643ca..185780606c01cc20da06debf60f611ba2cb30166 100644 (file)
@@ -46,14 +46,12 @@ public class Footer extends AbstractReindeerTestUI {
         options.setSpacing(true);
 
         final CheckBox visible = new CheckBox("Footers Visible", true);
-        visible.setImmediate(true);
         visible.addValueChangeListener(
                 event -> table.setFooterVisible(visible.getValue()));
 
         options.addComponent(visible);
 
         final TextField footer1Value = new TextField(null, "Footer1");
-        footer1Value.setImmediate(true);
         Button footer1Btn = new Button("Change", new Button.ClickListener() {
             @Override
             public void buttonClick(ClickEvent event) {
@@ -67,7 +65,6 @@ public class Footer extends AbstractReindeerTestUI {
         options.addComponent(footer1);
 
         final TextField footer2Value = new TextField(null, "Footer2");
-        footer2Value.setImmediate(true);
         Button footer2Btn = new Button("Change", new Button.ClickListener() {
             @Override
             public void buttonClick(ClickEvent event) {
@@ -81,7 +78,6 @@ public class Footer extends AbstractReindeerTestUI {
         options.addComponent(footer2);
 
         final TextField footer3Value = new TextField(null, "Footer3");
-        footer3Value.setImmediate(true);
         Button footer3Btn = new Button("Change", new Button.ClickListener() {
             @Override
             public void buttonClick(ClickEvent event) {
index aa80d15af88187e6b5eef2ba27a1e97de10de4fe..438e102d419c836537269eb84fef337942204d34 100644 (file)
@@ -44,14 +44,12 @@ public class FooterClick extends AbstractTestUIWithLog {
         });
 
         CheckBox immediateCheckbox = new CheckBox("Immediate");
-        immediateCheckbox.setImmediate(true);
         immediateCheckbox.setValue(table.isImmediate());
         immediateCheckbox.addValueChangeListener(
                 event -> table.setImmediate(event.getValue()));
 
         CheckBox columnReorderingCheckbox = new CheckBox(
                 "Column reordering allowed");
-        columnReorderingCheckbox.setImmediate(true);
         columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
         columnReorderingCheckbox.addValueChangeListener(
                 event -> table.setColumnReorderingAllowed(event.getValue()));
index 2325d091927b3d064312166624f3bb89a68afc36..80a75bdb9d5dd9dc9a562ec03e0d4d2fd15ffad0 100644 (file)
@@ -33,20 +33,17 @@ public class HeaderClick extends AbstractReindeerTestUI {
         });
 
         CheckBox immediateCheckbox = new CheckBox("Immediate");
-        immediateCheckbox.setImmediate(true);
         immediateCheckbox.setValue(table.isImmediate());
         immediateCheckbox.addValueChangeListener(
                 event -> table.setImmediate(event.getValue()));
 
         CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
-        sortEnabledCheckbox.setImmediate(true);
         sortEnabledCheckbox.setValue(table.isSortEnabled());
         sortEnabledCheckbox.addValueChangeListener(
                 event -> table.setSortEnabled(event.getValue()));
 
         CheckBox columnReorderingCheckbox = new CheckBox(
                 "Column reordering allowed");
-        columnReorderingCheckbox.setImmediate(true);
         columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
         columnReorderingCheckbox.addValueChangeListener(
                 event -> table.setColumnReorderingAllowed(event.getValue()));
index 8263b481eb786ccb3c15aa21f0c503fc5a4f35ed..52554e26a4f4a6314073787158272e4b47f259e6 100644 (file)
@@ -27,14 +27,12 @@ public class HeaderFooterClickLeftRightMiddle extends AbstractTestUIWithLog {
         table.setFooterVisible(true);
 
         CheckBox immediateCheckbox = new CheckBox("Immediate");
-        immediateCheckbox.setImmediate(true);
         immediateCheckbox.setValue(table.isImmediate());
         immediateCheckbox.addValueChangeListener(
                 event -> table.setImmediate(event.getValue()));
 
         CheckBox headerClickListenerCheckbox = new CheckBox(
                 "Header click listener");
-        headerClickListenerCheckbox.setImmediate(true);
         headerClickListenerCheckbox.addValueChangeListener(
                 new HasValue.ValueChangeListener<Boolean>() {
 
@@ -66,7 +64,6 @@ public class HeaderFooterClickLeftRightMiddle extends AbstractTestUIWithLog {
 
         CheckBox footerClickListenerCheckbox = new CheckBox(
                 "Footer click listener");
-        footerClickListenerCheckbox.setImmediate(true);
         footerClickListenerCheckbox.addValueChangeListener(
                 new HasValue.ValueChangeListener<Boolean>() {
 
@@ -96,14 +93,12 @@ public class HeaderFooterClickLeftRightMiddle extends AbstractTestUIWithLog {
         footerClickListenerCheckbox.setValue(true);
 
         CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
-        sortEnabledCheckbox.setImmediate(true);
         sortEnabledCheckbox.setValue(table.isSortEnabled());
         sortEnabledCheckbox.addValueChangeListener(
                 event -> table.setSortEnabled(event.getValue()));
 
         CheckBox columnReorderingCheckbox = new CheckBox(
                 "Column reordering allowed");
-        columnReorderingCheckbox.setImmediate(true);
         columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
         columnReorderingCheckbox.addValueChangeListener(
                 event -> table.setColumnReorderingAllowed(event.getValue()));
index 2da88f74dd8bee1a8fe90166af9318c3b85d3ec6..af894cf61ef3da13d5211ef8d256f6e182e8e58c 100644 (file)
@@ -22,7 +22,6 @@ public class HeaderPositionWhenSorting extends AbstractReindeerTestUI
     @Override
     protected void setup(VaadinRequest request) {
         CheckBox cb = new CheckBox("Item click listener");
-        cb.setImmediate(true);
         cb.addValueChangeListener(event -> {
             if (event.getValue()) {
                 table.addItemClickListener(HeaderPositionWhenSorting.this);
@@ -33,7 +32,6 @@ public class HeaderPositionWhenSorting extends AbstractReindeerTestUI
         addComponent(cb);
 
         CheckBox cbActionHandler = new CheckBox("Action handler");
-        cbActionHandler.setImmediate(true);
         cbActionHandler.addValueChangeListener(event -> {
             if (event.getValue()) {
                 table.addActionHandler(HeaderPositionWhenSorting.this);
@@ -45,7 +43,6 @@ public class HeaderPositionWhenSorting extends AbstractReindeerTestUI
 
         CheckBox cbActionHasActions = new CheckBox(
                 "Action handler has actions");
-        cbActionHasActions.setImmediate(true);
         cbActionHasActions.addValueChangeListener(event -> {
             actionHandlerHasActions = event.getValue();
 
index b9e9c2949e3f0caffd1f812dc493f1a8b9b293df..a3f2ddaceaafccdfbfc417ad10f9aa9b5d51bb05 100644 (file)
@@ -27,7 +27,6 @@ public class HeaderUpdateWhenNoRows extends AbstractReindeerTestUI {
             }
         });
 
-        showHeaders.setImmediate(true);
         showHeaders.setValue(true);
 
         addComponent(showHeaders);
index 5f082080d30da55baa8d58a91228ea545368311f..f5e62adfc86fa2bb9deb84f16140e28dee86dcb8 100644 (file)
@@ -137,7 +137,6 @@ public class ItemClickEvents extends AbstractReindeerTestUI {
         CheckBox b = new CheckBox("immediate");
         b.setValue(c.isImmediate());
         b.addValueChangeListener(event -> c.setImmediate(event.getValue()));
-        b.setImmediate(true);
         layout.addComponent(b);
         b = new CheckBox("selectable");
         if (c instanceof Table) {
@@ -149,18 +148,15 @@ public class ItemClickEvents extends AbstractReindeerTestUI {
             b.addValueChangeListener(
                     event -> ((Tree) c).setSelectable(event.getValue()));
         }
-        b.setImmediate(true);
         layout.addComponent(b);
         b = new CheckBox("nullsel");
         b.setValue(c.isNullSelectionAllowed());
         b.addValueChangeListener(
                 event -> c.setNullSelectionAllowed(event.getValue()));
-        b.setImmediate(true);
         layout.addComponent(b);
         b = new CheckBox("multi");
         b.setValue(c.isMultiSelect());
         b.addValueChangeListener(event -> c.setMultiSelect(event.getValue()));
-        b.setImmediate(true);
         layout.addComponent(b);
         return layout;
     }
index eedb4140703e67b910c1c85761bffded86eca411..89b4b46da4299fcc2f9c59a7fddb154a0353bf96 100644 (file)
@@ -20,7 +20,6 @@ public class TableAndBrowserContextMenu extends TestBase
     @Override
     public void setup() {
         CheckBox cb = new CheckBox("Item click listener");
-        cb.setImmediate(true);
         cb.addValueChangeListener(event -> {
             if (event.getValue()) {
                 table.addListener(TableAndBrowserContextMenu.this);
@@ -31,7 +30,6 @@ public class TableAndBrowserContextMenu extends TestBase
         addComponent(cb);
 
         CheckBox cbActionHandler = new CheckBox("Action handler");
-        cbActionHandler.setImmediate(true);
         cbActionHandler.addValueChangeListener(event -> {
             if (event.getValue()) {
                 table.addActionHandler(TableAndBrowserContextMenu.this);
@@ -43,7 +41,6 @@ public class TableAndBrowserContextMenu extends TestBase
 
         CheckBox cbActionHasActions = new CheckBox(
                 "Action handler has actions");
-        cbActionHasActions.setImmediate(true);
         cbActionHasActions.addValueChangeListener(event -> {
             actionHandlerHasActions = event.getValue();
 
index bb272ac91024781ea8ec43c1f4c4710a49bbe9a6..cc741fadc1ee8475fe8f008cf7680d1bec682dfb 100644 (file)
@@ -47,7 +47,6 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase {
             }
         });
         showHeaders.setValue(true);
-        showHeaders.setImmediate(true);
 
         mainWindow.addComponent(showHeaders);
         mainWindow.addComponent(table);
index 9aab0303b6a36ddf2144e709ff6d5e7a85e4b34a..b2b4bb12cd07a4ace4d56767b845bbec083e7c6b 100644 (file)
@@ -29,18 +29,15 @@ public class TableItemDescriptionGeneratorUI extends AbstractReindeerTestUI {
         componentDescription
                 .addValueChangeListener(event -> table.setContainerDataSource(
                         createContainer(componentDescription.getValue())));
-        componentDescription.setImmediate(true);
         componentDescription.setValue(true);
         tableCellItemDescription = new CheckBox("Tooltip on table cells");
         tableCellItemDescription
                 .addValueChangeListener(event -> table.refreshRowCache());
-        tableCellItemDescription.setImmediate(true);
         tableCellItemDescription.setValue(true);
 
         tableRowItemDescription = new CheckBox("Tooltip on table Rows");
         tableRowItemDescription
                 .addValueChangeListener(event -> table.refreshRowCache());
-        tableRowItemDescription.setImmediate(true);
         tableRowItemDescription.setValue(true);
 
         addComponent(componentDescription);
index d289798c3dda887429a1f35b128d8dd34d4920ec..5f1c8b4283a0fabd411434c0272ed09aa1ad62ac 100644 (file)
@@ -10,7 +10,6 @@ public class TableScrollOnFocus extends TestBase {
         final Table table = new Table();
         final CheckBox chkSelectable = new CheckBox("selectable");
 
-        chkSelectable.setImmediate(true);
         chkSelectable.addValueChangeListener(
                 event -> table.setSelectable(chkSelectable.getValue()));
 
index 4b68467091bda84bc22b5763cf05818ada37a22b..53bb8e25df66b49e49f4d9ccc28e9209a76bce93 100644 (file)
@@ -91,7 +91,6 @@ public class TableUndefinedSize extends TestBase {
                 log.log("Column 1 hidden");
             }
         });
-        cb.setImmediate(true);
         visibilities.addComponent(cb);
 
         cb = new CheckBox("Column 2");
@@ -106,7 +105,6 @@ public class TableUndefinedSize extends TestBase {
                 log.log("Column 2 hidden");
             }
         });
-        cb.setImmediate(true);
         visibilities.addComponent(cb);
 
         cb = new CheckBox("Column 3");
@@ -122,7 +120,6 @@ public class TableUndefinedSize extends TestBase {
                 log.log("Column 3 hidden");
             }
         });
-        cb.setImmediate(true);
         visibilities.addComponent(cb);
 
         addComponent(log);
index 632facee44de0f97c3b464c1201534e7e57897ed..05da1f3f8134064f0957934ca5ceb0e21311f0a3 100644 (file)
@@ -92,9 +92,6 @@ public class TableWithBrokenGeneratorAndContainer extends TestBase {
 
     @Override
     protected void setup() {
-        brokenContainer.setImmediate(true);
-        brokenGenerator.setImmediate(true);
-        clearTableOnError.setImmediate(true);
         clearTableOnError.addValueChangeListener(event -> {
             Boolean value = clearTableOnError.getValue();
             setErrorHandler(value != null ? value : false);
index 71775c0ad9830892df9e7dc76403ae95ef0b8691..9fbb0256b72ec684501a2519f1d30fc2ac15c40b 100644 (file)
@@ -35,7 +35,6 @@ public class ValueAfterClearingContainer extends TestBase {
 
         addComponent(table);
         final CheckBox multiselect = new CheckBox("Multiselect");
-        multiselect.setImmediate(true);
         multiselect.setId("multiselect");
         multiselect.addValueChangeListener(event -> {
             Boolean value = multiselect.getValue();
index b393ff3105f647de6cc6e4eb057a9d76c81870af..8503f82479242b171a46df6072aa13ab9f70855c 100644 (file)
@@ -37,7 +37,6 @@ public class Wordwrap extends TestBase {
                 area2.setCaption("Nonwrapping");
             }
         });
-        onoff.setImmediate(true);
 
         addComponent(onoff);
     }
index 374ab40e3f500aeede0a92604c0134954b483ff8..4b39ed86379495c92b572ce6bbb27ce762f6f031 100644 (file)
@@ -33,7 +33,6 @@ public class SelectionAndCursorPosition extends AbstractReindeerTestUI {
         Panel panel = new Panel(fl);
         panel.setCaption("Hackers panel");
         CheckBox ml = new CheckBox("Multiline");
-        ml.setImmediate(true);
         // FIXME re-add this when TextArea has been replaced with vaadin8
         // version
         // ml.addListener(new Property.ValueChangeListener() {
index cd08db9cd9a45f43af2a34c1bb23f9c5e1596119..7076e6c03e0ec32c10289916c1bfae2cdfdcdc7a 100644 (file)
@@ -24,7 +24,6 @@ public class SetTabIndex extends TestBase {
         addComponent(field0);
 
         final CheckBox readonly = new CheckBox("Readonly");
-        readonly.setImmediate(true);
         readonly.addValueChangeListener(event -> {
             boolean newReadonly = event.getValue();
             field1.setReadOnly(newReadonly);
index 84eefedde143d715fca7e57d7388c6371e611923..6329d6fdd0fb9e36a7c5a364d4c7ada935d23c68 100644 (file)
@@ -36,7 +36,7 @@ public class TextFieldFocusAndBlurListeners extends TestBase
         TextField tf2 = new TextField("TextField 2",
                 "Has focus, blur and valuechange listeners");
         tf2.setWidth("300px");
-        tf2.addValueChangeListener(l -> this.valueChange(tf2));
+        tf2.addValueChangeListener(l -> valueChange(tf2));
         tf2.addFocusListener(this);
         tf2.addBlurListener(this);
 
@@ -45,15 +45,14 @@ public class TextFieldFocusAndBlurListeners extends TestBase
         TextField tf3 = new TextField("TextField 3",
                 "Has non-immediate valuechange listener");
         tf3.setWidth("300px");
-        tf3.addValueChangeListener(l -> this.valueChange(tf3));
+        tf3.addValueChangeListener(l -> valueChange(tf3));
 
         addComponent(tf3);
 
         TextField tf4 = new TextField("TextField 4",
                 "Has immediate valuechange listener");
         tf4.setWidth("300px");
-        tf4.setImmediate(true);
-        tf4.addValueChangeListener(l -> this.valueChange(tf4));
+        tf4.addValueChangeListener(l -> valueChange(tf4));
 
         addComponent(tf4);
     }
index d721fb5a4ad22946aaece0d25ebb3a0c94e1a629..b278afa89217d26624f082fa78f055bad31712be 100644 (file)
@@ -25,7 +25,6 @@ public class TextFieldInputPromptAndClickShortcut extends TestBase {
         button.setClickShortcut(KeyCode.ESCAPE);
 
         final CheckBox inputPromptSelection = new CheckBox("Input prompt");
-        inputPromptSelection.setImmediate(true);
         inputPromptSelection.addValueChangeListener(event -> {
             if (event.getValue()) {
                 textField.setInputPrompt("Input prompt");
@@ -34,7 +33,6 @@ public class TextFieldInputPromptAndClickShortcut extends TestBase {
             }
             log.log("Set input prompt: " + textField.getInputPrompt());
         });
-        inputPromptSelection.setImmediate(true);
 
         addComponent(textField);
         addComponent(button);
index cd1c49c62d9d29de77535e3f5a67605bb26a0072..1c7596179576e0d852fc8232412a855b2417f916 100644 (file)
@@ -22,7 +22,6 @@ public class TreeConnectors extends TestBase {
     protected void setup() {
         CheckBox cb = new CheckBox("Connectors");
         cb.setValue(false);
-        cb.setImmediate(true);
         cb.addValueChangeListener(event -> {
             if (event.getValue()) {
                 tree.addStyleName(BaseTheme.TREE_CONNECTORS);
index 9d15e2f3a1e558c270f3adaa36452ae60b3d4517..f4d90d6e9b7c760822ba52e081eba1635fd0d990 100644 (file)
@@ -42,7 +42,6 @@ public class TreeFiltering extends TestBase {
 
         final CheckBox filterType = new CheckBox(
                 "Include parent when filtering", true);
-        filterType.setImmediate(true);
         filterType.addValueChangeListener(event -> {
             cont.setIncludeParentsWhenFiltering(event.getValue());
             ccTree.markAsDirty();
index 33408d31db5af82f48b466641599e4a19cafa8fa..3bef55450a0498f4399fe63f9eb2a41dd3c6329c 100644 (file)
@@ -39,7 +39,6 @@ public class IdOverrideTest extends AbstractReindeerTestUI {
         final IdTestLabel idTestLabelWithId = new IdTestLabel("set id");
         idTestLabelWithId.setSizeUndefined();
         idTestLabelWithId.setId("set10179");
-        idTestLabelWithId.setImmediate(true);
         addComponent(idTestLabelWithId);
 
         final Label label = new Label("no id");
@@ -66,7 +65,6 @@ public class IdOverrideTest extends AbstractReindeerTestUI {
             }
         });
         button.setId("toggle");
-        button.setImmediate(true);
         addComponent(button);
     }
 
diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/LazyWindowResize.java b/uitest/src/main/java/com/vaadin/tests/components/window/LazyWindowResize.java
deleted file mode 100644 (file)
index cf9eb1b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.vaadin.tests.components.window;
-
-import com.vaadin.server.Page.BrowserWindowResizeEvent;
-import com.vaadin.server.Page.BrowserWindowResizeListener;
-import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.tests.components.AbstractTestCase;
-import com.vaadin.tests.util.Log;
-import com.vaadin.tests.util.LoremIpsum;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.LegacyWindow;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.ResizeEvent;
-import com.vaadin.ui.Window.ResizeListener;
-
-public class LazyWindowResize extends AbstractTestCase {
-
-    private LegacyWindow mainWindow;
-    private Window subWindow;
-    private CheckBox lazyMode;
-    private Log log = new Log(5);
-    private CheckBox resizeListenerCheckBox;
-
-    protected ResizeListener resizeListener = new ResizeListener() {
-
-        @Override
-        public void windowResized(ResizeEvent e) {
-            log.log("Sub window resized");
-        }
-    };
-
-    protected BrowserWindowResizeListener browserWindowResizeListener = new BrowserWindowResizeListener() {
-        @Override
-        public void browserWindowResized(BrowserWindowResizeEvent event) {
-            log.log("Main window resized");
-        }
-    };
-
-    private CheckBox immediateCheckBox;
-
-    @Override
-    protected String getDescription() {
-        return "Check or uncheck the checkbox to use lazy or eager resize events. Lazy mode uses a small delay before recalculating layout sizes and can be used to speed up resizes in slow UIs.";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return 6715;
-    }
-
-    @Override
-    public void init() {
-        mainWindow = new LegacyWindow("Resize test");
-        setMainWindow(mainWindow);
-        VerticalLayout layout = new VerticalLayout();
-        layout.setMargin(true);
-        subWindow = new Window("Sub window", layout);
-        subWindow.setHeight("50%");
-        subWindow.setWidth("50%");
-        subWindow.center();
-        layout.addComponent(new Label(LoremIpsum.get(1000)));
-        getMainWindow().addWindow(subWindow);
-
-        lazyMode = new CheckBox("Lazy resize");
-        lazyMode.setImmediate(true);
-        lazyMode.addValueChangeListener(event -> setLazy(lazyMode.getValue()));
-
-        resizeListenerCheckBox = new CheckBox("Resize listener");
-        resizeListenerCheckBox.setImmediate(true);
-        resizeListenerCheckBox.addValueChangeListener(event -> {
-            if (resizeListenerCheckBox.getValue()) {
-                subWindow.addResizeListener(resizeListener);
-                mainWindow.addListener(browserWindowResizeListener);
-            } else {
-                subWindow.removeResizeListener(resizeListener);
-                mainWindow.removeListener(browserWindowResizeListener);
-            }
-        });
-        immediateCheckBox = new CheckBox("Windows immediate");
-        immediateCheckBox.setImmediate(true);
-        immediateCheckBox.addValueChangeListener(event -> {
-            mainWindow.setImmediate(immediateCheckBox.getValue());
-            subWindow.setImmediate(immediateCheckBox.getValue());
-        });
-        mainWindow.addComponent(lazyMode);
-        mainWindow.addComponent(resizeListenerCheckBox);
-        mainWindow.addComponent(immediateCheckBox);
-        mainWindow.addComponent(log);
-        mainWindow.addComponent(new Label("<br/><br/>", ContentMode.HTML));
-        mainWindow.addComponent(new Label(LoremIpsum.get(10000)));
-
-        setLazy(false);
-    }
-
-    private void setLazy(boolean b) {
-        mainWindow.setResizeLazy(b);
-        subWindow.setResizeLazy(b);
-    }
-
-}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/WindowResizeListener.java b/uitest/src/main/java/com/vaadin/tests/components/window/WindowResizeListener.java
deleted file mode 100644 (file)
index 3a9b4a9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.vaadin.tests.components.window;
-
-import com.vaadin.server.Page;
-import com.vaadin.server.Page.BrowserWindowResizeEvent;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-
-public class WindowResizeListener extends TestBase {
-
-    @Override
-    protected String getDescription() {
-        return "Size changes from windows (both sub "
-                + "and browsers level) should get back to server."
-                + " If size changes, a separate server side event should occur.";
-    }
-
-    @Override
-    protected Integer getTicketNumber() {
-        return null;
-    }
-
-    Window subwin = new ResizeListenerWindow();
-
-    @Override
-    protected void setup() {
-
-        final Label l = new Label();
-        getLayout().addComponent(l);
-
-        getMainWindow().addListener(new Page.BrowserWindowResizeListener() {
-            @Override
-            public void browserWindowResized(BrowserWindowResizeEvent event) {
-                l.setValue("Current browser window size: "
-                        + getMainWindow().getBrowserWindowWidth() + " x "
-                        + getMainWindow().getBrowserWindowHeight());
-            }
-        });
-
-        CheckBox subwindow = new CheckBox("show subwindow");
-        subwindow.setImmediate(true);
-        subwindow.addValueChangeListener(event -> {
-            if (event.getValue()) {
-                getMainWindow().addWindow(subwin);
-            } else {
-                getMainWindow().removeWindow(subwin);
-            }
-        });
-        getLayout().addComponent(subwindow);
-
-        CheckBox immediate = new CheckBox("immediate");
-        immediate.addValueChangeListener(event -> {
-            boolean booleanValue = event.getValue();
-            getMainWindow().setImmediate(booleanValue);
-            subwin.setImmediate(booleanValue);
-        });
-        immediate.setImmediate(true);
-        immediate.setValue(true);
-        getMainWindow().setImmediate(true);
-        subwin.setImmediate(true);
-        getLayout().addComponent(immediate);
-
-        getLayout().addComponent(new Button("Sync"));
-
-    }
-}
-
-class ResizeListenerWindow extends Window {
-    Label sizeLabel = new Label();
-
-    public ResizeListenerWindow() {
-        super("Subwindow", new VerticalLayout());
-        setWidth("400px");
-
-        VerticalLayout hl = (VerticalLayout) getContent();
-        hl.setMargin(true);
-        hl.addComponent(new Label("Current size: "));
-        hl.addComponent(sizeLabel);
-
-        addResizeListener(new ResizeListener() {
-            @Override
-            public void windowResized(ResizeEvent e) {
-                updateLabel();
-            }
-        });
-
-        updateLabel();
-    }
-
-    public void updateLabel() {
-        sizeLabel.setValue(getWidth() + getWidthUnits().getSymbol() + " x "
-                + getHeight() + getHeightUnits().getSymbol());
-    }
-}
index a423fbef0eac9b1b260c17b97530cc4f366d306b..d1e25442576dde0bda4b9900bf7c7d7f8a68c679 100644 (file)
@@ -92,7 +92,6 @@ public class BeanItemContainerFilteringTest extends TestBase {
                             filterString.getValue().toString(), false, false);
                 }
             });
-            cb.setImmediate(true);
             vl.addComponent(cb);
 
             nextLabel = new Label();
@@ -112,7 +111,6 @@ public class BeanItemContainerFilteringTest extends TestBase {
                             nextLabel.setCaption("Next id: " + nextToAdd);
                         }
                     });
-            addItemButton.setImmediate(true);
             vl.addComponent(addItemButton);
 
             final Button addItemAfterButton = new Button("addItemAfter()",
@@ -136,7 +134,6 @@ public class BeanItemContainerFilteringTest extends TestBase {
                             nextLabel.setCaption("Next id: " + nextToAdd);
                         }
                     });
-            addItemAfterButton.setImmediate(true);
             vl.addComponent(addItemAfterButton);
 
             position = new TextField("Position:", "0");
@@ -162,7 +159,6 @@ public class BeanItemContainerFilteringTest extends TestBase {
                             nextLabel.setCaption("Next id: " + nextToAdd);
                         }
                     });
-            addItemAtButton.setImmediate(true);
             vl.addComponent(addItemAtButton);
 
             getLayout().addComponent(table);
index d6d5d3309aa29dc4b9f72a30c7a6d1dc60c6c548..ceaca59143188c783f2c125b8a187137e489829b 100644 (file)
@@ -59,7 +59,6 @@ public class IndexedContainerFilteringTest extends TestBase {
                         filterString.getValue().toString(), false, false);
             }
         });
-        cb.setImmediate(true);
         vl.addComponent(cb);
 
         nextLabel = new Label();
@@ -81,7 +80,6 @@ public class IndexedContainerFilteringTest extends TestBase {
                         nextLabel.setCaption("Next id: " + nextToAdd);
                     }
                 });
-        addItemButton.setImmediate(true);
         vl.addComponent(addItemButton);
 
         final Button addItemAfterButton = new Button("addItemAfter()",
@@ -106,7 +104,6 @@ public class IndexedContainerFilteringTest extends TestBase {
                         nextLabel.setCaption("Next id: " + nextToAdd);
                     }
                 });
-        addItemAfterButton.setImmediate(true);
         vl.addComponent(addItemAfterButton);
 
         position = new TextField("Position:", "0");
@@ -132,7 +129,6 @@ public class IndexedContainerFilteringTest extends TestBase {
                         nextLabel.setCaption("Next id: " + nextToAdd);
                     }
                 });
-        addItemAtButton.setImmediate(true);
         vl.addComponent(addItemAtButton);
 
         getLayout().addComponent(table);
index eec30f5b40a3ac60bbe7843d8170d537befc6748..6ebffe70299c7d9c7323a6f2fb8d96af2a508855 100644 (file)
@@ -33,13 +33,11 @@ public class TreeDragStart extends TestBase {
         final Tree tree = new Tree("Inventory");
 
         CheckBox checkBox = new CheckBox("Enabled");
-        checkBox.setImmediate(true);
         checkBox.setValue(true);
         checkBox.addValueChangeListener(
                 event -> tree.setEnabled(!tree.isEnabled()));
         addComponent(checkBox);
         checkBox = new CheckBox("Drag start");
-        checkBox.setImmediate(true);
         checkBox.setValue(true);
         checkBox.addValueChangeListener(event -> {
             if (event.getValue()) {
@@ -99,8 +97,7 @@ public class TreeDragStart extends TestBase {
                 if (sourceItemId instanceof BeanItem<?>) {
                     beanItem = (BeanItem<?>) sourceItemId;
                 } else if (sourceItemId instanceof InventoryObject) {
-                    beanItem = new BeanItem<>(
-                            (InventoryObject) sourceItemId);
+                    beanItem = new BeanItem<>((InventoryObject) sourceItemId);
                 }
 
                 // Remove the item from the source container and
index 8a9449768620f333b73e3b7be9cd4a850aee98b1..5c8692ce1ca672315305bd38c76056eb4e28bac0 100644 (file)
@@ -16,7 +16,6 @@ public class EmbedSizeTest extends TestBase {
         LegacyWindow mainWindow = getMainWindow();
         mainWindow.setSizeUndefined();
         mainWindow.getContent().setSizeUndefined();
-        mainWindow.setImmediate(true);
 
         CheckBox lazyCheckBox = new CheckBox("Lazy resize");
         lazyCheckBox.addValueChangeListener(event -> {
@@ -25,7 +24,6 @@ public class EmbedSizeTest extends TestBase {
             log.log("Resize lazy: " + resizeLazy);
         });
         lazyCheckBox.setValue(Boolean.FALSE);
-        lazyCheckBox.setImmediate(true);
         addComponent(lazyCheckBox);
 
         addComponent(log);
index 77373c723e6e1210bae4165cb5e4abf8211ea6c5..b6df3d34c388b3b73e6d77669fa085159af6876e 100644 (file)
@@ -79,7 +79,6 @@ public class CaptionsInLayouts extends AbstractReindeerTestUI {
 
     private Component toggleRequired() {
         CheckBox requiredToggle = new CheckBox();
-        requiredToggle.setImmediate(true);
         requiredToggle.setCaption("Required");
         requiredToggle
                 .addValueChangeListener(event -> setRequired(event.getValue()));
@@ -88,7 +87,6 @@ public class CaptionsInLayouts extends AbstractReindeerTestUI {
 
     private Component toggleIcon() {
         CheckBox iconToggle = new CheckBox();
-        iconToggle.setImmediate(true);
         iconToggle.setCaption("Icons");
         iconToggle.addValueChangeListener(event -> setIcon(event.getValue()));
         return iconToggle;
@@ -114,7 +112,6 @@ public class CaptionsInLayouts extends AbstractReindeerTestUI {
 
     private Component toggleError() {
         CheckBox errorToggle = new CheckBox();
-        errorToggle.setImmediate(true);
         errorToggle.setCaption("Error");
         errorToggle.addValueChangeListener(event -> setError(event.getValue()));
         return errorToggle;
index 82752d67d4432b5deaf9bb52305835a527d467b6..b995fe9093913ecd259d7196387bb97e37869fda 100644 (file)
@@ -87,7 +87,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleRequired() {
         CheckBox requiredToggle = new CheckBox();
-        requiredToggle.setImmediate(true);
         requiredToggle.setCaption("Required");
         requiredToggle
                 .addValueChangeListener(event -> setRequired(event.getValue()));
@@ -96,7 +95,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleIcon() {
         CheckBox iconToggle = new CheckBox();
-        iconToggle.setImmediate(true);
         iconToggle.setCaption("Icons");
         iconToggle.addValueChangeListener(event -> setIcon(event.getValue()));
         return iconToggle;
@@ -104,7 +102,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleReadOnly() {
         CheckBox readOnlyToggle = new CheckBox();
-        readOnlyToggle.setImmediate(true);
         readOnlyToggle.setCaption("Read only");
         readOnlyToggle
                 .addValueChangeListener(event -> setReadOnly(event.getValue()));
@@ -114,7 +111,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleEnabled() {
         CheckBox enabledToggle = new CheckBox();
-        enabledToggle.setImmediate(true);
         enabledToggle.setValue(true);
         enabledToggle.setCaption("Enabled");
         enabledToggle
@@ -125,7 +121,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleInvalid() {
         CheckBox invalid = new CheckBox("Invalid");
-        invalid.setImmediate(true);
         invalid.addValueChangeListener(event -> setInvalid(event.getValue()));
 
         return invalid;
@@ -177,7 +172,6 @@ public class CaptionsInLayoutsWaiAria extends TestBase {
 
     private Component toggleError() {
         CheckBox errorToggle = new CheckBox();
-        errorToggle.setImmediate(true);
         errorToggle.setCaption("Error");
         errorToggle.addValueChangeListener(event -> setError(event.getValue()));
         return errorToggle;
index 77e49f4a8743b7a61e02551e9bc71be07949839f..2ebd4ac495d7f8e7b2a43fdc066db836ce9d2845 100644 (file)
@@ -42,7 +42,6 @@ public class CssLayoutCustomCss extends TestBase implements ClickListener {
 
     private Component createMarginsToggle() {
         final CheckBox cb = new CheckBox("Margins");
-        cb.setImmediate(true);
         cb.addValueChangeListener(
                 event -> ((MarginHandler) layout).setMargin(cb.getValue()));
 
index b17a2a771be45ee36bccc7b327bf71ec4c485d53..f06db44b5c22aeb0ae17acc01454ae28b61cb743 100644 (file)
@@ -28,7 +28,6 @@ public class FormLayoutWithInvisibleComponent extends TestBase {
             messages.setRequired(true);
             messages.setCaption("Messages visible");
         });
-        control.setImmediate(true);
         formLayout.addComponent(control);
 
         messages = new TextArea("Messages hidden");
index 64d0ba5e6c4948e26752e70cfc5934a257b1611e..8164d72f7f96e378d55154d666e5a2708bbb8f18 100644 (file)
@@ -149,8 +149,8 @@ public class CSSInjectWithColorpicker extends UI {
             Styles styles = Page.getCurrent().getStyles();
 
             // inject the new color as a style
-            styles.add(".v-app .v-textarea.text-label { color:"
-                    + color.getCSS() + "; }");
+            styles.add(".v-app .v-textarea.text-label { color:" + color.getCSS()
+                    + "; }");
         });
 
         return textColor;
@@ -160,14 +160,13 @@ public class CSSInjectWithColorpicker extends UI {
      * Creates a font family selection dialog
      */
     private Component createFontSelect() {
-        final ComboBox<String> select = new ComboBox<>(null, Arrays.asList(
-                "Arial", "Helvetica", "Verdana", "Courier", "Times",
-                "sans-serif"));
+        final ComboBox<String> select = new ComboBox<>(null,
+                Arrays.asList("Arial", "Helvetica", "Verdana", "Courier",
+                        "Times", "sans-serif"));
         select.setValue("Arial");
         select.setWidth("200px");
         select.setPlaceholder("Font");
         select.setDescription("Font");
-        select.setImmediate(true);
         select.setEmptySelectionAllowed(false);
         select.addValueChangeListener(event -> {
             // Get the new font family
@@ -196,7 +195,6 @@ public class CSSInjectWithColorpicker extends UI {
         select.setValue(12);
         select.setPlaceholder("Font size");
         select.setDescription("Font size");
-        select.setImmediate(true);
         select.setEmptySelectionAllowed(false);
         select.addValueChangeListener(event -> {
             // Get the new font size
index 22ff9a8f5f908e95940008ab1f6b96fd7a2c339a..b135faa6e1f2e07efc8f623db1d1f17b601a5811 100644 (file)
@@ -27,7 +27,6 @@ public class ReducingRoundTrips extends AbstractReindeerTestUI {
     @Override
     protected void setup(VaadinRequest request) {
         PasswordField passwordField = new PasswordField("Enter password");
-        passwordField.setImmediate(true);
         CapsLockWarningWithRpc capsLockWarningWithRpc = new CapsLockWarningWithRpc();
 
         capsLockWarningWithRpc.extend(passwordField);
index 8c2d0bb561b9294dc9da3e58dd242cc3194ddee6..bd022cae76b34387c521c55d7247ca7d9de6e7ef 100644 (file)
@@ -42,7 +42,6 @@ public class TogglePush extends AbstractReindeerTestUI {
         CheckBox pushSetting = new CheckBox("Push enabled");
         pushSetting.setValue(Boolean
                 .valueOf(getPushConfiguration().getPushMode().isEnabled()));
-        pushSetting.setImmediate(true);
         pushSetting.addValueChangeListener(event -> {
             if (event.getValue()) {
                 getPushConfiguration().setPushMode(PushMode.AUTOMATIC);
index 862636fa3bceff37fad5c699c57b0938a6e12417..81c5a07261ee68578a0f02b1f752c0be66eee2ef 100644 (file)
@@ -38,7 +38,6 @@ public class ButtonsTest extends com.vaadin.server.LegacyApplication {
             }
         });
         themeToggle.setStyleName("small");
-        themeToggle.setImmediate(true);
 
         styleToggle = new CheckBox("Black style");
         styleToggle.addValueChangeListener(event -> {
@@ -48,7 +47,6 @@ public class ButtonsTest extends com.vaadin.server.LegacyApplication {
                 main.getContent().setStyleName("");
             }
         });
-        styleToggle.setImmediate(true);
         styleToggle.setStyleName("small");
 
         iconToggle = new CheckBox("64x icons");
@@ -56,7 +54,6 @@ public class ButtonsTest extends com.vaadin.server.LegacyApplication {
             largeIcons = !largeIcons;
             recreateAll();
         });
-        iconToggle.setImmediate(true);
         iconToggle.setStyleName("small");
 
         nativeToggle = new CheckBox("Native buttons");
@@ -64,7 +61,6 @@ public class ButtonsTest extends com.vaadin.server.LegacyApplication {
             nativeButtons = !nativeButtons;
             recreateAll();
         });
-        nativeToggle.setImmediate(true);
         nativeToggle.setStyleName("small");
 
         toggles.setSpacing(true);
index d8d7d73d7c8355dd0ac211b0460e2478951c6b00..19012a6019526bc64c8f02192e8da20b67768eda 100644 (file)
@@ -397,7 +397,6 @@ public class CalendarTest extends GridLayout implements View {
 
     private void initHideWeekEndButton() {
         hideWeekendsButton = new CheckBox("Hide weekends");
-        hideWeekendsButton.setImmediate(true);
         hideWeekendsButton.addValueChangeListener(
                 event -> setWeekendsHidden(hideWeekendsButton.getValue()));
     }
@@ -417,14 +416,12 @@ public class CalendarTest extends GridLayout implements View {
 
     private void initReadOnlyButton() {
         readOnlyButton = new CheckBox("Read-only mode");
-        readOnlyButton.setImmediate(true);
         readOnlyButton.addValueChangeListener(event -> calendarComponent
                 .setReadOnly(readOnlyButton.getValue()));
     }
 
     private void initDisabledButton() {
         disabledButton = new CheckBox("Disabled");
-        disabledButton.setImmediate(true);
         disabledButton.addValueChangeListener(event -> calendarComponent
                 .setEnabled(!disabledButton.getValue()));
     }
@@ -503,7 +500,6 @@ public class CalendarTest extends GridLayout implements View {
 
     private CheckBox createCheckBox(String caption) {
         CheckBox cb = new CheckBox(caption);
-        cb.setImmediate(true);
         return cb;
     }
 
index 9c8d9f39b4ddc8ca38be3baea98455cceeeb24c1..642ebfd28e0ad052eb135089bb7334fb9bf7cef4 100644 (file)
@@ -46,23 +46,18 @@ public class Tabsheets extends VerticalLayout implements View {
         addComponent(wrap);
 
         final CheckBox closable = new CheckBox("Closable");
-        closable.setImmediate(true);
         wrap.addComponent(closable);
 
         final CheckBox overflow = new CheckBox("Overflow");
-        overflow.setImmediate(true);
         wrap.addComponent(overflow);
 
         final CheckBox caption = new CheckBox("Captions", true);
-        caption.setImmediate(true);
         wrap.addComponent(caption);
 
         final CheckBox icon = new CheckBox("Icons");
-        icon.setImmediate(true);
         wrap.addComponent(icon);
 
         final CheckBox disable = new CheckBox("Disable tabs");
-        disable.setImmediate(true);
         wrap.addComponent(disable);
 
         Label h3 = new Label("Additional Styles");
@@ -76,35 +71,27 @@ public class Tabsheets extends VerticalLayout implements View {
         addComponent(wrap);
 
         final CheckBox framed = new CheckBox("Framed", true);
-        framed.setImmediate(true);
         wrap.addComponent(framed);
 
         final CheckBox centered = new CheckBox("Centered tabs");
-        centered.setImmediate(true);
         wrap.addComponent(centered);
 
         final CheckBox rightAlign = new CheckBox("Right-aligned tabs");
-        rightAlign.setImmediate(true);
         wrap.addComponent(rightAlign);
 
         final CheckBox equal = new CheckBox("Equal-width tabs");
-        equal.setImmediate(true);
         wrap.addComponent(equal);
 
         final CheckBox padded = new CheckBox("Padded tabbar");
-        padded.setImmediate(true);
         wrap.addComponent(padded);
 
         final CheckBox compact = new CheckBox("Compact");
-        compact.setImmediate(true);
         wrap.addComponent(compact);
 
         final CheckBox iconsOnTop = new CheckBox("Icons on top");
-        iconsOnTop.setImmediate(true);
         wrap.addComponent(iconsOnTop);
 
         final CheckBox selectedOnly = new CheckBox("Selected tab closable");
-        selectedOnly.setImmediate(true);
         wrap.addComponent(selectedOnly);
 
         HasValue.ValueChangeListener<Boolean> update = event -> {
index 0fa98d3d86acd6c3cd13325515dc1f50346e4bde..ec3a9e1b7c26f9aa0c4b69e4925e3083a08ac224 100644 (file)
@@ -27,7 +27,6 @@ public class ValidationOfRequiredEmptyFields extends AbstractReindeerTestUI {
     @Override
     protected void setup(VaadinRequest request) {
         requiredInput = new CheckBox("Field required");
-        requiredInput.setImmediate(true);
         requiredInput.addValueChangeListener(
                 event -> tf.setRequired(requiredInput.getValue()));
 
@@ -41,7 +40,6 @@ public class ValidationOfRequiredEmptyFields extends AbstractReindeerTestUI {
         });
 
         integerValidatorInput = new CheckBox("Integer validator");
-        integerValidatorInput.setImmediate(true);
         integerValidatorInput.addValueChangeListener(event -> {
             if (integerValidatorInput.getValue()) {
                 tf.addValidator(integerValidator);
@@ -50,7 +48,6 @@ public class ValidationOfRequiredEmptyFields extends AbstractReindeerTestUI {
             }
         });
         stringLengthValidatorInput = new CheckBox("String length validator");
-        stringLengthValidatorInput.setImmediate(true);
         stringLengthValidatorInput.addValueChangeListener(event -> {
             if (stringLengthValidatorInput.getValue()) {
                 tf.addValidator(stringLengthValidator);
index e4dce67da8978e75ff49fef11fff790efe47310e..a651da1a44cb07fe495bcb26a46b4a50813bfea7 100644 (file)
@@ -30,7 +30,6 @@ import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.HasWidgets;
 import com.vaadin.client.data.DataChangeHandler;
 import com.vaadin.client.data.DataSource;
-import com.vaadin.client.ui.AbstractComponentConnector;
 import com.vaadin.shared.Registration;
 import com.vaadin.shared.ui.Connect;
 import com.vaadin.tests.widgetset.server.v7.grid.GridClientColumnRenderers;
@@ -41,6 +40,7 @@ import com.vaadin.v7.client.renderers.NumberRenderer;
 import com.vaadin.v7.client.renderers.Renderer;
 import com.vaadin.v7.client.renderers.TextRenderer;
 import com.vaadin.v7.client.renderers.WidgetRenderer;
+import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector;
 import com.vaadin.v7.client.widget.grid.CellReference;
 import com.vaadin.v7.client.widget.grid.RendererCellReference;
 import com.vaadin.v7.client.widget.grid.datasources.ListDataSource;
@@ -53,7 +53,7 @@ import com.vaadin.v7.client.widgets.Grid;
 
 @Connect(GridClientColumnRenderers.GridController.class)
 public class GridClientColumnRendererConnector
-        extends AbstractComponentConnector {
+        extends AbstractLegacyComponentConnector {
 
     public static enum Renderers {
         TEXT_RENDERER, WIDGET_RENDERER, HTML_RENDERER, NUMBER_RENDERER, DATE_RENDERER, CPLX_RENDERER;
index ef9ef3adc9328500f5357b0c9e0042052a8f6c94..60019fc2012d4400d5f8ec76ed7aa1e571117154 100644 (file)
@@ -43,7 +43,6 @@ public class GridCheckBoxDisplay extends AbstractReindeerTestUI {
         grid.setSelectionMode(Grid.SelectionMode.SINGLE);
 
         grid.setEditorEnabled(true);
-        grid.setImmediate(true);
 
         getLayout().addComponent(grid);
         getLayout().setExpandRatio(grid, 1);
index 03f96ed20b5b5deb2e6b228afa8fc481e1d59773..7a88da395b990694ef6a9dfa692827a3373e6b97 100644 (file)
@@ -70,7 +70,6 @@ public class GridDetailsLocation extends UI {
         layout.addComponent(checkbox);
 
         numberTextField = new TextField("Row");
-        numberTextField.setImmediate(true);
         layout.addComponent(numberTextField);
 
         layout.addComponent(
index 155c3aafeb61f5fa3b5ec8bf4c2632a4d9147a8e..3932773f4be05fbc48342be3ba248bd4f3d56b9f 100644 (file)
@@ -126,7 +126,6 @@ public class GridFastAsyncUpdate extends AbstractTestUI {
 
         grid = new Grid(container);
         grid.setWidth("100%");
-        grid.setImmediate(true);
         grid.setSelectionMode(SelectionMode.SINGLE);
         grid.addSelectionListener(new SelectionListener() {
             @Override
diff --git a/uitest/src/test/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemovalTest.java b/uitest/src/test/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemovalTest.java
deleted file mode 100644 (file)
index 99562f7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2000-2016 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.application;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.vaadin.testbench.elements.ButtonElement;
-import com.vaadin.tests.tb3.SingleBrowserTest;
-
-public class ResynchronizeAfterAsyncRemovalTest extends SingleBrowserTest {
-    @Test
-    public void noResyncAfterAsyncRemoval() {
-        openTestURL();
-
-        $(ButtonElement.class).first().click();
-
-        Assert.assertEquals("Timing issue in the test?",
-                "1. Window removed: true", getLogRow(1));
-
-        Assert.assertEquals(
-                "Removing window should not cause button to be marked as dirty",
-                "2. Dirty: false", getLogRow(0));
-
-        ButtonElement logCountButton = $(ButtonElement.class).all().get(1);
-        logCountButton.click();
-
-        Assert.assertEquals("Sanity check", "3. syncId: 2", getLogRow(1));
-        Assert.assertEquals("Sanity check",
-                "4. Unregistered connector count: 1", getLogRow(0));
-
-        logCountButton.click();
-
-        Assert.assertEquals("Sanity check", "5. syncId: 3", getLogRow(1));
-        Assert.assertEquals(
-                "Unregistered connector map should have been cleared",
-                "6. Unregistered connector count: 0", getLogRow(0));
-    }
-}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/OutOfSyncTest.java b/uitest/src/test/java/com/vaadin/tests/components/OutOfSyncTest.java
deleted file mode 100644 (file)
index 2e8d462..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2000-2016 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.components;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.vaadin.testbench.elements.ButtonElement;
-import com.vaadin.tests.tb3.MultiBrowserTest;
-
-public class OutOfSyncTest extends MultiBrowserTest {
-
-    @Test
-    public void testClientResync() throws InterruptedException {
-        openTestURL();
-
-        // Wait for server to get rid of the Button
-        sleep(1000);
-
-        // On the first round-trip after the component has been removed, the
-        // server assumes the client will remove the button. How ever (to force
-        // it to be out of sync) the test UI calls markClean() on the Button to
-        // make it not update with the response.
-        $(ButtonElement.class).first().click();
-        Assert.assertTrue(
-                "Button should not have disappeared on the first click.",
-                $(ButtonElement.class).exists());
-
-        // Truly out of sync, full resync is forced.
-        $(ButtonElement.class).first().click();
-        Assert.assertFalse("Button should disappear with the second click.",
-                $(ButtonElement.class).exists());
-    }
-
-}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java b/uitest/src/test/java/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java
deleted file mode 100644 (file)
index 1d54339..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2000-2016 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.components.checkbox;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebElement;
-
-import com.vaadin.testbench.elements.CheckBoxElement;
-import com.vaadin.testbench.elements.LabelElement;
-import com.vaadin.tests.tb3.MultiBrowserTest;
-
-public class CheckBoxImmediateTest extends MultiBrowserTest {
-
-    @Test
-    public void testNonImmediateCheckBox() {
-        openTestURL();
-
-        CheckBoxElement checkBoxElement = $(CheckBoxElement.class).first();
-        WebElement inputElem = checkBoxElement.findElement(By.tagName("input"));
-        final WebElement countElem = $(LabelElement.class).id("count");
-
-        inputElem.click();
-        assertEquals("Events received: 0", countElem.getText());
-    }
-
-    @Test
-    public void testImmediateCheckBox() {
-        openTestURL();
-
-        CheckBoxElement checkBoxElement = $(CheckBoxElement.class).get(1);
-        WebElement inputElem = checkBoxElement.findElement(By.tagName("input"));
-        final WebElement countElem = $(LabelElement.class).id("count");
-
-        inputElem.click();
-        assertEquals("Events received: 1", countElem.getText());
-    }
-}