Browse Source

Remove AbstractComponent.immediate

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
tags/8.0.0.alpha5
Pekka Hyvönen 7 years ago
parent
commit
fb4248119d
100 changed files with 789 additions and 754 deletions
  1. 0
    6
      client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java
  2. 11
    15
      client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java
  3. 3
    7
      client/src/main/java/com/vaadin/client/ui/VCheckBox.java
  4. 0
    11
      client/src/main/java/com/vaadin/client/ui/VDateField.java
  5. 1
    3
      client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java
  6. 12
    17
      client/src/main/java/com/vaadin/client/ui/VSlider.java
  7. 3
    3
      client/src/main/java/com/vaadin/client/ui/VTextualDate.java
  8. 0
    3
      client/src/main/java/com/vaadin/client/ui/VUI.java
  9. 2
    5
      client/src/main/java/com/vaadin/client/ui/VWindow.java
  10. 1
    4
      client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
  11. 0
    1
      client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java
  12. 1
    3
      client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java
  13. 0
    1
      client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java
  14. 0
    2
      client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java
  15. 1
    4
      client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java
  16. 1
    3
      client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java
  17. 14
    2
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractFieldConnector.java
  18. 8
    0
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java
  19. 109
    0
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCheckBox.java
  20. 10
    10
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java
  21. 1
    1
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java
  22. 2
    2
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java
  23. 3
    3
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java
  24. 2
    2
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java
  25. 2
    2
      compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java
  26. 2
    4
      compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java
  27. 5
    6
      compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
  28. 121
    0
      compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractLegacyComponent.java
  29. 10
    12
      compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java
  30. 80
    80
      compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
  31. 1
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java
  32. 1
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java
  33. 53
    56
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java
  34. 0
    1
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java
  35. 224
    0
      compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentDeclarativeTest.java
  36. 3
    5
      compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentTest.java
  37. 7
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java
  38. 32
    0
      compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractLegacyComponentState.java
  39. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java
  40. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGradientState.java
  41. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGridState.java
  42. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerState.java
  43. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java
  44. 2
    2
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/upload/UploadState.java
  45. 12
    6
      server/src/main/java/com/vaadin/server/DragAndDropService.java
  46. 0
    20
      server/src/main/java/com/vaadin/server/VariableOwner.java
  47. 4
    5
      server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
  48. 1
    53
      server/src/main/java/com/vaadin/ui/AbstractComponent.java
  49. 0
    2
      server/src/main/java/com/vaadin/ui/Component.java
  50. 0
    1
      server/src/main/java/com/vaadin/ui/TabSheet.java
  51. 18
    25
      server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java
  52. 2
    4
      server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
  53. 0
    15
      server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java
  54. 0
    2
      shared/src/main/java/com/vaadin/shared/AbstractComponentState.java
  55. 0
    1
      uitest/src/main/java/com/vaadin/tests/TestDateField.java
  56. 1
    2
      uitest/src/main/java/com/vaadin/tests/TestForWindowing.java
  57. 0
    80
      uitest/src/main/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemoval.java
  58. 2
    5
      uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java
  59. 4
    7
      uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java
  60. 0
    2
      uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java
  61. 0
    59
      uitest/src/main/java/com/vaadin/tests/components/OutOfSync.java
  62. 0
    5
      uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java
  63. 0
    4
      uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/EnableState.java
  64. 2
    2
      uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java
  65. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
  66. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/button/ButtonUpdateAltText.java
  67. 1
    5
      uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarTest.java
  68. 0
    58
      uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java
  69. 0
    5
      uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
  70. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java
  71. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java
  72. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxResetValue.java
  73. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java
  74. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java
  75. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java
  76. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java
  77. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldChangeResolution.java
  78. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldIsValid.java
  79. 0
    2
      uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
  80. 0
    17
      uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRanges.java
  81. 0
    4
      uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
  82. 0
    5
      uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java
  83. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldRanges.java
  84. 0
    4
      uitest/src/main/java/com/vaadin/tests/components/datefield/LenientMode.java
  85. 0
    15
      uitest/src/main/java/com/vaadin/tests/components/datefield/LowResolution.java
  86. 0
    3
      uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java
  87. 2
    3
      uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java
  88. 0
    2
      uitest/src/main/java/com/vaadin/tests/components/formlayout/NestedFormLayouts.java
  89. 0
    3
      uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutExpandRatio.java
  90. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java
  91. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java
  92. 0
    4
      uitest/src/main/java/com/vaadin/tests/components/media/AudioTest.java
  93. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java
  94. 1
    7
      uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
  95. 0
    3
      uitest/src/main/java/com/vaadin/tests/components/orderedlayout/VerticalLayoutWithEmptyLabel.java
  96. 0
    2
      uitest/src/main/java/com/vaadin/tests/components/panel/BasicPanelTest.java
  97. 1
    2
      uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java
  98. 0
    1
      uitest/src/main/java/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java
  99. 0
    2
      uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
  100. 0
    0
      uitest/src/main/java/com/vaadin/tests/components/table/AddItemToEmptyTable.java

+ 0
- 6
client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java View 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

+ 11
- 15
client/src/main/java/com/vaadin/client/ui/VAbstractSplitPanel.java View 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();
}

/**

+ 3
- 7
client/src/main/java/com/vaadin/client/ui/VCheckBox.java View 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());

+ 0
- 11
client/src/main/java/com/vaadin/client/ui/VDateField.java View 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;
}

+ 1
- 3
client/src/main/java/com/vaadin/client/ui/VDateFieldCalendar.java View File

@@ -86,9 +86,7 @@ public class VDateFieldCalendar extends VDateField {
false);
}
}
if (isImmediate()) {
getClient().sendPendingVariableChanges();
}
getClient().sendPendingVariableChanges();
}
}


+ 12
- 17
client/src/main/java/com/vaadin/client/ui/VSlider.java View 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();

+ 3
- 3
client/src/main/java/com/vaadin/client/ui/VTextualDate.java View 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);
}
}


+ 0
- 3
client/src/main/java/com/vaadin/client/ui/VUI.java View 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;


+ 2
- 5
client/src/main/java/com/vaadin/client/ui/VWindow.java View 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) {

+ 1
- 4
client/src/main/java/com/vaadin/client/ui/checkbox/CheckBoxConnector.java View 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();
}
}


+ 0
- 1
client/src/main/java/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java View 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());

+ 1
- 3
client/src/main/java/com/vaadin/client/ui/datefield/DateFieldConnector.java View 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();
}
});
}

+ 0
- 1
client/src/main/java/com/vaadin/client/ui/slider/SliderConnector.java View 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);

+ 0
- 2
client/src/main/java/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java View 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();

+ 1
- 4
client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java View 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 = "";

+ 1
- 3
client/src/main/java/com/vaadin/client/ui/window/WindowConnector.java View 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();

+ 14
- 2
compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractFieldConnector.java View File

@@ -15,14 +15,16 @@
*/
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);
}
}
}

+ 8
- 0
compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java View 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();
}
}

+ 109
- 0
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCheckBox.java View File

@@ -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);
}
}

+ 10
- 10
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java View 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);

+ 1
- 1
compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java View 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;

+ 2
- 2
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java View 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";


+ 3
- 3
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java View 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);

+ 2
- 2
compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java View 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

+ 2
- 2
compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java View 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() {

+ 2
- 4
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java View 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);

+ 5
- 6
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java View 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

+ 121
- 0
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractLegacyComponent.java View File

@@ -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);
}
}

+ 10
- 12
compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java View 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()));

+ 80
- 80
compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java View 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() {

+ 1
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java View 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> {


+ 1
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java View 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 {

/**

+ 53
- 56
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java View 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;


+ 0
- 1
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java View 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();

+ 224
- 0
compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentDeclarativeTest.java View File

@@ -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.");
}
}
}

server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentTest.java → compatibility-server/src/test/java/com/vaadin/v7/ui/AbstractLegacyComponentTest.java View File

@@ -1,14 +1,12 @@
package com.vaadin.tests.server.component.abstractcomponent;
package com.vaadin.v7.ui;

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() {
public class AbstractLegacyComponentTest {
AbstractLegacyComponent component = new AbstractLegacyComponent() {
};

@Test

+ 7
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractFieldState.java View 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;
}

+ 32
- 0
compatibility-shared/src/main/java/com/vaadin/v7/shared/AbstractLegacyComponentState.java View File

@@ -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;
}

+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java View 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;

+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGradientState.java View 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;


+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerGridState.java View 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;


+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/ColorPickerState.java View 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";
}

+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/label/LabelState.java View 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";
}

+ 2
- 2
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/upload/UploadState.java View File

@@ -15,14 +15,14 @@
*/
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";

+ 12
- 6
server/src/main/java/com/vaadin/server/DragAndDropService.java View 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()) {


+ 0
- 20
server/src/main/java/com/vaadin/server/VariableOwner.java View 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();

}

+ 4
- 5
server/src/main/java/com/vaadin/ui/AbstractColorPicker.java View 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);

+ 1
- 53
server/src/main/java/com/vaadin/ui/AbstractComponent.java View 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()))) {

+ 0
- 2
server/src/main/java/com/vaadin/ui/Component.java View 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

+ 0
- 1
server/src/main/java/com/vaadin/ui/TabSheet.java View File

@@ -142,7 +142,6 @@ public class TabSheet extends AbstractComponentContainer

// expand horizontally by default
setWidth(100, UNITS_PERCENTAGE);
setImmediate(true);
setCloseHandler(new CloseHandler() {

@Override

+ 18
- 25
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java View 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;


+ 2
- 4
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java View 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) {

+ 0
- 15
server/src/test/java/com/vaadin/tests/server/component/abstractcomponent/AbstractComponentDeclarativeTest.java View 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.");
}
}
}

+ 0
- 2
shared/src/main/java/com/vaadin/shared/AbstractComponentState.java View 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!

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/TestDateField.java View 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");

+ 1
- 2
uitest/src/main/java/com/vaadin/tests/TestForWindowing.java View 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);


+ 0
- 80
uitest/src/main/java/com/vaadin/tests/application/ResynchronizeAfterAsyncRemoval.java View File

@@ -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);
}
}
}

+ 2
- 5
uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTest.java View 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) {

+ 4
- 7
uitest/src/main/java/com/vaadin/tests/components/AbstractComponentTestCase.java View 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);


+ 0
- 2
uitest/src/main/java/com/vaadin/tests/components/ComponentTestCase.java View 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;
}

+ 0
- 59
uitest/src/main/java/com/vaadin/tests/components/OutOfSync.java View File

@@ -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;
}

}

+ 0
- 5
uitest/src/main/java/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java View 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

+ 0
- 4
uitest/src/main/java/com/vaadin/tests/components/abstractcomponent/EnableState.java View 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);

+ 2
- 2
uitest/src/main/java/com/vaadin/tests/components/abstractfield/RequiredIndicatorForFieldsWithoutCaption.java View 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) {

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java View 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);

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/button/ButtonUpdateAltText.java View 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");

+ 1
- 5
uitest/src/main/java/com/vaadin/tests/components/calendar/CalendarTest.java View 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;
}


+ 0
- 58
uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java View File

@@ -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;
}

}

+ 0
- 5
uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java View 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);


+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java View 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");


+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java View 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"));

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxResetValue.java View 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) {

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboboxPrimaryStyleNames.java View 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);

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/Comboboxes.java View 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);

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java View 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

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/datefield/CustomDateFormats.java View 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");

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldChangeResolution.java View 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");

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldIsValid.java View 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: "

+ 0
- 2
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java View 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();

+ 0
- 17
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldRanges.java View 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);

}

}

+ 0
- 4
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java View 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);

}

+ 0
- 5
uitest/src/main/java/com/vaadin/tests/components/datefield/DisabledParentLayout.java View 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);

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/datefield/LegacyDateFieldRanges.java View 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());

+ 0
- 4
uitest/src/main/java/com/vaadin/tests/components/datefield/LenientMode.java View 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);

+ 0
- 15
uitest/src/main/java/com/vaadin/tests/components/datefield/LowResolution.java View 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"));

}

+ 0
- 3
uitest/src/main/java/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java View 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()));
}

+ 2
- 3
uitest/src/main/java/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java View 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);

+ 0
- 2
uitest/src/main/java/com/vaadin/tests/components/formlayout/NestedFormLayouts.java View 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);

+ 0
- 3
uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutExpandRatio.java View 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)) {

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java View 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);


+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java View File

@@ -50,7 +50,6 @@ public class JavaScriptResizeListener extends AbstractReindeerTestUI {
}));
addComponent(new CheckBox("Listener active") {
{
setImmediate(true);
addValueChangeListener(event -> resizeJsComponent
.setListenerEnabled(event.getValue()));
}

+ 0
- 4
uitest/src/main/java/com/vaadin/tests/components/media/AudioTest.java View 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() {

+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java View 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);

+ 1
- 7
uitest/src/main/java/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java View 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) {

+ 0
- 3
uitest/src/main/java/com/vaadin/tests/components/orderedlayout/VerticalLayoutWithEmptyLabel.java View 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);

+ 0
- 2
uitest/src/main/java/com/vaadin/tests/components/panel/BasicPanelTest.java View 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();
}

+ 1
- 2
uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaUpdateWhileTyping.java View 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);
}


+ 0
- 1
uitest/src/main/java/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java View File

@@ -41,7 +41,6 @@ public class SliderUpdateFromValueChange extends AbstractReindeerTestUI {
slider.markAsDirty();

});
slider.setImmediate(true);
slider.setWidth(200, Unit.PIXELS);

addComponent(slider);

+ 0
- 2
uitest/src/main/java/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java View 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

+ 0
- 0
uitest/src/main/java/com/vaadin/tests/components/table/AddItemToEmptyTable.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save