From aa17a44582ade2a22578da1d3bde68a174102a4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Mon, 25 Jun 2012 15:28:20 +0300 Subject: [PATCH] Move showNotification shorthands back to Root from LegacyWindow (#8907) --- src/com/vaadin/ui/Root.java | 291 ++++++++++++++++++------------------ 1 file changed, 145 insertions(+), 146 deletions(-) diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java index 64bfaf57a5..37cd646d82 100644 --- a/src/com/vaadin/ui/Root.java +++ b/src/com/vaadin/ui/Root.java @@ -337,152 +337,6 @@ public abstract class Root extends AbstractComponentContainer implements return getPage().getBrowserWindowWidth(); } - /** - * Shows a notification message on the middle of the root. The message - * automatically disappears ("humanized message"). - * - * Care should be taken to to avoid XSS vulnerabilities as the caption - * is rendered as html. - * - * @see #showNotification(Notification) - * @see Notification - * - * @param caption - * The message - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(String caption) { - getPage().showNotification(new Notification(caption)); - } - - /** - * Shows a notification message the root. The position and behavior of - * the message depends on the type, which is one of the basic types - * defined in {@link Notification}, for instance - * Notification.TYPE_WARNING_MESSAGE. - * - * Care should be taken to to avoid XSS vulnerabilities as the caption - * is rendered as html. - * - * @see #showNotification(Notification) - * @see Notification - * - * @param caption - * The message - * @param type - * The message type - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(String caption, int type) { - getPage().showNotification(new Notification(caption, type)); - } - - /** - * Shows a notification consisting of a bigger caption and a smaller - * description on the middle of the root. The message automatically - * disappears ("humanized message"). - * - * Care should be taken to to avoid XSS vulnerabilities as the caption - * and description are rendered as html. - * - * @see #showNotification(Notification) - * @see Notification - * - * @param caption - * The caption of the message - * @param description - * The message description - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(String caption, String description) { - getPage().showNotification(new Notification(caption, description)); - } - - /** - * Shows a notification consisting of a bigger caption and a smaller - * description. The position and behavior of the message depends on the - * type, which is one of the basic types defined in {@link Notification} - * , for instance Notification.TYPE_WARNING_MESSAGE. - * - * Care should be taken to to avoid XSS vulnerabilities as the caption - * and description are rendered as html. - * - * @see #showNotification(Notification) - * @see Notification - * - * @param caption - * The caption of the message - * @param description - * The message description - * @param type - * The message type - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(String caption, String description, - int type) { - getPage().showNotification( - new Notification(caption, description, type)); - } - - /** - * Shows a notification consisting of a bigger caption and a smaller - * description. The position and behavior of the message depends on the - * type, which is one of the basic types defined in {@link Notification} - * , for instance Notification.TYPE_WARNING_MESSAGE. - * - * Care should be taken to avoid XSS vulnerabilities if html content is - * allowed. - * - * @see #showNotification(Notification) - * @see Notification - * - * @param caption - * The message caption - * @param description - * The message description - * @param type - * The type of message - * @param htmlContentAllowed - * Whether html in the caption and description should be - * displayed as html or as plain text - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(String caption, String description, - int type, boolean htmlContentAllowed) { - getPage().showNotification( - new Notification(caption, description, type, - htmlContentAllowed)); - } - - /** - * Shows a notification message. - * - * @see Notification - * @see #showNotification(String) - * @see #showNotification(String, int) - * @see #showNotification(String, String) - * @see #showNotification(String, String, int) - * - * @param notification - * The notification message to show - * - * @deprecated As of 7.0, use Notification.show instead - */ - @Deprecated - public void showNotification(Notification notification) { - getPage().showNotification(notification); - } - /** * Executes JavaScript in this window. * @@ -1204,4 +1058,149 @@ public abstract class Root extends AbstractComponentContainer implements "You can not set the title of a Root. To set the title of the HTML page, use Page.setTitle"); } + /** + * Shows a notification message on the middle of the root. The message + * automatically disappears ("humanized message"). + * + * Care should be taken to to avoid XSS vulnerabilities as the caption is + * rendered as html. + * + * @see #showNotification(Notification) + * @see Notification + * + * @param caption + * The message + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(String caption) { + getPage().showNotification(new Notification(caption)); + } + + /** + * Shows a notification message the root. The position and behavior of the + * message depends on the type, which is one of the basic types defined in + * {@link Notification}, for instance Notification.TYPE_WARNING_MESSAGE. + * + * Care should be taken to to avoid XSS vulnerabilities as the caption is + * rendered as html. + * + * @see #showNotification(Notification) + * @see Notification + * + * @param caption + * The message + * @param type + * The message type + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(String caption, int type) { + getPage().showNotification(new Notification(caption, type)); + } + + /** + * Shows a notification consisting of a bigger caption and a smaller + * description on the middle of the root. The message automatically + * disappears ("humanized message"). + * + * Care should be taken to to avoid XSS vulnerabilities as the caption and + * description are rendered as html. + * + * @see #showNotification(Notification) + * @see Notification + * + * @param caption + * The caption of the message + * @param description + * The message description + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(String caption, String description) { + getPage().showNotification(new Notification(caption, description)); + } + + /** + * Shows a notification consisting of a bigger caption and a smaller + * description. The position and behavior of the message depends on the + * type, which is one of the basic types defined in {@link Notification} , + * for instance Notification.TYPE_WARNING_MESSAGE. + * + * Care should be taken to to avoid XSS vulnerabilities as the caption and + * description are rendered as html. + * + * @see #showNotification(Notification) + * @see Notification + * + * @param caption + * The caption of the message + * @param description + * The message description + * @param type + * The message type + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(String caption, String description, int type) { + getPage() + .showNotification(new Notification(caption, description, type)); + } + + /** + * Shows a notification consisting of a bigger caption and a smaller + * description. The position and behavior of the message depends on the + * type, which is one of the basic types defined in {@link Notification} , + * for instance Notification.TYPE_WARNING_MESSAGE. + * + * Care should be taken to avoid XSS vulnerabilities if html content is + * allowed. + * + * @see #showNotification(Notification) + * @see Notification + * + * @param caption + * The message caption + * @param description + * The message description + * @param type + * The type of message + * @param htmlContentAllowed + * Whether html in the caption and description should be + * displayed as html or as plain text + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(String caption, String description, int type, + boolean htmlContentAllowed) { + getPage() + .showNotification( + new Notification(caption, description, type, + htmlContentAllowed)); + } + + /** + * Shows a notification message. + * + * @see Notification + * @see #showNotification(String) + * @see #showNotification(String, int) + * @see #showNotification(String, String) + * @see #showNotification(String, String, int) + * + * @param notification + * The notification message to show + * + * @deprecated As of 7.0, use Notification.show instead + */ + @Deprecated + public void showNotification(Notification notification) { + getPage().showNotification(notification); + } + } -- 2.39.5