diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-08-30 16:24:18 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-08-31 11:06:45 +0300 |
commit | 1921394b57526d04059d9768e4162405c63d853b (patch) | |
tree | 493201e367d69e9fba8dfa072591c5e7caf8cc6f /server/src/com/vaadin/navigator | |
parent | 7b25b3886ea95bc6495506fbe9472e45fcbde684 (diff) | |
download | vaadin-framework-1921394b57526d04059d9768e4162405c63d853b.tar.gz vaadin-framework-1921394b57526d04059d9768e4162405c63d853b.zip |
Rename FragmentManager to NavigationStateManager (#9367)
Diffstat (limited to 'server/src/com/vaadin/navigator')
-rw-r--r-- | server/src/com/vaadin/navigator/NavigationStateManager.java (renamed from server/src/com/vaadin/navigator/FragmentManager.java) | 28 | ||||
-rw-r--r-- | server/src/com/vaadin/navigator/Navigator.java | 18 |
2 files changed, 24 insertions, 22 deletions
diff --git a/server/src/com/vaadin/navigator/FragmentManager.java b/server/src/com/vaadin/navigator/NavigationStateManager.java index a42456a163..cbbeb59c30 100644 --- a/server/src/com/vaadin/navigator/FragmentManager.java +++ b/server/src/com/vaadin/navigator/NavigationStateManager.java @@ -19,32 +19,34 @@ package com.vaadin.navigator; import java.io.Serializable; /** - * Fragment manager that handles interaction between Navigator and URI fragments - * or other similar view identification and bookmarking system. - * - * Alternative implementations can be created for HTML5 pushState, for portlet - * URL navigation and other similar systems. - * + * An interface for handling interaction between Navigator and the browser + * location URI or other similar view identification and bookmarking system. The + * state is limited to a single string because in the usual cases it forms a + * part of a URI. + * <p> + * Different implementations can be created for hashbang URIs, HTML5 pushState, + * portlet URL navigation and other similar systems. + * <p> * This interface is mostly for internal use by {@link Navigator}. * * @author Vaadin Ltd * @since 7.0 */ -public interface FragmentManager extends Serializable { +public interface NavigationStateManager extends Serializable { /** - * Return the current fragment (location string) including view name and any - * optional parameters. + * Returns the current navigation state including view name and any optional + * parameters. * * @return current view and parameter string, not null */ - public String getFragment(); + public String getState(); /** - * Set the current fragment (location string) in the application URL or - * similar location, including view name and any optional parameters. + * Set the current navigation state in the location URI or similar location, + * including view name and any optional parameters. * * @param fragment * new view and parameter string, not null */ - public void setFragment(String fragment); + public void setState(String state); }
\ No newline at end of file diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index cef27c221d..40805e2c12 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -79,7 +79,7 @@ public class Navigator implements Serializable { * This class is mostly for internal use by Navigator, and is only public * and static to enable testing. */ - public static class UriFragmentManager implements FragmentManager, + public static class UriFragmentManager implements NavigationStateManager, FragmentChangedListener { private final Page page; private final Navigator navigator; @@ -102,18 +102,18 @@ public class Navigator implements Serializable { } @Override - public String getFragment() { + public String getState() { return page.getFragment(); } @Override - public void setFragment(String fragment) { + public void setState(String fragment) { page.setFragment(fragment, false); } @Override public void fragmentChanged(FragmentChangedEvent event) { - UriFragmentManager.this.navigator.navigateTo(getFragment()); + UriFragmentManager.this.navigator.navigateTo(getState()); } } @@ -318,7 +318,7 @@ public class Navigator implements Serializable { } } - private final FragmentManager fragmentManager; + private final NavigationStateManager fragmentManager; private final ViewDisplay display; private View currentView = null; private List<ViewChangeListener> listeners = new LinkedList<ViewChangeListener>(); @@ -393,7 +393,7 @@ public class Navigator implements Serializable { * @param display * where to display the views */ - public Navigator(FragmentManager fragmentManager, ViewDisplay display) { + public Navigator(NavigationStateManager fragmentManager, ViewDisplay display) { this.display = display; this.fragmentManager = fragmentManager; } @@ -472,8 +472,8 @@ public class Navigator implements Serializable { if (!fragmentParameters.equals("")) { currentFragment += "/" + fragmentParameters; } - if (!currentFragment.equals(getFragmentManager().getFragment())) { - getFragmentManager().setFragment(currentFragment); + if (!currentFragment.equals(getFragmentManager().getState())) { + getFragmentManager().setState(currentFragment); } } @@ -517,7 +517,7 @@ public class Navigator implements Serializable { * * @return fragment manager in use */ - protected FragmentManager getFragmentManager() { + protected NavigationStateManager getFragmentManager() { return fragmentManager; } |