Package com.vaadin.client.ui
Class VNotification
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- com.vaadin.client.widgets.Overlay
-
- com.vaadin.client.ui.VOverlay
-
- com.vaadin.client.ui.VNotification
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.EventPreview,com.google.gwt.user.client.ui.AcceptsOneWidget,com.google.gwt.user.client.ui.HasAnimation,com.google.gwt.user.client.ui.HasOneWidget,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.SourcesPopupEvents,Iterable<com.google.gwt.user.client.ui.Widget>
public class VNotification extends VOverlay
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVNotification.EventListenerclassVNotification.HideEvent-
Nested classes/interfaces inherited from class com.vaadin.client.widgets.Overlay
Overlay.PositionAndSize, Overlay.ResizeAnimation
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Field Summary
Fields Modifier and Type Field Description static PositionASSISTIVEPosition that is only accessible for assistive devices, invisible for visual users.static PositionBOTTOM_LEFTstatic PositionBOTTOM_RIGHTstatic StringCAPTIONstatic PositionCENTEREDstatic PositionCENTERED_BOTTOMstatic PositionCENTERED_TOPstatic intDELAY_FOREVERstatic intDELAY_NONEstatic StringDESCRIPTIONstatic StringDETAILSstatic StringSTYLE_SYSTEMstatic PositionTOP_LEFTstatic PositionTOP_RIGHT-
Fields inherited from class com.vaadin.client.widgets.Overlay
ADDITIONAL_CLASSNAME_ANIMATE_IN, ADDITIONAL_CLASSNAME_ANIMATE_OUT, CLASSNAME_CONTAINER, CLASSNAME_SHADOW, current, Z_INDEX
-
-
Constructor Summary
Constructors Constructor Description VNotification()Default constructor.VNotification(int delayMsec)Deprecated.Use static#createNotification(int)instead to enable GWT deferred binding.VNotification(int delayMsec, int fadeMsec, int startOpacity)Deprecated.Use static#createNotification(int, int, int)instead to enable GWT deferred binding.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventListener(VNotification.EventListener listener)static voidbringNotificationsToFront()Moves currently visible notifications to the top of the event preview stack.static VNotificationcreateNotification(int delayMsec, com.google.gwt.user.client.ui.Widget owner)static StringgetDependentStyle(ApplicationConnection client, String style)Meant for internal usage only.voidhide()protected voidhideAfterDelay()voidonBrowserEvent(com.google.gwt.user.client.Event event)booleanonEventPreview(com.google.gwt.user.client.Event event)protected voidonPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)voidremoveEventListener(VNotification.EventListener listener)voidsetPosition(Position position)voidshow()voidshow(com.google.gwt.user.client.ui.Widget widget, Position position, String style)voidshow(Position position)voidshow(Position position, String style)voidshow(String style)voidshow(String html, Position position, String styleName)static voidshowError(ApplicationConnection connection, String caption, String message, String details, String url)Shows an error notification and redirects the user to the given URL when she clicks on the notification.static VNotificationshowNotification(ApplicationConnection client, String caption, String description, boolean htmlContentAllowed, String iconUri, String styleName, Position position, int delayMsec)Creates and shows aNotificationwith the specified parameters.-
Methods inherited from class com.vaadin.client.ui.VOverlay
getApplicationConnection, getOverlayContainer, getOverlayContainer, setApplicationConnection, setOverlayContainerLabel
-
Methods inherited from class com.vaadin.client.widgets.Overlay
center, getOwner, hide, hide, isFitInWindow, isShimElementEnabled, needsShimElement, onAttach, onDetach, positionOrSizeUpdated, setFitInWindow, setHeight, setOwner, setPopupPosition, setVisible, setWidth, setZIndex, updateShadowSizeAndPosition
-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setWidget, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getWidget, iterator, remove, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CENTERED
public static final Position CENTERED
-
CENTERED_TOP
public static final Position CENTERED_TOP
-
CENTERED_BOTTOM
public static final Position CENTERED_BOTTOM
-
TOP_LEFT
public static final Position TOP_LEFT
-
TOP_RIGHT
public static final Position TOP_RIGHT
-
BOTTOM_LEFT
public static final Position BOTTOM_LEFT
-
BOTTOM_RIGHT
public static final Position BOTTOM_RIGHT
-
CAPTION
public static final String CAPTION
- See Also:
- Constant Field Values
-
DESCRIPTION
public static final String DESCRIPTION
- See Also:
- Constant Field Values
-
DETAILS
public static final String DETAILS
- See Also:
- Constant Field Values
-
ASSISTIVE
public static final Position ASSISTIVE
Position that is only accessible for assistive devices, invisible for visual users.
-
DELAY_FOREVER
public static final int DELAY_FOREVER
- See Also:
- Constant Field Values
-
DELAY_NONE
public static final int DELAY_NONE
- See Also:
- Constant Field Values
-
STYLE_SYSTEM
public static final String STYLE_SYSTEM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VNotification
public VNotification()
Default constructor. You should use GWT.create instead.
-
VNotification
@Deprecated public VNotification(int delayMsec)
Deprecated.Use static#createNotification(int)instead to enable GWT deferred binding.- Parameters:
delayMsec-
-
VNotification
@Deprecated public VNotification(int delayMsec, int fadeMsec, int startOpacity)
Deprecated.Use static#createNotification(int, int, int)instead to enable GWT deferred binding.- Parameters:
delayMsec-fadeMsec-startOpacity-
-
-
Method Detail
-
show
public void show(String style)
-
show
public void show(Position position)
-
show
public void show(com.google.gwt.user.client.ui.Widget widget, Position position, String style)
-
hideAfterDelay
protected void hideAfterDelay()
-
setPosition
public void setPosition(Position position)
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
onPreviewNativeEvent
protected void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
- Overrides:
onPreviewNativeEventin classcom.google.gwt.user.client.ui.PopupPanel
-
onEventPreview
public boolean onEventPreview(com.google.gwt.user.client.Event event)
- Specified by:
onEventPreviewin interfacecom.google.gwt.user.client.EventPreview- Overrides:
onEventPreviewin classcom.google.gwt.user.client.ui.PopupPanel
-
addEventListener
public void addEventListener(VNotification.EventListener listener)
-
removeEventListener
public void removeEventListener(VNotification.EventListener listener)
-
showNotification
public static VNotification showNotification(ApplicationConnection client, String caption, String description, boolean htmlContentAllowed, String iconUri, String styleName, Position position, int delayMsec)
Creates and shows aNotificationwith the specified parameters.- Parameters:
client- The client connection, cannot benull.caption- The Notification caption, can benull.description- The Notification description, can benull.htmlContentAllowed- Whethercaptionanddescriptionare interpreted as HTML or not.iconUri- The icon URI, can benull.styleName- The Notification style name, can benull.position- The desiredPosition, can not benull.delayMsec- The delay in milliseconds before disappearing, -1 for forever.- Since:
- 8.2
-
getDependentStyle
public static String getDependentStyle(ApplicationConnection client, String style)
Meant for internal usage only.- Parameters:
client- application connectionstyle- the dependent style name- Returns:
- the given dependent style name prefixed with current notification primary style
- Since:
- 7.5.0
-
createNotification
public static VNotification createNotification(int delayMsec, com.google.gwt.user.client.ui.Widget owner)
-
bringNotificationsToFront
public static void bringNotificationsToFront()
Moves currently visible notifications to the top of the event preview stack. Can be called when opening other overlays such as subwindows to ensure the notifications receive the events they need and don't linger indefinitely. See #7136. TODO Should this be a generic Overlay feature instead?
-
showError
public static void showError(ApplicationConnection connection, String caption, String message, String details, String url)
Shows an error notification and redirects the user to the given URL when she clicks on the notification. If both message and caption are null, redirects the user to the url immediately- Parameters:
connection- A reference to the ApplicationConnectioncaption- The caption for the error or null to exclude the captionmessage- The message for the error or null to exclude the messagedetails- A details message or null to exclude the detailsurl- A url to redirect to after the user clicks the error notification- Since:
- 7.5.1
-
-