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.CreateEvent
Nested 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.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected int
protected int
protected org.springframework.security.core.userdetails.UserDetails
protected CurrentUserSubstitution
protected DataManager
protected boolean
protected Metadata
static final String
protected Notifications
protected Screens
Fields inherited from class io.jmix.ui.component.CompositeComponent
applicationContext, frame, id, prefixId, root
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields 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_TIME
Fields inherited from interface io.jmix.notificationsui.component.NotificationsIndicator
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
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()
void
protected boolean
boolean
boolean
boolean
protected void
onCreate
(CompositeComponent.CreateEvent createEvent) protected void
void
Reloads counter of amount of unread notifications.void
setCaption
(String caption) Sets the component's caption.void
Sets a context help icon click handler.void
setContextHelpText
(String contextHelpText) Sets context help text.void
setContextHelpTextHtmlEnabled
(boolean enabled) Defines if context help text can be presented as HTML.void
setDescription
(String description) Sets the component's description.void
setDescriptionAsHtml
(boolean descriptionAsHtml) Sets whether the description is rendered as HTML.void
setFormatter
(Formatter<? super String> formatter) void
setHtmlEnabled
(boolean htmlEnabled) void
Set an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.void
setIconFromSet
(Icons.Icon icon) Set an icon from an icon set.void
setStyleName
(String styleName) Sets one or more style names of the component, replacing any previous styles.void
void
setValueSource
(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, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasValue
clear, getEmptyValue, isEmpty
-
Field Details
-
NOTIFICATION_INDICATOR_STYLENAME
- See Also:
-
screens
-
dataManager
-
currentUserSubstitution
-
notifications
-
accessManager
-
metadata
-
counterLabel
-
counter
protected int counter -
countRenderLimit
protected int countRenderLimit -
hasAccessToInAppNotifications
protected boolean hasAccessToInAppNotifications -
currentEffectiveUser
protected org.springframework.security.core.userdetails.UserDetails currentEffectiveUser
-
-
Constructor Details
-
NotificationsIndicatorImpl
public NotificationsIndicatorImpl()
-
-
Method Details
-
onCreate
-
reloadCounter
public void reloadCounter()Description copied from interface:NotificationsIndicator
Reloads counter of amount of unread notifications.- Specified by:
reloadCounter
in interfaceNotificationsIndicator
-
openNotificationsList
protected void openNotificationsList() -
handlePushEvent
@EventListener(VaadinSessionNotificationEvent.class) public void handlePushEvent(VaadinSessionNotificationEvent event) -
getStyleName
Description copied from interface:Component
Styles implementation is client-type-specific.- Specified by:
getStyleName
in interfaceComponent
- Overrides:
getStyleName
in classCompositeComponent<HBoxLayout>
- Returns:
- current style name.
-
setStyleName
Description copied from interface:Component
Sets 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:
setStyleName
in interfaceComponent
- Overrides:
setStyleName
in classCompositeComponent<HBoxLayout>
- Parameters:
styleName
- one or more style names separated by space.
-
getCount
public int getCount()Description copied from interface:NotificationsIndicator
Returns current amount of unread notifications.- Specified by:
getCount
in interfaceNotificationsIndicator
- Returns:
- amount of unread notifications
-
isHtmlEnabled
public boolean isHtmlEnabled()- Specified by:
isHtmlEnabled
in interfaceLabel<String>
-
setHtmlEnabled
public void setHtmlEnabled(boolean htmlEnabled) - Specified by:
setHtmlEnabled
in interfaceLabel<String>
-
getRawValue
Description copied from interface:Label
Returns a string representation of the value.- Specified by:
getRawValue
in interfaceLabel<String>
-
getValue
-
setValue
-
addValueChangeListener
- Specified by:
addValueChangeListener
in interfaceHasValue<String>
-
getDescription
- Specified by:
getDescription
in interfaceComponent.HasDescription
- Returns:
- the components description, used in tooltips
-
setDescription
Description copied from interface:Component.HasDescription
Sets the component's description.- Specified by:
setDescription
in interfaceComponent.HasDescription
- Parameters:
description
- the new description to set
-
getIcon
Description copied from interface:Component.HasIcon
Get icon source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.- Specified by:
getIcon
in interfaceComponent.HasIcon
-
setIcon
Description copied from interface:Component.HasIcon
Set an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.- Specified by:
setIcon
in interfaceComponent.HasIcon
-
setIconFromSet
Description copied from interface:Component.HasIcon
Set an icon from an icon set.- Specified by:
setIconFromSet
in interfaceComponent.HasIcon
-
getContextHelpText
- Specified by:
getContextHelpText
in interfaceHasContextHelp
- Returns:
- context help text
-
setContextHelpText
Description copied from interface:HasContextHelp
Sets context help text. If set, then a special icon will be added for a field.- Specified by:
setContextHelpText
in interfaceHasContextHelp
- Parameters:
contextHelpText
- context help text to be set
-
isContextHelpTextHtmlEnabled
public boolean isContextHelpTextHtmlEnabled()- Specified by:
isContextHelpTextHtmlEnabled
in interfaceHasContextHelp
- Returns:
- true if field accepts context help text in HTML format, false otherwise
-
setContextHelpTextHtmlEnabled
public void setContextHelpTextHtmlEnabled(boolean enabled) Description copied from interface:HasContextHelp
Defines if context help text can be presented as HTML.- Specified by:
setContextHelpTextHtmlEnabled
in interfaceHasContextHelp
- Parameters:
enabled
- true if field accepts context help text in HTML format, false otherwise
-
getContextHelpIconClickHandler
@Nullable public Consumer<HasContextHelp.ContextHelpIconClickEvent> getContextHelpIconClickHandler()- Specified by:
getContextHelpIconClickHandler
in interfaceHasContextHelp
- Returns:
- a context help icon click handler
-
setContextHelpIconClickHandler
public void setContextHelpIconClickHandler(@Nullable Consumer<HasContextHelp.ContextHelpIconClickEvent> handler) Description copied from interface:HasContextHelp
Sets 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:
setContextHelpIconClickHandler
in interfaceHasContextHelp
- Parameters:
handler
- the handler to set
-
getFormatter
- Specified by:
getFormatter
in interfaceHasFormatter<String>
-
setFormatter
- Specified by:
setFormatter
in interfaceHasFormatter<String>
-
isDescriptionAsHtml
public boolean isDescriptionAsHtml()- Specified by:
isDescriptionAsHtml
in interfaceHasHtmlDescription
- Returns:
true
if the description is rendered as HTML,false
if rendered as plain text
-
setDescriptionAsHtml
public void setDescriptionAsHtml(boolean descriptionAsHtml) Description copied from interface:HasHtmlDescription
Sets whether the description is rendered as HTML.- Specified by:
setDescriptionAsHtml
in interfaceHasHtmlDescription
- Parameters:
descriptionAsHtml
-true
if the description is rendered as HTML,false
if rendered as plain text- See Also:
-
setValueSource
Description copied from interface:HasValueSource
Sets value source for component.- Specified by:
setValueSource
in interfaceHasValueSource<String>
- Parameters:
valueSource
- value source
-
getValueSource
- Specified by:
getValueSource
in interfaceHasValueSource<String>
- Returns:
- currently bound value source
-
getCaption
- Specified by:
getCaption
in interfaceComponent.HasCaption
- Returns:
- the caption of the component
-
setCaption
Description copied from interface:Component.HasCaption
Sets the component's caption.- Specified by:
setCaption
in interfaceComponent.HasCaption
- Parameters:
caption
- the new component's caption
-
hasAccessToInAppNotifications
protected boolean hasAccessToInAppNotifications()
-