aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/navigator
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-06-22 14:34:38 +0300
committerIlia Motornyi <elmot@vaadin.com>2017-06-22 14:34:38 +0300
commitf5571e30284a9124df383650c9dc13e5494ad3fd (patch)
tree9838bed02fd1503c80d64c5bbbc05db926dc5fbb /server/src/main/java/com/vaadin/navigator
parentc7148ce6cf7ff03cd922036c50a271e4bf10b782 (diff)
downloadvaadin-framework-f5571e30284a9124df383650c9dc13e5494ad3fd.tar.gz
vaadin-framework-f5571e30284a9124df383650c9dc13e5494ad3fd.zip
Make it optional to implement enter() in Views
Diffstat (limited to 'server/src/main/java/com/vaadin/navigator')
-rw-r--r--server/src/main/java/com/vaadin/navigator/View.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/server/src/main/java/com/vaadin/navigator/View.java b/server/src/main/java/com/vaadin/navigator/View.java
index 6e87c6e455..aa93d7b7ab 100644
--- a/server/src/main/java/com/vaadin/navigator/View.java
+++ b/server/src/main/java/com/vaadin/navigator/View.java
@@ -36,16 +36,19 @@ public interface View extends Serializable {
/**
* Called before the view is shown on screen.
* <p>
- * {@link ViewChangeEvent#getParameters() event.getParameters()} may contain
- * extra parameters relevant to the view.
+ * The event object contains information about parameters used when showing
+ * the view, in addition to references to the old view and the new view.
+ * <p>
+ * Override this method to perform initialization of your view.
+ * <p>
+ * By default does nothing.
*
* @param event
- * ViewChangeEvent representing the view change that is
- * occurring. {@link ViewChangeEvent#getNewView()
- * event.getNewView()} returns <code>this</code>.
- *
+ * an event object containing information about the parameters
+ * given by the user and references to the old view (if any)
*/
- public void enter(ViewChangeEvent event);
+ public default void enter(ViewChangeEvent event) {
+ }
/**
* Called when the user is requesting navigation away from the view.
@@ -66,6 +69,7 @@ public interface View extends Serializable {
* will be triggered. They will be handled normally and might also prevent
* navigation.
*
+ * @since 8.1
* @param event
* an event object providing information about the event and
* containing the {@link ViewBeforeLeaveEvent#navigate()} method