Class AbstractNotification
java.lang.Object
com.nomagic.magicdraw.ui.notification.AbstractNotification
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Notification
Base MagicDraw notification composed of title, message text and list HRefRunnable actions
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractNotification
(String id, String text) Defines notification constructor with unique id, text and empty title.AbstractNotification
(String id, String title, String text) Defines notification constructor with unique id, title and text.AbstractNotification
(String id, String title, String text, HRefRunnable[] actions) Defines notification constructor with unique id, title, text and list of href actions.AbstractNotification
(String id, String title, String text, String longText) Defines notification constructor with unique id, title, short and long description.AbstractNotification
(String id, String title, String text, String longText, HRefRunnable[] actions) Defines notification constructor with unique id, title, text and list of href actions. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAllHRefActions
(HRefRunnable[] hrefActions) Adds array of href actions to already existing list of actions.void
Adds href action to list of already existing list of actions.boolean
Indicates if notification message can be disabled and will not be displayed anymore.protected void
Removes all href actions from notification.Returns array of all href actions.getHRefAction
(String href) Gets href action with a given href.getID()
Returns notification id.Returns long notification textgetText()
Returns notification message text.getTitle()
Returns notification title.void
Removes given href action.void
removeHRefAction
(String href) Removes given href action with specified href id.void
setCanDisable
(boolean canDisable) Sets notification ability to be disabled permanently by user.void
setCanDisable
(boolean canDisable, com.nomagic.magicdraw.ui.notification.HideNotificationRunnable actionOnDisable) Sets notification ability to be disabled permanently by user.void
setLongText
(String longText) Sets notification long textvoid
Sets notification message text.void
Sets notification title.
-
Constructor Details
-
AbstractNotification
public AbstractNotification() -
AbstractNotification
Defines notification constructor with unique id, text and empty title.- Parameters:
id
- notification unique idtext
- notification message text
-
AbstractNotification
Defines notification constructor with unique id, title and text.- Parameters:
id
- notification unique idtitle
- notification titletext
- notification message text
-
AbstractNotification
Defines notification constructor with unique id, title, short and long description.- Parameters:
id
- notification unique idtitle
- notification titletext
- notification short message textlongText
- notification long message text
-
AbstractNotification
public AbstractNotification(String id, String title, String text, @CheckForNull HRefRunnable[] actions) Defines notification constructor with unique id, title, text and list of href actions.- Parameters:
id
- notification unique idtitle
- notification titletext
- notification message textactions
- list of href controls
-
AbstractNotification
public AbstractNotification(String id, @CheckForNull String title, @CheckForNull String text, @CheckForNull String longText, @CheckForNull HRefRunnable[] actions) Defines notification constructor with unique id, title, text and list of href actions.- Parameters:
id
- notification unique idtitle
- notification titletext
- notification message textlongText
- notification long textactions
- list of href controls
-
-
Method Details
-
getID
Returns notification id.- Returns:
- notification id
-
getTitle
Returns notification title.- Returns:
- notification title
-
setTitle
Sets notification title.- Parameters:
title
- notification title
-
getText
Returns notification message text.- Returns:
- notification text
-
setText
Sets notification message text.- Parameters:
text
- notification text
-
getLongText
Returns long notification text- Returns:
- long notification text
-
setLongText
Sets notification long text- Parameters:
longText
- notification long text
-
addHRefAction
Adds href action to list of already existing list of actions.- Parameters:
r
- given href action
-
addAllHRefActions
Adds array of href actions to already existing list of actions.- Parameters:
hrefActions
- array of href actions to add
-
getAllHRefActions
Returns array of all href actions.- Returns:
- array of href actions
-
removeHRefAction
Removes given href action.- Parameters:
r
- href action to remove
-
removeHRefAction
Removes given href action with specified href id.- Parameters:
href
- href id to remove from href list
-
getHRefAction
Gets href action with a given href. If action does not exist, null is returned.- Parameters:
href
- action href- Returns:
- href action if found, null otherwise
-
clearAllHRefActions
protected void clearAllHRefActions()Removes all href actions from notification. -
canDisable
public boolean canDisable()Indicates if notification message can be disabled and will not be displayed anymore. If the flag is set to true, when notification is shown, user will be present with ability to disable it. Disabled notification id will be saved in environment options and not shown anymore.- Returns:
- true if notification can be disabled
-
setCanDisable
public void setCanDisable(boolean canDisable) Sets notification ability to be disabled permanently by user. If canDisabled property is set to true, when notification is shown, user will be present with ability to disable it.- Parameters:
canDisable
- notification disable status.
-
setCanDisable
public void setCanDisable(boolean canDisable, com.nomagic.magicdraw.ui.notification.HideNotificationRunnable actionOnDisable) Sets notification ability to be disabled permanently by user. If canDisabled property is set to true, when notification is shown, user will be presented with ability to disable it.- Parameters:
canDisable
- notification disable status.actionOnDisable
- action to be executed when notification is disabled and closed.
-