Class GeneratedVaadinNotification<R extends GeneratedVaadinNotification<R>>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.notification.GeneratedVaadinNotification<R>
-
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,Serializable
- Direct Known Subclasses:
Notification
@Deprecated @Tag("vaadin-notification") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.3.30") @NpmPackage(value="@vaadin/notification",version="23.3.30") @NpmPackage(value="@vaadin/vaadin-notification",version="23.3.30") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/notification/src/vaadin-notification.js") @JsModule("@vaadin/polymer-legacy-adapter/template-renderer.js") public abstract class GeneratedVaadinNotification<R extends GeneratedVaadinNotification<R>> extends Component
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
<vaadin-notification>is a Web Component providing accessible and customizable notifications (toasts). The content of the notification can be populated in two ways: imperatively by using renderer callback function and declaratively by using Polymer's Templates.Rendering
By default, the notification uses the content provided by using the renderer callback function.
The renderer function provides
root,notificationarguments. Generate DOM content, append it to therootelement and control the state of the host element by accessingnotification. Before generating new content, users are able to check if there is already content inrootfor reusing it.<vaadin-notification id="notification"></vaadin-notification>
const notification = document.querySelector('#notification'); notification.renderer = function(root) root.textContent = "Your work has been saved";;}Renderer is called on the opening of the notification. DOM generated during the renderer call can be reused in the next renderer call and will be provided with the
rootargument. On first call it will be empty.Polymer Templates
Alternatively, the content can be provided with Polymer's Template. Notification finds the first child template and uses that in case renderer callback function is not provided. You can also set a custom template using the
templateproperty.<vaadin-notification> <template> Your work has been saved </template> </vaadin-notification>Styling
<vaadin-notification>uses<vaadin-notification-card>internal themable component as the actual visible notification cards. See the stylable parts the<vaadin-notification-card>API.Note: the
themeattribute value set on<vaadin-notification>is propagated to the internal<vaadin-notification-card>.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeneratedVaadinNotification.OpenedChangeEvent<R extends GeneratedVaadinNotification<R>>Deprecated.since v23.3, generated classes will be removed in v24.
-
Constructor Summary
Constructors Constructor Description GeneratedVaadinNotification()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected RegistrationaddOpenedChangeListener(ComponentEventListener<Notification.OpenedChangeEvent<Notification>> listener)Deprecated.since v23.3, generated classes will be removed in v24.protected voidclose()Deprecated.since v23.3, generated classes will be removed in v24.protected doublegetDurationDouble()Deprecated.since v23.3, generated classes will be removed in v24.protected StringgetPositionString()Deprecated.since v23.3, generated classes will be removed in v24.protected booleanisOpenedBoolean()Deprecated.since v23.3, generated classes will be removed in v24.protected voidopen()Deprecated.since v23.3, generated classes will be removed in v24.protected voidsetDuration(double duration)Deprecated.since v23.3, generated classes will be removed in v24.protected voidsetOpened(boolean opened)Deprecated.since v23.3, generated classes will be removed in v24.protected voidsetPosition(String position)Deprecated.since v23.3, generated classes will be removed in v24.-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Method Detail
-
getDurationDouble
@Deprecated protected double getDurationDouble()
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
The duration in milliseconds to show the notification. Set to
0or a negative number to disable the notification auto-closing.This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
durationproperty from the webcomponent
-
setDuration
@Deprecated protected void setDuration(double duration)
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
The duration in milliseconds to show the notification. Set to
0or a negative number to disable the notification auto-closing.- Parameters:
duration- the double value to set
-
isOpenedBoolean
@Deprecated @Synchronize(property="opened", value="opened-changed") protected boolean isOpenedBoolean()
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
True if the notification is currently displayed.
This property is synchronized automatically from client side when a 'opened-changed' event happens.
- Returns:
- the
openedproperty from the webcomponent
-
setOpened
@Deprecated protected void setOpened(boolean opened)
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
True if the notification is currently displayed.
- Parameters:
opened- the boolean value to set
-
getPositionString
@Deprecated protected String getPositionString()
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
Alignment of the notification in the viewport Valid values are
top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretchThis property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
positionproperty from the webcomponent
-
setPosition
@Deprecated protected void setPosition(String position)
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
Alignment of the notification in the viewport Valid values are
top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch- Parameters:
position- the String value to set
-
open
@Deprecated protected void open()
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
Opens the notification.
-
close
@Deprecated protected void close()
Deprecated.since v23.3, generated classes will be removed in v24.Description copied from corresponding location in WebComponent:
Closes the notification.
-
addOpenedChangeListener
@Deprecated protected Registration addOpenedChangeListener(ComponentEventListener<Notification.OpenedChangeEvent<Notification>> listener)
Deprecated.since v23.3, generated classes will be removed in v24.Adds a listener foropened-changedevents fired by the webcomponent.- Parameters:
listener- the listener- Returns:
- a
Registrationfor removing the event listener
-
-