Class NotificationsIndicatorImpl
java.lang.Object
io.jmix.ui.component.CompositeComponent<HBoxLayout>
io.jmix.notificationsui.component.impl.NotificationsIndicatorImpl
- All Implemented Interfaces:
NotificationsIndicator,AttachNotifier,Component,Component.BelongToFrame,Component.HasCaption,Component.HasDescription,Component.HasIcon,HasValueSource<String>,HasContextHelp,HasDebugId,HasFormatter<String>,HasHtmlDescription,HasHtmlSanitizer,HasValue<String>,Label<String>
public class NotificationsIndicatorImpl
extends CompositeComponent<HBoxLayout>
implements NotificationsIndicator
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.component.CompositeComponent
CompositeComponent.CreateEventNested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected intprotected intprotected CurrentAuthenticationprotected DataManagerprotected booleanprotected Metadatastatic final Stringprotected Notificationsprotected ScreensFields inherited from class io.jmix.ui.component.CompositeComponent
applicationContext, frame, id, prefixId, rootFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZEFields inherited from interface io.jmix.ui.component.Label
TYPE_BIGDECIMAL, TYPE_DATE, TYPE_DATETIME, TYPE_DEFAULT, TYPE_DOUBLE, TYPE_INTEGER, TYPE_LOCALDATE, TYPE_LOCALDATETIME, TYPE_LONG, TYPE_OFFSETTIME, TYPE_STRING, TYPE_TIMEFields inherited from interface io.jmix.notificationsui.component.NotificationsIndicator
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCount()Returns current amount of unread notifications.getIcon()Get icon source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.Returns a string representation of the value.Styles implementation is client-type-specific.getValue()voidprotected booleanbooleanbooleanbooleanprotected voidonCreate(CompositeComponent.CreateEvent createEvent) protected voidvoidReloads counter of amount of unread notifications.voidsetCaption(String caption) Sets the component's caption.voidSets a context help icon click handler.voidsetContextHelpText(String contextHelpText) Sets context help text.voidsetContextHelpTextHtmlEnabled(boolean enabled) Defines if context help text can be presented as HTML.voidsetDescription(String description) Sets the component's description.voidsetDescriptionAsHtml(boolean descriptionAsHtml) Sets whether the description is rendered as HTML.voidsetFormatter(Formatter<? super String> formatter) voidsetHtmlEnabled(boolean htmlEnabled) voidSet an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.voidsetIconFromSet(Icons.Icon icon) Set an icon from an icon set.voidsetStyleName(String styleName) Sets one or more style names of the component, replacing any previous styles.voidvoidsetValueSource(ValueSource<String> valueSource) Sets value source for component.Methods inherited from class io.jmix.ui.component.CompositeComponent
addAttachListener, addCreateListener, addDetachListener, addStyleName, assignDebugId, attached, detached, disableEventListeners, enableEventListeners, getAlignment, getComposition, getCompositionOrNull, getDebugId, getEventHub, getFrame, getFullId, getHeight, getHeightSizeUnit, getId, getInnerComponent, getInnerComponentOptional, getParent, getPrefixId, getUiEventListeners, getWidth, getWidthSizeUnit, hasSubscriptions, isAttached, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, publish, removeStyleName, setAlignment, setApplicationContext, setComposition, setDebugId, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setId, setParent, setResponsive, setUiEventListeners, setVisible, setWidth, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, updateComponentIds, updateIdIfNeeded, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasValue
clear, getEmptyValue, isEmpty
-
Field Details
-
NOTIFICATION_INDICATOR_STYLENAME
- See Also:
-
screens
-
dataManager
-
currentAuthentication
-
notifications
-
accessManager
-
metadata
-
captionLabel
-
counterLabel
-
counter
protected int counter -
countRenderLimit
protected int countRenderLimit -
hasAccessToInAppNotifications
protected boolean hasAccessToInAppNotifications
-
-
Constructor Details
-
NotificationsIndicatorImpl
public NotificationsIndicatorImpl()
-
-
Method Details
-
onCreate
-
reloadCounter
public void reloadCounter()Description copied from interface:NotificationsIndicatorReloads counter of amount of unread notifications.- Specified by:
reloadCounterin interfaceNotificationsIndicator
-
openNotificationsList
protected void openNotificationsList() -
handlePushEvent
@EventListener(VaadinSessionNotificationEvent.class) public void handlePushEvent(VaadinSessionNotificationEvent event) -
getStyleName
Description copied from interface:ComponentStyles implementation is client-type-specific.- Specified by:
getStyleNamein interfaceComponent- Overrides:
getStyleNamein classCompositeComponent<HBoxLayout>- Returns:
- current style name.
-
setStyleName
Description copied from interface:ComponentSets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Specified by:
setStyleNamein interfaceComponent- Overrides:
setStyleNamein classCompositeComponent<HBoxLayout>- Parameters:
styleName- one or more style names separated by space.
-
getCount
public int getCount()Description copied from interface:NotificationsIndicatorReturns current amount of unread notifications.- Specified by:
getCountin interfaceNotificationsIndicator- Returns:
- amount of unread notifications
-
isHtmlEnabled
public boolean isHtmlEnabled()- Specified by:
isHtmlEnabledin interfaceLabel<String>
-
setHtmlEnabled
public void setHtmlEnabled(boolean htmlEnabled) - Specified by:
setHtmlEnabledin interfaceLabel<String>
-
getRawValue
Description copied from interface:LabelReturns a string representation of the value.- Specified by:
getRawValuein interfaceLabel<String>
-
getValue
-
setValue
-
addValueChangeListener
- Specified by:
addValueChangeListenerin interfaceHasValue<String>
-
getDescription
- Specified by:
getDescriptionin interfaceComponent.HasDescription- Returns:
- the components description, used in tooltips
-
setDescription
Description copied from interface:Component.HasDescriptionSets the component's description.- Specified by:
setDescriptionin interfaceComponent.HasDescription- Parameters:
description- the new description to set
-
getIcon
Description copied from interface:Component.HasIconGet icon source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.- Specified by:
getIconin interfaceComponent.HasIcon
-
setIcon
Description copied from interface:Component.HasIconSet an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.- Specified by:
setIconin interfaceComponent.HasIcon
-
setIconFromSet
Description copied from interface:Component.HasIconSet an icon from an icon set.- Specified by:
setIconFromSetin interfaceComponent.HasIcon
-
getContextHelpText
- Specified by:
getContextHelpTextin interfaceHasContextHelp- Returns:
- context help text
-
setContextHelpText
Description copied from interface:HasContextHelpSets context help text. If set, then a special icon will be added for a field.- Specified by:
setContextHelpTextin interfaceHasContextHelp- Parameters:
contextHelpText- context help text to be set
-
isContextHelpTextHtmlEnabled
public boolean isContextHelpTextHtmlEnabled()- Specified by:
isContextHelpTextHtmlEnabledin interfaceHasContextHelp- Returns:
- true if field accepts context help text in HTML format, false otherwise
-
setContextHelpTextHtmlEnabled
public void setContextHelpTextHtmlEnabled(boolean enabled) Description copied from interface:HasContextHelpDefines if context help text can be presented as HTML.- Specified by:
setContextHelpTextHtmlEnabledin interfaceHasContextHelp- Parameters:
enabled- true if field accepts context help text in HTML format, false otherwise
-
getContextHelpIconClickHandler
@Nullable public Consumer<HasContextHelp.ContextHelpIconClickEvent> getContextHelpIconClickHandler()- Specified by:
getContextHelpIconClickHandlerin interfaceHasContextHelp- Returns:
- a context help icon click handler
-
setContextHelpIconClickHandler
public void setContextHelpIconClickHandler(@Nullable Consumer<HasContextHelp.ContextHelpIconClickEvent> handler) Description copied from interface:HasContextHelpSets a context help icon click handler. If set, then a special icon will be added for a field. Click handler has priority over context help text, i.e. no tooltip with context help text will be shown if click listener is set.- Specified by:
setContextHelpIconClickHandlerin interfaceHasContextHelp- Parameters:
handler- the handler to set
-
getFormatter
- Specified by:
getFormatterin interfaceHasFormatter<String>
-
setFormatter
- Specified by:
setFormatterin interfaceHasFormatter<String>
-
isDescriptionAsHtml
public boolean isDescriptionAsHtml()- Specified by:
isDescriptionAsHtmlin interfaceHasHtmlDescription- Returns:
trueif the description is rendered as HTML,falseif rendered as plain text
-
setDescriptionAsHtml
public void setDescriptionAsHtml(boolean descriptionAsHtml) Description copied from interface:HasHtmlDescriptionSets whether the description is rendered as HTML.- Specified by:
setDescriptionAsHtmlin interfaceHasHtmlDescription- Parameters:
descriptionAsHtml-trueif the description is rendered as HTML,falseif rendered as plain text- See Also:
-
setValueSource
Description copied from interface:HasValueSourceSets value source for component.- Specified by:
setValueSourcein interfaceHasValueSource<String>- Parameters:
valueSource- value source
-
getValueSource
- Specified by:
getValueSourcein interfaceHasValueSource<String>- Returns:
- currently bound value source
-
getCaption
- Specified by:
getCaptionin interfaceComponent.HasCaption- Returns:
- the caption of the component
-
setCaption
Description copied from interface:Component.HasCaptionSets the component's caption.- Specified by:
setCaptionin interfaceComponent.HasCaption- Parameters:
caption- the new component's caption
-
hasAccessToInAppNotifications
protected boolean hasAccessToInAppNotifications()
-