From: Petri Heinonen Date: Thu, 23 Aug 2012 07:15:02 +0000 (+0300) Subject: refak listeners com.vaadin.terminal X-Git-Tag: 7.0.0.beta1~210^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=181904db6aa50a10383f098f022da7d4ed801738;p=vaadin-framework.git refak listeners com.vaadin.terminal --- diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java index 5c8d9a638e..5d626c2a01 100644 --- a/server/src/com/vaadin/server/Page.java +++ b/server/src/com/vaadin/server/Page.java @@ -301,16 +301,35 @@ public class Page implements Serializable { } } - public void addListener(Page.FragmentChangedListener listener) { + public void addFragmentChangedListener(Page.FragmentChangedListener listener) { addListener(FragmentChangedEvent.class, listener, FRAGMENT_CHANGED_METHOD); } - public void removeListener(Page.FragmentChangedListener listener) { + /** + * @deprecated Since 7.0, replaced by + * {@link #addFragmentChangedListener(FragmentChangedListener)} + **/ + @Deprecated + public void addListener(Page.FragmentChangedListener listener) { + addFragmentChangedListener(listener); + } + + public void removeFragmentChangedListener( + Page.FragmentChangedListener listener) { removeListener(FragmentChangedEvent.class, listener, FRAGMENT_CHANGED_METHOD); } + /** + * @deprecated Since 7.0, replaced by + * {@link #removeFragmentChangedListener(FragmentChangedListener)} + **/ + @Deprecated + public void removeListener(Page.FragmentChangedListener listener) { + removeFragmentChangedListener(listener); + } + /** * Sets URI fragment. Optionally fires a {@link FragmentChangedEvent} * @@ -407,25 +426,45 @@ public class Page implements Serializable { * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) * @see #setResizeLazy(boolean) */ - public void addListener(BrowserWindowResizeListener resizeListener) { + public void addBrowserWindowResizeListener( + BrowserWindowResizeListener resizeListener) { addListener(BrowserWindowResizeEvent.class, resizeListener, BROWSWER_RESIZE_METHOD); } /** - * Removes a {@link BrowserWindowResizeListener} from this uI. The + * @deprecated Since 7.0, replaced by + * {@link #addBrowserWindowResizeListener(BrowserWindowResizeListener)} + **/ + @Deprecated + public void addListener(BrowserWindowResizeListener resizeListener) { + addBrowserWindowResizeListener(resizeListener); + } + + /** + * Removes a {@link BrowserWindowResizeListener} from this UI. The * listener will no longer be notified when the browser window is resized. * * @param resizeListener * the listener to remove */ - public void removeListener(BrowserWindowResizeListener resizeListener) { + public void removeBrowserWindowResizeListener( + BrowserWindowResizeListener resizeListener) { removeListener(BrowserWindowResizeEvent.class, resizeListener, BROWSWER_RESIZE_METHOD); } /** - * Gets the last known height of the browser window in which this uI + * @deprecated Since 7.0, replaced by + * {@link #removeBrowserWindowResizeListener(BrowserWindowResizeListener)} + **/ + @Deprecated + public void removeListener(BrowserWindowResizeListener resizeListener) { + removeBrowserWindowResizeListener(resizeListener); + } + + /** + * Gets the last known height of the browser window in which this UI * resides. * * @return the browser window height in pixels