summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-11-13 15:40:58 +0000
committerVaadin Code Review <review@vaadin.com>2012-11-13 15:40:58 +0000
commiteebb1069afaa16a8b2395225f7506d59c868c13a (patch)
treebd536859fea0569cef32c2f324468c3189164b37
parent27e2b9c5e8bb718952517b11a7c796e6798f1eb5 (diff)
parentad54bec291ebb929f55b4f9208ed29f018223659 (diff)
downloadvaadin-framework-eebb1069afaa16a8b2395225f7506d59c868c13a.tar.gz
vaadin-framework-eebb1069afaa16a8b2395225f7506d59c868c13a.zip
Merge "Renamed uri fragment methods in Page to use UriFragment instead of Fragment (#10141)"
-rw-r--r--server/src/com/vaadin/navigator/Navigator.java14
-rw-r--r--server/src/com/vaadin/server/Page.java104
-rw-r--r--server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java16
-rw-r--r--uitest/src/com/vaadin/tests/TestBench.java8
-rw-r--r--uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java12
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/InitialFragmentEvent.java12
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java10
-rw-r--r--uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java18
-rw-r--r--uitest/src/com/vaadin/tests/minitutorials/v7b1/AxessingWebPageAndBrowserInfoUI.java12
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket34.java12
10 files changed, 110 insertions, 108 deletions
diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java
index 811a09fcfb..edc101bb44 100644
--- a/server/src/com/vaadin/navigator/Navigator.java
+++ b/server/src/com/vaadin/navigator/Navigator.java
@@ -23,8 +23,8 @@ import java.util.List;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.FragmentChangedEvent;
-import com.vaadin.server.Page.FragmentChangedListener;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.CssLayout;
@@ -84,7 +84,7 @@ public class Navigator implements Serializable {
* and static to enable testing.
*/
public static class UriFragmentManager implements NavigationStateManager,
- FragmentChangedListener {
+ UriFragmentChangedListener {
private final Page page;
private Navigator navigator;
@@ -97,7 +97,7 @@ public class Navigator implements Serializable {
*/
public UriFragmentManager(Page page) {
this.page = page;
- page.addFragmentChangedListener(this);
+ page.addUriFragmentChangedListener(this);
}
@Override
@@ -121,7 +121,7 @@ public class Navigator implements Serializable {
}
@Override
- public void fragmentChanged(FragmentChangedEvent event) {
+ public void uriFragmentChanged(UriFragmentChangedEvent event) {
navigator.navigateTo(getState());
}
@@ -131,7 +131,7 @@ public class Navigator implements Serializable {
* @return The URI fragment.
*/
protected String getFragment() {
- return page.getFragment();
+ return page.getUriFragment();
}
/**
@@ -141,7 +141,7 @@ public class Navigator implements Serializable {
* The new URI fragment.
*/
protected void setFragment(String fragment) {
- page.setFragment(fragment, false);
+ page.setUriFragment(fragment, false);
}
}
diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java
index 2fed002ce6..cf77c09324 100644
--- a/server/src/com/vaadin/server/Page.java
+++ b/server/src/com/vaadin/server/Page.java
@@ -230,15 +230,15 @@ public class Page implements Serializable {
public static final BorderStyle BORDER_DEFAULT = BorderStyle.DEFAULT;
/**
- * Listener that listens changes in URI fragment.
+ * Listener that listens to changes in URI fragment.
*/
- public interface FragmentChangedListener extends Serializable {
- public void fragmentChanged(FragmentChangedEvent event);
+ public interface UriFragmentChangedListener extends Serializable {
+ public void uriFragmentChanged(UriFragmentChangedEvent event);
}
- private static final Method FRAGMENT_CHANGED_METHOD = ReflectTools
- .findMethod(Page.FragmentChangedListener.class, "fragmentChanged",
- FragmentChangedEvent.class);
+ private static final Method URI_FRAGMENT_CHANGED_METHOD = ReflectTools
+ .findMethod(Page.UriFragmentChangedListener.class,
+ "uriFragmentChanged", UriFragmentChangedEvent.class);
/**
* Resources to be opened automatically on next repaint. The list is
@@ -255,12 +255,12 @@ public class Page implements Serializable {
/**
* Event fired when uri fragment changes.
*/
- public static class FragmentChangedEvent extends EventObject {
+ public static class UriFragmentChangedEvent extends EventObject {
/**
* The new uri fragment
*/
- private final String fragment;
+ private final String uriFragment;
/**
* Creates a new instance of UriFragmentReader change event.
@@ -268,9 +268,9 @@ public class Page implements Serializable {
* @param source
* the Source of the event.
*/
- public FragmentChangedEvent(Page source, String fragment) {
+ public UriFragmentChangedEvent(Page source, String uriFragment) {
super(source);
- this.fragment = fragment;
+ this.uriFragment = uriFragment;
}
/**
@@ -287,8 +287,8 @@ public class Page implements Serializable {
*
* @return the new fragment
*/
- public String getFragment() {
- return fragment;
+ public String getUriFragment() {
+ return uriFragment;
}
}
@@ -323,38 +323,39 @@ public class Page implements Serializable {
}
}
- public void addFragmentChangedListener(Page.FragmentChangedListener listener) {
- addListener(FragmentChangedEvent.class, listener,
- FRAGMENT_CHANGED_METHOD);
+ public void addUriFragmentChangedListener(
+ Page.UriFragmentChangedListener listener) {
+ addListener(UriFragmentChangedEvent.class, listener,
+ URI_FRAGMENT_CHANGED_METHOD);
}
/**
* @deprecated Since 7.0, replaced by
- * {@link #addFragmentChangedListener(FragmentChangedListener)}
+ * {@link #addUriFragmentChangedListener(UriFragmentChangedListener)}
**/
@Deprecated
- public void addListener(Page.FragmentChangedListener listener) {
- addFragmentChangedListener(listener);
+ public void addListener(Page.UriFragmentChangedListener listener) {
+ addUriFragmentChangedListener(listener);
}
- public void removeFragmentChangedListener(
- Page.FragmentChangedListener listener) {
- removeListener(FragmentChangedEvent.class, listener,
- FRAGMENT_CHANGED_METHOD);
+ public void removeUriFragmentChangedListener(
+ Page.UriFragmentChangedListener listener) {
+ removeListener(UriFragmentChangedEvent.class, listener,
+ URI_FRAGMENT_CHANGED_METHOD);
}
/**
* @deprecated Since 7.0, replaced by
- * {@link #removeFragmentChangedListener(FragmentChangedListener)}
+ * {@link #removeUriFragmentChangedListener(UriFragmentChangedListener)}
**/
@Deprecated
- public void removeListener(Page.FragmentChangedListener listener) {
- removeFragmentChangedListener(listener);
+ public void removeListener(Page.UriFragmentChangedListener listener) {
+ removeUriFragmentChangedListener(listener);
}
/**
* Sets the fragment part in the current location URI. Optionally fires a
- * {@link FragmentChangedEvent}.
+ * {@link UriFragmentChangedEvent}.
* <p>
* The fragment is the optional last component of a URI, prefixed with a
* hash sign ("#").
@@ -364,33 +365,34 @@ public class Page implements Serializable {
* trailing "#" in the URI.) This is consistent with the semantics of
* {@link java.net.URI}.
*
- * @param newFragment
+ * @param newUriFragment
* The new fragment.
* @param fireEvent
* true to fire event
*
- * @see #getFragment()
+ * @see #getUriFragment()
* @see #setLocation(URI)
- * @see FragmentChangedEvent
- * @see Page.FragmentChangedListener
+ * @see UriFragmentChangedEvent
+ * @see Page.UriFragmentChangedListener
*
*/
- public void setFragment(String newFragment, boolean fireEvents) {
- String oldFragment = location.getFragment();
- if (newFragment == oldFragment
- || (newFragment != null && newFragment.equals(oldFragment))) {
+ public void setUriFragment(String newUriFragment, boolean fireEvents) {
+ String oldUriFragment = location.getFragment();
+ if (newUriFragment == oldUriFragment
+ || (newUriFragment != null && newUriFragment
+ .equals(oldUriFragment))) {
return;
}
try {
location = new URI(location.getScheme(),
- location.getSchemeSpecificPart(), newFragment);
+ location.getSchemeSpecificPart(), newUriFragment);
} catch (URISyntaxException e) {
// This should not actually happen as the fragment syntax is not
// constrained
throw new RuntimeException(e);
}
if (fireEvents) {
- fireEvent(new FragmentChangedEvent(this, newFragment));
+ fireEvent(new UriFragmentChangedEvent(this, newUriFragment));
}
uI.markAsDirty();
}
@@ -402,15 +404,15 @@ public class Page implements Serializable {
}
/**
- * Sets URI fragment. This method fires a {@link FragmentChangedEvent}
+ * Sets URI fragment. This method fires a {@link UriFragmentChangedEvent}
*
- * @param newFragment
+ * @param newUriFragment
* id of the new fragment
- * @see FragmentChangedEvent
- * @see Page.FragmentChangedListener
+ * @see UriFragmentChangedEvent
+ * @see Page.UriFragmentChangedListener
*/
- public void setFragment(String newFragment) {
- setFragment(newFragment, true);
+ public void setUriFragment(String newUriFragment) {
+ setUriFragment(newUriFragment, true);
}
/**
@@ -420,15 +422,15 @@ public class Page implements Serializable {
* there is an empty fragment.
* <p>
* To listen to changes in fragment, hook a
- * {@link Page.FragmentChangedListener}.
+ * {@link Page.UriFragmentChangedListener}.
*
* @return the current fragment in browser location URI.
*
* @see #getLocation()
- * @see #setFragment(String)
- * @see #addFragmentChangedListener(FragmentChangedListener)
+ * @see #setUriFragment(String)
+ * @see #addUriFragmentChangedListener(UriFragmentChangedListener)
*/
- public String getFragment() {
+ public String getUriFragment() {
return location.getFragment();
}
@@ -654,12 +656,12 @@ public class Page implements Serializable {
*/
public void updateLocation(String location) {
try {
- String oldFragment = this.location.getFragment();
+ String oldUriFragment = this.location.getFragment();
this.location = new URI(location);
- String newFragment = this.location.getFragment();
- if (newFragment == null ? oldFragment != null : !newFragment
- .equals(oldFragment)) {
- fireEvent(new FragmentChangedEvent(this, newFragment));
+ String newUriFragment = this.location.getFragment();
+ if (newUriFragment == null ? oldUriFragment != null
+ : !newUriFragment.equals(oldUriFragment)) {
+ fireEvent(new UriFragmentChangedEvent(this, newUriFragment));
}
} catch (URISyntaxException e) {
throw new RuntimeException(e);
diff --git a/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java b/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
index 41bebfcf0c..c680e59210 100644
--- a/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
+++ b/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
@@ -24,18 +24,18 @@ import org.easymock.IMocksControl;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.Navigator.UriFragmentManager;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
public class UriFragmentManagerTest extends TestCase {
- public void testGetSetFragment() {
+ public void testGetSetUriFragment() {
Page page = EasyMock.createMock(Page.class);
UriFragmentManager manager = new UriFragmentManager(page);
// prepare mock
- EasyMock.expect(page.getFragment()).andReturn("");
- page.setFragment("!test", false);
- EasyMock.expect(page.getFragment()).andReturn("!test");
+ EasyMock.expect(page.getUriFragment()).andReturn("");
+ page.setUriFragment("!test", false);
+ EasyMock.expect(page.getUriFragment()).andReturn("!test");
EasyMock.replay(page);
// test manager using the mock
@@ -53,11 +53,11 @@ public class UriFragmentManagerTest extends TestCase {
UriFragmentManager manager = new UriFragmentManager(page);
manager.setNavigator(navigator);
- EasyMock.expect(page.getFragment()).andReturn("!test");
+ EasyMock.expect(page.getUriFragment()).andReturn("!test");
navigator.navigateTo("test");
control.replay();
- FragmentChangedEvent event = new FragmentChangedEvent(page, "oldtest");
- manager.fragmentChanged(event);
+ UriFragmentChangedEvent event = new UriFragmentChangedEvent(page, "oldtest");
+ manager.uriFragmentChanged(event);
}
}
diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java
index ca343b9e2a..04472be847 100644
--- a/uitest/src/com/vaadin/tests/TestBench.java
+++ b/uitest/src/com/vaadin/tests/TestBench.java
@@ -29,7 +29,7 @@ import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.server.ExternalResource;
import com.vaadin.server.LegacyApplication;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalSplitPanel;
@@ -131,10 +131,10 @@ public class TestBench extends com.vaadin.server.LegacyApplication implements
VerticalLayout lo = new VerticalLayout();
lo.addComponent(menu);
- mainWindow.getPage().addListener(new Page.FragmentChangedListener() {
+ mainWindow.getPage().addListener(new Page.UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent source) {
- String fragment = source.getFragment();
+ public void uriFragmentChanged(UriFragmentChangedEvent source) {
+ String fragment = source.getUriFragment();
if (fragment != null && !"".equals(fragment)) {
// try to find a proper test class
diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
index f4d7f2a4e4..34c102df7f 100644
--- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -1,8 +1,8 @@
package com.vaadin.tests.application;
import com.vaadin.annotations.PreserveOnRefresh;
-import com.vaadin.server.Page.FragmentChangedEvent;
-import com.vaadin.server.Page.FragmentChangedListener;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.util.Log;
@@ -20,11 +20,11 @@ public class RefreshStatePreserve extends AbstractTestUI {
addComponent(new Label("UI id: " + getUIId()));
addComponent(log);
- log.log("Initial fragment: " + getPage().getFragment());
- getPage().addFragmentChangedListener(new FragmentChangedListener() {
+ log.log("Initial fragment: " + getPage().getUriFragment());
+ getPage().addUriFragmentChangedListener(new UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent event) {
- log.log("Fragment changed to " + event.getFragment());
+ public void uriFragmentChanged(UriFragmentChangedEvent event) {
+ log.log("Fragment changed to " + event.getUriFragment());
}
});
}
diff --git a/uitest/src/com/vaadin/tests/components/ui/InitialFragmentEvent.java b/uitest/src/com/vaadin/tests/components/ui/InitialFragmentEvent.java
index b4a7d4e181..c9788b8540 100644
--- a/uitest/src/com/vaadin/tests/components/ui/InitialFragmentEvent.java
+++ b/uitest/src/com/vaadin/tests/components/ui/InitialFragmentEvent.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.ui;
-import com.vaadin.server.Page.FragmentChangedEvent;
-import com.vaadin.server.Page.FragmentChangedListener;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.util.Log;
@@ -15,10 +15,10 @@ public class InitialFragmentEvent extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
- getPage().addFragmentChangedListener(new FragmentChangedListener() {
+ getPage().addUriFragmentChangedListener(new UriFragmentChangedListener() {
- public void fragmentChanged(FragmentChangedEvent source) {
- String newFragment = source.getFragment();
+ public void uriFragmentChanged(UriFragmentChangedEvent source) {
+ String newFragment = source.getUriFragment();
log.log("Fragment changed from " + lastKnownFragment + " to "
+ newFragment);
lastKnownFragment = newFragment;
@@ -42,7 +42,7 @@ public class InitialFragmentEvent extends AbstractTestUI {
}
protected void setFragment(String fragment) {
- getPage().setFragment(fragment);
+ getPage().setUriFragment(fragment);
}
@Override
diff --git a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
index b1cfffd410..2172b00ee3 100644
--- a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
+++ b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
@@ -1,7 +1,7 @@
package com.vaadin.tests.components.ui;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Button;
@@ -16,9 +16,9 @@ public class UriFragmentTest extends AbstractTestUI {
protected void setup(VaadinRequest request) {
addComponent(fragmentLabel);
updateLabel();
- getPage().addListener(new Page.FragmentChangedListener() {
+ getPage().addListener(new Page.UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent event) {
+ public void uriFragmentChanged(UriFragmentChangedEvent event) {
updateLabel();
}
});
@@ -26,13 +26,13 @@ public class UriFragmentTest extends AbstractTestUI {
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- getPage().setFragment("test");
+ getPage().setUriFragment("test");
}
}));
}
private void updateLabel() {
- String fragment = getPage().getFragment();
+ String fragment = getPage().getUriFragment();
if (fragment == null) {
fragmentLabel.setValue("No URI fragment set");
} else {
diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java
index 5d7555a952..15c4fa838e 100644
--- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java
+++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java
@@ -16,8 +16,8 @@
package com.vaadin.tests.minitutorials.v7a1;
-import com.vaadin.server.Page.FragmentChangedEvent;
-import com.vaadin.server.Page.FragmentChangedListener;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -36,26 +36,26 @@ public class UsingUriFragments extends UI {
@Override
protected void init(VaadinRequest request) {
Label label = new Label("Hello, your fragment is "
- + getPage().getFragment());
+ + getPage().getUriFragment());
getContent().addComponent(label);
// React to fragment changes
- getPage().addListener(new FragmentChangedListener() {
+ getPage().addListener(new UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent source) {
- handleFragment(source.getFragment());
+ public void uriFragmentChanged(UriFragmentChangedEvent source) {
+ handleFragment(source.getUriFragment());
}
});
// Handle the fragment received in the initial request
- handleFragment(getPage().getFragment());
+ handleFragment(getPage().getUriFragment());
addComponent(new Button("Show and set fragment",
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- handleFragment(getPage().getFragment());
- getPage().setFragment("customFragment");
+ handleFragment(getPage().getUriFragment());
+ getPage().setUriFragment("customFragment");
}
}));
}
diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/AxessingWebPageAndBrowserInfoUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/AxessingWebPageAndBrowserInfoUI.java
index 8623dd0b73..8fb7536190 100644
--- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/AxessingWebPageAndBrowserInfoUI.java
+++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/AxessingWebPageAndBrowserInfoUI.java
@@ -19,8 +19,8 @@ package com.vaadin.tests.minitutorials.v7b1;
import com.vaadin.server.Page;
import com.vaadin.server.Page.BrowserWindowResizeEvent;
import com.vaadin.server.Page.BrowserWindowResizeListener;
-import com.vaadin.server.Page.FragmentChangedEvent;
-import com.vaadin.server.Page.FragmentChangedListener;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Notification;
@@ -43,11 +43,11 @@ public class AxessingWebPageAndBrowserInfoUI extends AbstractTestUI {
}
});
- page.setFragment(page.getFragment() + "foo");
- page.addFragmentChangedListener(new FragmentChangedListener() {
+ page.setUriFragment(page.getUriFragment() + "foo");
+ page.addUriFragmentChangedListener(new UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent event) {
- Notification.show("Fragment=" + event.getFragment());
+ public void uriFragmentChanged(UriFragmentChangedEvent event) {
+ Notification.show("Fragment=" + event.getUriFragment());
}
});
}
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket34.java b/uitest/src/com/vaadin/tests/tickets/Ticket34.java
index 18863273d1..dfeb83987d 100644
--- a/uitest/src/com/vaadin/tests/tickets/Ticket34.java
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket34.java
@@ -5,7 +5,7 @@ import java.util.Map;
import com.vaadin.server.LegacyApplication;
import com.vaadin.server.Page;
-import com.vaadin.server.Page.FragmentChangedEvent;
+import com.vaadin.server.Page.UriFragmentChangedEvent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
@@ -32,14 +32,14 @@ public class Ticket34 extends LegacyApplication {
"Test app for URI fragment management/reading", mainLayout);
setMainWindow(mainWin);
- mainWin.getPage().addListener(new Page.FragmentChangedListener() {
+ mainWin.getPage().addListener(new Page.UriFragmentChangedListener() {
@Override
- public void fragmentChanged(FragmentChangedEvent event) {
+ public void uriFragmentChanged(UriFragmentChangedEvent event) {
getMainWindow().showNotification(
- "Fragment now: " + event.getFragment());
+ "Fragment now: " + event.getUriFragment());
// try to change to view mapped by fragment string
- setView(event.getFragment());
+ setView(event.getUriFragment());
}
});
@@ -95,7 +95,7 @@ public class Ticket34 extends LegacyApplication {
public void buttonClick(ClickEvent event) {
String viewName = tf.getValue().toString();
// fragmentChangedListener will change the view if possible
- event.getButton().getUI().getPage().setFragment(viewName);
+ event.getButton().getUI().getPage().setUriFragment(viewName);
}
});