aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-09-12 16:36:45 +0300
committerVaadin Code Review <review@vaadin.com>2016-09-13 08:04:15 +0000
commit8b91ebd61bf72d4f1fb2925cea073de297da94fa (patch)
tree05640e24c6ea7c1a567073237647e2fe3721f63b
parent83278f7c9f2ab97e8b929e949529a3eed2a92721 (diff)
downloadvaadin-framework-8b91ebd61bf72d4f1fb2925cea073de297da94fa.tar.gz
vaadin-framework-8b91ebd61bf72d4f1fb2925cea073de297da94fa.zip
Change ColorPicker to use new ComboBox
ColorPicker is moved back to vaadin-server now that it no longer requires any old components Change-Id: Iebb34cc0724a4bba6eff53073400e803d9ffddd1
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java)2
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerAreaConnector.java)6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerConnector.java)6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java)6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java)6
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGradient.java)2
-rw-r--r--client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java (renamed from compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGrid.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractColorPicker.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java)12
-rw-r--r--server/src/main/java/com/vaadin/ui/ColorPicker.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPicker.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/ColorPickerArea.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPickerArea.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeEvent.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeListener.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGradient.java)4
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java)4
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java)31
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java)40
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorSelector.java)2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java (renamed from compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/HasColorChangeListener.java)2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java (renamed from compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java)18
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorConversionsTest.java (renamed from compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/ColorConversionsTest.java)2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerHsvTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java10
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/HtmlInCaption.java4
-rw-r--r--uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java6
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/valo/ColorPickers.java4
28 files changed, 86 insertions, 99 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java
index 59db8dc659..6f480538e0 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/AbstractColorPickerConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerAreaConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java
index 4426fc815f..828cc689c7 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerAreaConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -24,11 +24,11 @@ import com.vaadin.client.ui.VColorPickerArea;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc;
-import com.vaadin.v7.ui.ColorPickerArea;
+import com.vaadin.ui.ColorPickerArea;
/**
* A class that defines an implementation for a color picker connector. Connects
- * the server side {@link com.vaadin.v7.ui.ColorPickerArea} with the client side
+ * the server side {@link com.vaadin.ui.ColorPickerArea} with the client side
* counterpart {@link VColorPickerArea}
*
* @since 7.0.0
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java
index c9f78259cb..6254e7adbe 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -23,11 +23,11 @@ import com.vaadin.client.ui.VColorPicker;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc;
-import com.vaadin.v7.ui.ColorPicker;
+import com.vaadin.ui.ColorPicker;
/**
* A class that defines default implementation for a color picker connector.
- * Connects the server side {@link com.vaadin.v7.ui.ColorPicker} with the client
+ * Connects the server side {@link com.vaadin.ui.ColorPicker} with the client
* side counterpart {@link VColorPicker}
*
* @since 7.0.0
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java
index 29343b7eb2..c05449d7bd 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGradientConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.MouseUpEvent;
@@ -26,12 +26,12 @@ import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.colorpicker.ColorPickerGradientServerRpc;
import com.vaadin.shared.ui.colorpicker.ColorPickerGradientState;
-import com.vaadin.v7.ui.components.colorpicker.ColorPickerGradient;
+import com.vaadin.ui.components.colorpicker.ColorPickerGradient;
/**
* A class that defines the default implementation for a color picker gradient
* connector. Connects the server side
- * {@link com.vaadin.v7.ui.components.colorpicker.ColorPickerGradient} with the
+ * {@link com.vaadin.ui.components.colorpicker.ColorPickerGradient} with the
* client side counterpart {@link VColorPickerGradient}
*
* @since 7.0.0
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java
index b834d253dd..2b57968e3b 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/ColorPickerGridConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -26,12 +26,12 @@ import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.colorpicker.ColorPickerGridServerRpc;
import com.vaadin.shared.ui.colorpicker.ColorPickerGridState;
-import com.vaadin.v7.ui.components.colorpicker.ColorPickerGrid;
+import com.vaadin.ui.components.colorpicker.ColorPickerGrid;
/**
* A class that defines the default implementation for a color picker grid
* connector. Connects the server side
- * {@link com.vaadin.v7.ui.components.colorpicker.ColorPickerGrid} with the
+ * {@link com.vaadin.ui.components.colorpicker.ColorPickerGrid} with the
* client side counterpart {@link VColorPickerGrid}
*
* @since 7.0.0
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGradient.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java
index d62be14fd1..b75bee23c1 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGradient.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.MouseDownEvent;
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGrid.java b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java
index 18b31e41e9..67f2ce07dd 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/colorpicker/VColorPickerGrid.java
+++ b/client/src/main/java/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.client.ui.colorpicker;
+package com.vaadin.client.ui.colorpicker;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
index da03136593..d7d12c6d03 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui;
+package com.vaadin.ui;
import java.io.Serializable;
import java.lang.reflect.Method;
@@ -25,16 +25,14 @@ import org.jsoup.nodes.Element;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc;
import com.vaadin.shared.ui.colorpicker.ColorPickerState;
-import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.UI;
import com.vaadin.ui.Window.CloseEvent;
import com.vaadin.ui.Window.CloseListener;
+import com.vaadin.ui.components.colorpicker.ColorChangeEvent;
+import com.vaadin.ui.components.colorpicker.ColorChangeListener;
+import com.vaadin.ui.components.colorpicker.ColorPickerPopup;
+import com.vaadin.ui.components.colorpicker.ColorSelector;
import com.vaadin.ui.declarative.DesignAttributeHandler;
import com.vaadin.ui.declarative.DesignContext;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeEvent;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeListener;
-import com.vaadin.v7.ui.components.colorpicker.ColorPickerPopup;
-import com.vaadin.v7.ui.components.colorpicker.ColorSelector;
/**
* An abstract class that defines default implementation for a color picker
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPicker.java b/server/src/main/java/com/vaadin/ui/ColorPicker.java
index 34b03a2447..67002373d0 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPicker.java
+++ b/server/src/main/java/com/vaadin/ui/ColorPicker.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui;
+package com.vaadin.ui;
import com.vaadin.shared.ui.colorpicker.Color;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPickerArea.java b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java
index 624d567ec7..c4f3971259 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/ColorPickerArea.java
+++ b/server/src/main/java/com/vaadin/ui/ColorPickerArea.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui;
+package com.vaadin.ui;
import com.vaadin.shared.ui.colorpicker.Color;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeEvent.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java
index da0b435ddc..aa703deb19 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeEvent.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.ui.Component;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeListener.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java
index 87f0046242..b234dc3d5d 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorChangeListener.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorChangeListener.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.io.Serializable;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGradient.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java
index cb9dd698d9..cbb1ba9795 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGradient.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.lang.reflect.Method;
@@ -21,7 +21,7 @@ import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.shared.ui.colorpicker.ColorPickerGradientServerRpc;
import com.vaadin.shared.ui.colorpicker.ColorPickerGradientState;
import com.vaadin.ui.AbstractComponent;
-import com.vaadin.v7.ui.AbstractColorPicker.Coordinates2Color;
+import com.vaadin.ui.AbstractColorPicker.Coordinates2Color;
/**
* A component that represents a color gradient within a color picker.
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java
index a1286dbc58..9e5580c719 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.awt.Point;
import java.lang.reflect.Method;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
index e26e802a32..1173faf152 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.lang.reflect.Method;
import java.util.ArrayList;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java
index 39931ce570..8876e4809d 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -39,7 +39,7 @@ import com.vaadin.ui.Slider.ValueOutOfBoundsException;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-import com.vaadin.v7.ui.AbstractColorPicker.Coordinates2Color;
+import com.vaadin.ui.AbstractColorPicker.Coordinates2Color;
/**
* A component that represents color selection popup within a color picker.
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
index 2a5b7c456f..e7d9395e06 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java
@@ -13,24 +13,23 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.lang.reflect.Method;
+import com.vaadin.data.HasValue.ValueChange;
+import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
-import com.vaadin.v7.data.Property.ValueChangeEvent;
-import com.vaadin.v7.data.Property.ValueChangeListener;
-import com.vaadin.v7.ui.TextField;
+import com.vaadin.ui.TextField;
/**
* A component that represents color selection preview within a color picker.
*
* @since 7.0.0
*/
-public class ColorPickerPreview extends CssLayout
- implements ColorSelector, ValueChangeListener {
+public class ColorPickerPreview extends CssLayout implements ColorSelector {
private static final String STYLE_DARK_COLOR = "v-textfield-dark";
private static final String STYLE_LIGHT_COLOR = "v-textfield-light";
@@ -55,6 +54,7 @@ public class ColorPickerPreview extends CssLayout
/** The old value. */
private String oldValue;
+ private Registration valueChangeListenerRegistration = null;
private ColorPickerPreview() {
setStyleName("v-colorpicker-preview");
@@ -64,7 +64,8 @@ public class ColorPickerPreview extends CssLayout
field.setSizeFull();
field.setStyleName("v-colorpicker-preview-textfield");
field.setData(this);
- field.addValueChangeListener(this);
+ valueChangeListenerRegistration = field
+ .addValueChangeListener(this::valueChange);
addComponent(field);
}
@@ -81,19 +82,16 @@ public class ColorPickerPreview extends CssLayout
this.color = color;
// Unregister listener
- field.removeValueChangeListener(this);
+ valueChangeListenerRegistration.remove();
String colorCSS = color.getCSS();
field.setValue(colorCSS);
- if (field.isValid()) {
- oldValue = colorCSS;
- } else {
- field.setValue(oldValue);
- }
+ oldValue = colorCSS;
// Re-register listener
- field.addValueChangeListener(this);
+ valueChangeListenerRegistration = field
+ .addValueChangeListener(this::valueChange);
// Set the text color
field.removeStyleName(STYLE_DARK_COLOR);
@@ -123,9 +121,8 @@ public class ColorPickerPreview extends CssLayout
removeListener(ColorChangeEvent.class, listener);
}
- @Override
- public void valueChange(ValueChangeEvent event) {
- String value = (String) event.getProperty().getValue();
+ public void valueChange(ValueChange<String> event) {
+ String value = event.getValue();
try {
if (value != null) {
/*
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
index 87156b34db..ac0da15fc5 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
@@ -13,14 +13,15 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
+import java.util.EnumSet;
+
+import com.vaadin.data.HasValue.ValueChange;
import com.vaadin.shared.ui.colorpicker.Color;
+import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.v7.data.Property.ValueChangeEvent;
-import com.vaadin.v7.data.Property.ValueChangeListener;
-import com.vaadin.v7.ui.ComboBox;
/**
* A component that represents color selection swatches within a color picker.
@@ -28,10 +29,10 @@ import com.vaadin.v7.ui.ComboBox;
* @since 7.0.0
*/
public class ColorPickerSelect extends CustomComponent
- implements ColorSelector, ValueChangeListener {
+ implements ColorSelector {
/** The range. */
- private final ComboBox range;
+ private final ComboBox<ColorRangePropertyId> range;
/** The grid. */
private final ColorPickerGrid grid;
@@ -78,17 +79,11 @@ public class ColorPickerSelect extends CustomComponent
setStyleName("colorselect");
setWidth("100%");
- range = new ComboBox();
- range.setImmediate(true);
- range.setImmediate(true);
- range.setNullSelectionAllowed(false);
- range.setNewItemsAllowed(false);
+ range = new ComboBox<>(null, EnumSet.allOf(ColorRangePropertyId.class));
+ range.setEmptySelectionAllowed(false);
range.setWidth("100%");
- range.addValueChangeListener(this);
+ range.addValueChangeListener(this::valueChange);
- for (ColorRangePropertyId id : ColorRangePropertyId.values()) {
- range.addItem(id);
- }
range.select(ColorRangePropertyId.ALL);
layout.addComponent(range);
@@ -201,7 +196,7 @@ public class ColorPickerSelect extends CustomComponent
@Override
public void setColor(Color color) {
- grid.getColor();
+ grid.setColor(color);
}
@Override
@@ -214,21 +209,18 @@ public class ColorPickerSelect extends CustomComponent
grid.removeColorChangeListener(listener);
}
- @Override
- public void valueChange(ValueChangeEvent event) {
+ public void valueChange(ValueChange<ColorRangePropertyId> event) {
if (grid == null) {
return;
}
- if (event.getProperty().getValue() == ColorRangePropertyId.ALL) {
+ if (event.getValue() == ColorRangePropertyId.ALL) {
grid.setColorGrid(createAllColors(14, 10));
- } else if (event.getProperty().getValue() == ColorRangePropertyId.RED) {
+ } else if (event.getValue() == ColorRangePropertyId.RED) {
grid.setColorGrid(createColors(new Color(0xFF, 0, 0), 14, 10));
- } else if (event.getProperty()
- .getValue() == ColorRangePropertyId.GREEN) {
+ } else if (event.getValue() == ColorRangePropertyId.GREEN) {
grid.setColorGrid(createColors(new Color(0, 0xFF, 0), 14, 10));
- } else if (event.getProperty()
- .getValue() == ColorRangePropertyId.BLUE) {
+ } else if (event.getValue() == ColorRangePropertyId.BLUE) {
grid.setColorGrid(createColors(new Color(0, 0, 0xFF), 14, 10));
}
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorSelector.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java
index a4da97c46b..d9264745a8 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorSelector.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorSelector.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.io.Serializable;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/HasColorChangeListener.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java
index ed416c1ebe..7980111e2b 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/HasColorChangeListener.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.ui.components.colorpicker;
+package com.vaadin.ui.components.colorpicker;
import java.io.Serializable;
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java
index cd72febc0f..2e3b8e412e 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java
@@ -13,23 +13,23 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.tests.server.component.colorpicker;
+package com.vaadin.tests.server.component.colorpicker;
import org.junit.Test;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.tests.design.DeclarativeTestBase;
-import com.vaadin.v7.ui.AbstractColorPicker;
-import com.vaadin.v7.ui.AbstractColorPicker.PopupStyle;
-import com.vaadin.v7.ui.ColorPicker;
-import com.vaadin.v7.ui.ColorPickerArea;
+import com.vaadin.ui.AbstractColorPicker;
+import com.vaadin.ui.AbstractColorPicker.PopupStyle;
+import com.vaadin.ui.ColorPicker;
+import com.vaadin.ui.ColorPickerArea;
public class AbstractColorPickerDeclarativeTest
extends DeclarativeTestBase<AbstractColorPicker> {
@Test
public void testAllAbstractColorPickerFeatures() {
- String design = "<vaadin7-color-picker color='#fafafa' default-caption-enabled position='100,100'"
+ String design = "<vaadin-color-picker color='#fafafa' default-caption-enabled position='100,100'"
+ " popup-style='simple' rgb-visibility='false' hsv-visibility='false'"
+ " history-visibility=false textfield-visibility=false />";
ColorPicker colorPicker = new ColorPicker();
@@ -50,7 +50,7 @@ public class AbstractColorPickerDeclarativeTest
@Test
public void testEmptyColorPicker() {
- String design = "<vaadin7-color-picker />";
+ String design = "<vaadin-color-picker />";
ColorPicker colorPicker = new ColorPicker();
testRead(design, colorPicker);
testWrite(design, colorPicker);
@@ -58,7 +58,7 @@ public class AbstractColorPickerDeclarativeTest
@Test
public void testAllAbstractColorPickerAreaFeatures() {
- String design = "<vaadin7-color-picker-area color='#fafafa' default-caption-enabled position='100,100'"
+ String design = "<vaadin-color-picker-area color='#fafafa' default-caption-enabled position='100,100'"
+ " popup-style='simple' rgb-visibility='false' hsv-visibility='false'"
+ " history-visibility=false textfield-visibility=false />";
AbstractColorPicker colorPicker = new ColorPickerArea();
@@ -79,7 +79,7 @@ public class AbstractColorPickerDeclarativeTest
@Test
public void testEmptyColorPickerArea() {
- String design = "<vaadin7-color-picker-area />";
+ String design = "<vaadin-color-picker-area />";
AbstractColorPicker colorPicker = new ColorPickerArea();
testRead(design, colorPicker);
testWrite(design, colorPicker);
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/ColorConversionsTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorConversionsTest.java
index 7865be46da..a55ed89691 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/colorpicker/ColorConversionsTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorConversionsTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.v7.tests.server.component.colorpicker;
+package com.vaadin.tests.server.component.colorpicker;
import static org.junit.Assert.assertEquals;
diff --git a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerHsvTest.java b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerHsvTest.java
index 14a78fd842..ab77fbf2ba 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerHsvTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerHsvTest.java
@@ -3,9 +3,9 @@ package com.vaadin.tests.components.colorpicker;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.ColorPickerArea;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.v7.ui.ColorPickerArea;
/**
* Tests the HSV tab slider values when initially opening the tab.
diff --git a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
index 950634039f..9f9164d582 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
@@ -31,19 +31,19 @@ import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.AbstractColorPicker;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.ColorPicker;
+import com.vaadin.ui.ColorPickerArea;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.v7.ui.AbstractColorPicker;
-import com.vaadin.v7.ui.ColorPicker;
-import com.vaadin.v7.ui.ColorPickerArea;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeEvent;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeListener;
+import com.vaadin.ui.components.colorpicker.ColorChangeEvent;
+import com.vaadin.ui.components.colorpicker.ColorChangeListener;
public class ColorPickerTestUI extends AbstractTestUI
implements ColorChangeListener {
diff --git a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java
index 5b110f0659..300bfd551f 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/colorpicker/DefaultCaptionWidth.java
@@ -18,8 +18,8 @@ package com.vaadin.tests.components.colorpicker;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
+import com.vaadin.ui.ColorPicker;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.v7.ui.ColorPicker;
/**
* Test for color picker with default caption.
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/HtmlInCaption.java b/uitest/src/main/java/com/vaadin/tests/layouts/HtmlInCaption.java
index 918fa1f461..63e2de75d6 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/HtmlInCaption.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/HtmlInCaption.java
@@ -21,6 +21,8 @@ import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.ColorPicker;
+import com.vaadin.ui.ColorPickerArea;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.GridLayout;
@@ -30,8 +32,6 @@ import com.vaadin.ui.NativeButton;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-import com.vaadin.v7.ui.ColorPicker;
-import com.vaadin.v7.ui.ColorPickerArea;
import com.vaadin.v7.ui.TextField;
/**
diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
index 9c7fe6378e..72e3e28418 100644
--- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
+++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
@@ -9,19 +9,19 @@ import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Alignment;
+import com.vaadin.ui.ColorPicker;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.components.colorpicker.ColorChangeEvent;
+import com.vaadin.ui.components.colorpicker.ColorChangeListener;
import com.vaadin.v7.data.Property.ValueChangeEvent;
import com.vaadin.v7.data.Property.ValueChangeListener;
-import com.vaadin.v7.ui.ColorPicker;
import com.vaadin.v7.ui.ComboBox;
import com.vaadin.v7.ui.TextArea;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeEvent;
-import com.vaadin.v7.ui.components.colorpicker.ColorChangeListener;
public class CSSInjectWithColorpicker extends UI {
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/ColorPickers.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/ColorPickers.java
index 7a7ae821e1..4c764e7fc6 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/valo/ColorPickers.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/ColorPickers.java
@@ -18,12 +18,12 @@ package com.vaadin.tests.themes.valo;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.colorpicker.Color;
+import com.vaadin.ui.ColorPicker;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.AbstractColorPicker.PopupStyle;
import com.vaadin.ui.themes.ValoTheme;
-import com.vaadin.v7.ui.AbstractColorPicker.PopupStyle;
-import com.vaadin.v7.ui.ColorPicker;
public class ColorPickers extends VerticalLayout implements View {
public ColorPickers() {