summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-23 10:15:02 +0000
committerVaadin Code Review <review@vaadin.com>2012-11-23 10:15:02 +0000
commit39362ee93b02e1400d943e1c2d4ccdefb4b55b1d (patch)
tree77bdc0a8156ba1cf660783df8bf56c2cb07cfff3
parent325f9e8310fae51591245b1cc373e22a43b4d9d2 (diff)
parentaf2cd858e31691e09d2bec00ec03643bdfb991d1 (diff)
downloadvaadin-framework-39362ee93b02e1400d943e1c2d4ccdefb4b55b1d.tar.gz
vaadin-framework-39362ee93b02e1400d943e1c2d4ccdefb4b55b1d.zip
Merge "Document @PreserveOnRefresh"
-rw-r--r--server/src/com/vaadin/annotations/PreserveOnRefresh.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/server/src/com/vaadin/annotations/PreserveOnRefresh.java b/server/src/com/vaadin/annotations/PreserveOnRefresh.java
index 59c4abb723..eca7287c9c 100644
--- a/server/src/com/vaadin/annotations/PreserveOnRefresh.java
+++ b/server/src/com/vaadin/annotations/PreserveOnRefresh.java
@@ -21,8 +21,25 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.vaadin.server.UIProvider;
+
+/**
+ * Marks a UI that should be retained when the user refreshed the browser
+ * window. By default, a new UI instance is created when refreshing, causing any
+ * UI state not captured in the URL or the URI fragment to get discarded. By
+ * adding this annotation to a UI class, the framework will instead reuse the
+ * current UI instance when a reload is detected.
+ * <p>
+ * By using
+ * {@link UIProvider#isPreservedOnRefresh(com.vaadin.server.UICreateEvent)}, the
+ * decision can also be made dynamically based on other parameters than only
+ * whether this annotation is present on the UI class.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface PreserveOnRefresh {
-
+ // Empty marker annotation
}