public class WebNotification extends WebPopup
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected boolean |
accepted
Whether notification is accepted or not.
|
protected AlignPanel |
centerPanel |
protected boolean |
clickToClose
Whether notification can be closed by simple click on popup or not.
|
protected boolean |
closeOnOptionSelection
Whether notification popup should be closed when some option is selected by user or not.
|
protected java.awt.Component |
content
Notification content.
|
protected WebPanel |
contentPanel |
protected long |
displayTime
Notification display duration.
|
protected com.alee.utils.swing.WebTimer |
displayTimer
Delayed hide timer.
|
protected boolean |
equalizeButtonWidths
Whether or not notification option button widths should be equalized.
|
protected javax.swing.Icon |
icon
Notification icon.
|
protected WebImage |
iconImage
Notification visual components.
|
protected java.util.List<NotificationListener> |
listeners
Notification popup listeners.
|
protected java.util.List<NotificationOption> |
options
Notification options.
|
protected WebPanel |
optionsPanel |
protected AlignPanel |
southPanel |
protected AlignPanel |
westPanel |
alwaysOnTop, animate, closeOnOuterAction, displaying, displayProgress, focusListener, followAdapter, followInvoker, hideAnimator, hiding, invoker, invokerWindow, lsync, mouseListener, onFullDisplay, onFullHide, opacity, showAnimator, stepProgress, sync, windowlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTEMPTYEMPTYUNDEFINED| Constructor and Description |
|---|
WebNotification()
Constructs new notification popup.
|
WebNotification(StyleId styleId)
Constructs new notification popup with the specified style ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptAndHide()
Accepts notification and closes popup.
|
void |
addNotificationListener(NotificationListener listener)
Adds directory chooser listener.
|
void |
fireAccepted()
Fires when notification accepted and closed.
|
void |
fireClosed()
Fires when notification simply closed.
|
void |
fireOptionSelected(NotificationOption option)
Fires when notification options is selected.
|
java.awt.Component |
getContent()
Returns notification content.
|
long |
getDisplayTime()
Returns notification display time.
|
javax.swing.Icon |
getIcon()
Returns notification icon.
|
java.util.List<NotificationOption> |
getOptions()
Returns notification options list.
|
protected void |
initializeNotificationPopup()
Initializes various notification popup settings.
|
boolean |
isClickToClose()
Returns whether notification can be closed by simple click on popup or not.
|
boolean |
isCloseOnOptionSelection()
Whether notification popup should be closed when some option is selected by user or not.
|
boolean |
isEqualizeButtonWidths()
Returns whether or not notification option button widths should be equalized.
|
javax.swing.JWindow |
pack()
Packs popup window to fit content preferred size.
|
void |
removeNotificationListener(NotificationListener listener)
Removes directory chooser listener.
|
void |
setClickToClose(boolean clickToClose)
Sets whether notification can be closed by simple click on popup or not.
|
void |
setCloseOnOptionSelection(boolean closeOnOptionSelection)
Returns whether notification popup should be closed when some option is selected by user or not.
|
void |
setContent(java.awt.Component content)
Sets notification content.
|
void |
setContent(java.lang.String content)
Sets notification text content.
|
void |
setDisplayTime(long displayTime)
Sets notification display time.
|
void |
setEqualizeButtonWidths(boolean equalizeButtonWidths)
Sets whether or not notification option button widths should be equalized.
|
void |
setIcon(javax.swing.Icon icon)
Sets notification icon.
|
void |
setIcon(NotificationIcon iconType)
Sets notification icon type.
|
void |
setOptions(java.util.List<NotificationOption> options)
Sets notification options list.
|
void |
setOptions(NotificationOption... options)
Sets notification options.
|
protected void |
updateContent()
Updates visible notification content.
|
protected void |
updateIcon()
Updates visible notification icon.
|
protected void |
updateOptionButtons()
Updates visible notification options.
|
addPopupListener, center, center, center, center, completePopupHide, createWindow, firePopupClosed, firePopupOpened, firePopupWillBeClosed, firePopupWillBeOpened, fullyDisplayed, fullyHidden, getDisplayProgress, getInvoker, getInvokerWindow, getStepProgress, getWindow, getWindowOpacity, hideAnimationStepPerformed, hidePopup, hidePopupImpl, installFollowAdapter, isAlwaysOnTop, isAnimate, isCloseOnOuterAction, isDisplaying, isFollowInvoker, isHiding, isWindowOpaque, onFullDisplay, onFullHide, packAndCenter, packAndCenter, packToHeight, packToWidth, removePopupListener, setAlwaysOnTop, setAnimate, setCloseOnOuterAction, setFollowInvoker, setOpaque, setStepProgress, setWindowOpacity, setWindowOpaque, showAnimationStepPerformed, showPopup, showPopup, showPopupImpl, uninstallFollowAdapter, updateOpacity, updateOpaqueadd, add, add, add, add, add, addStyleListener, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, addToolTip, contains, equalizeComponentsHeight, equalizeComponentsSize, equalizeComponentsWidth, getCustomPainter, getCustomPainter, getCustomPainters, getFirstComponent, getLanguageContainerKey, getLastComponent, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getPadding, getPreferredHeight, getPreferredSize, getPreferredWidth, getSkin, getStyleId, onDoubleClick, onFocusGain, onFocusLoss, onKeyPress, onKeyPress, onKeyRelease, onKeyRelease, onKeyType, onKeyType, onMenuTrigger, onMouseClick, onMouseClick, onMouseDrag, onMouseDrag, onMouseEnter, onMouseExit, onMousePress, onMousePress, provideShape, remove, remove, removeAll, removeLanguageContainerKey, removeStyleListener, removeToolTip, removeToolTips, removeToolTips, removeToolTips, restoreDefaultPainters, restoreSkin, setCustomPainter, setCustomPainter, setLanguageContainerKey, setMargin, setMargin, setMargin, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumWidth, setPadding, setPadding, setPadding, setPreferredHeight, setPreferredSize, setPreferredWidth, setSkin, setSkin, setStyleId, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, setToolTip, updateUIgetAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected java.util.List<NotificationListener> listeners
protected boolean clickToClose
protected boolean closeOnOptionSelection
protected boolean equalizeButtonWidths
protected long displayTime
protected com.alee.utils.swing.WebTimer displayTimer
protected boolean accepted
protected javax.swing.Icon icon
protected java.awt.Component content
protected java.util.List<NotificationOption> options
protected WebImage iconImage
protected WebPanel contentPanel
protected WebPanel optionsPanel
protected AlignPanel westPanel
protected AlignPanel centerPanel
protected AlignPanel southPanel
public WebNotification()
public WebNotification(StyleId styleId)
styleId - style IDprotected void initializeNotificationPopup()
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon - new notification iconpublic void setIcon(NotificationIcon iconType)
iconType - new notification icon typeprotected void updateIcon()
public java.awt.Component getContent()
public void setContent(java.awt.Component content)
content - new notification contentpublic void setContent(java.lang.String content)
content - new notification text contentprotected void updateContent()
public java.util.List<NotificationOption> getOptions()
public void setOptions(NotificationOption... options)
options - new notification optionspublic void setOptions(java.util.List<NotificationOption> options)
options - new notification options listprotected void updateOptionButtons()
public void acceptAndHide()
public boolean isClickToClose()
public void setClickToClose(boolean clickToClose)
clickToClose - whether notification can be closed by simple click on popup or notpublic boolean isCloseOnOptionSelection()
public void setCloseOnOptionSelection(boolean closeOnOptionSelection)
closeOnOptionSelection - whether notification popup should be closed when some option is selected by user or notpublic boolean isEqualizeButtonWidths()
public void setEqualizeButtonWidths(boolean equalizeButtonWidths)
equalizeButtonWidths - whether or not notification option button widths should be equalizedpublic long getDisplayTime()
public void setDisplayTime(long displayTime)
displayTime - new notification display timepublic javax.swing.JWindow pack()
WebPopuppublic void addNotificationListener(NotificationListener listener)
listener - directory chooser listener to addpublic void removeNotificationListener(NotificationListener listener)
listener - directory chooser listener to removepublic void fireOptionSelected(NotificationOption option)
option - selected optionpublic void fireAccepted()
public void fireClosed()