summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2012-05-29 10:57:48 +0000
committerArtur Signell <artur.signell@itmill.com>2012-05-29 10:57:48 +0000
commit8e5b52a1bd24de51f9a08ebbe6618094400078d2 (patch)
tree9342383bc599bc948cc2bd4d1f6958d6dad20092 /src
parent60c1b8b4c379a5d526c660eb3931e38ece859eb0 (diff)
downloadvaadin-framework-8e5b52a1bd24de51f9a08ebbe6618094400078d2.tar.gz
vaadin-framework-8e5b52a1bd24de51f9a08ebbe6618094400078d2.zip
Made Table serializable when using column width for row header (#8428)
svn changeset:23834/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/ui/Table.java3
-rw-r--r--src/com/vaadin/ui/UniqueSerializable.java35
2 files changed, 37 insertions, 1 deletions
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index a2db89cabb..564aa24991 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -205,7 +205,8 @@ public class Table extends AbstractSelect implements Action.Container,
private static final double CACHE_RATE_DEFAULT = 2;
private static final String ROW_HEADER_COLUMN_KEY = "0";
- private static final Object ROW_HEADER_FAKE_PROPERTY_ID = new Object();
+ private static final Object ROW_HEADER_FAKE_PROPERTY_ID = new UniqueSerializable() {
+ };
/* Private table extensions to Select */
diff --git a/src/com/vaadin/ui/UniqueSerializable.java b/src/com/vaadin/ui/UniqueSerializable.java
new file mode 100644
index 0000000000..f6f354ef58
--- /dev/null
+++ b/src/com/vaadin/ui/UniqueSerializable.java
@@ -0,0 +1,35 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.ui;
+
+import java.io.Serializable;
+
+/**
+ * A base class for generating an unique object that is serializable.
+ * <p>
+ * This class is abstract but has no abstract methods to force users to create
+ * an anonymous inner class. Otherwise each instance will not be unique.
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0
+ *
+ */
+public abstract class UniqueSerializable implements Serializable {
+
+ public static UniqueSerializable create() {
+ return new UniqueSerializable() {
+ };
+ }
+
+ @Override
+ public int hashCode() {
+ return getClass().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return getClass() == obj.getClass();
+ }
+}