Class Notification

  • All Implemented Interfaces:
    java.io.Serializable

    @OpenApiAll
    public class Notification
    extends AbstractNotification
    implements java.io.Serializable

    This class contains data used to construct and display MagicDraw notification. Notification can be displayed as separate popup in lower right corner or in designated area of control.

    NOTE: although HTML tags are supported, the notification title/text should not be wrapped into <html><body></body></html> tags as during the construction of the notification's popup, such wrapping is already done by the notification manager.

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Notification.Context
      Context enum indicates notification origin.
    • Constructor Summary

      Constructors 
      Constructor Description
      Notification()  
      Notification​(java.lang.String id, java.lang.String title)
      Constructs notification with specified id and title.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text)
      Constructs notification with specified id, title and text.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, HRefRunnable[] actions)
      Constructs notification with specified id, title, text and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, HRefRunnable[] actions, NotificationSeverity severity)
      Constructs notification with specified id, title, text, severity and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, HRefRunnable[] actions, NotificationSeverity severity, Notification.Context context)
      Constructs notification with specified id, title, text, severity, context and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, NotificationSeverity severity)
      Constructs notification with specified id, title, text and severity.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, java.lang.String longText)
      Constructs notification with specified id, title, short and long text description.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, java.lang.String longText, HRefRunnable[] actions)
      Constructs notification with specified id, title, short description, long description and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, java.lang.String longText, HRefRunnable[] actions, NotificationSeverity severity)
      Constructs notification with specified id, title, short text, long text, severity and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, java.lang.String longText, HRefRunnable[] actions, NotificationSeverity severity, Notification.Context context)
      Constructs notification with specified id, title, short text, long text, severity, context and list of actions user can perform upon notification.
      Notification​(java.lang.String id, java.lang.String title, java.lang.String text, java.lang.String longText, NotificationSeverity severity)
      Constructs notification with specified id, title, short description, long description and severity.
    • Constructor Detail

      • Notification

        public Notification()
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title)
        Constructs notification with specified id and title. Default ENVIRONMENT context and INFO severity is used while creating notification. No actions or text is set for this notification
        Parameters:
        id - notification unique id
        title - notification title
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text)
        Constructs notification with specified id, title and text. Default ENVIRONMENT context and INFO severity is used while creating notification. No actions are set for this notification
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            java.lang.String longText)
        Constructs notification with specified id, title, short and long text description. Default ENVIRONMENT context and INFO severity is used while creating notification. No actions are set for this notification
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        longText - notification long text
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            NotificationSeverity severity)
        Constructs notification with specified id, title, text and severity. Default ENVIRONMENT context is used while creating notification. No actions are set for this notification
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        severity - notification severity
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            java.lang.String longText,
                            NotificationSeverity severity)
        Constructs notification with specified id, title, short description, long description and severity. Default ENVIRONMENT context is used while creating notification. No actions are set for this notification
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        longText - notification long text
        severity - notification severity
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            HRefRunnable[] actions)
        Constructs notification with specified id, title, text and list of actions user can perform upon notification. Default ENVIRONMENT context and severity INFO is set while creating notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        actions - list of actions user can take
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            java.lang.String longText,
                            @CheckForNull
                            HRefRunnable[] actions)
        Constructs notification with specified id, title, short description, long description and list of actions user can perform upon notification. Default ENVIRONMENT context and severity INFO is set while creating notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        longText - notification long text
        actions - list of actions user can take
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            HRefRunnable[] actions,
                            NotificationSeverity severity)
        Constructs notification with specified id, title, text, severity and list of actions user can perform upon notification. Default ENVIRONMENT context is set while creating notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        actions - list of actions user can take
        severity - notification severity level
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            java.lang.String longText,
                            @CheckForNull
                            HRefRunnable[] actions,
                            NotificationSeverity severity)
        Constructs notification with specified id, title, short text, long text, severity and list of actions user can perform upon notification. Default ENVIRONMENT context is set while creating notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        actions - list of actions user can take
        severity - notification severity level
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            HRefRunnable[] actions,
                            NotificationSeverity severity,
                            Notification.Context context)
        Constructs notification with specified id, title, text, severity, context and list of actions user can perform upon notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        actions - list of actions user can take
        severity - notification severity level
        context - notification context
      • Notification

        public Notification​(java.lang.String id,
                            @CheckForNull
                            java.lang.String title,
                            @CheckForNull
                            java.lang.String text,
                            @CheckForNull
                            java.lang.String longText,
                            @CheckForNull
                            HRefRunnable[] actions,
                            NotificationSeverity severity,
                            Notification.Context context)
        Constructs notification with specified id, title, short text, long text, severity, context and list of actions user can perform upon notification.
        Parameters:
        id - notification unique id
        title - notification title
        text - notification text
        longText - notification long text
        actions - list of actions user can take
        severity - notification severity level
        context - notification context
    • Method Detail

      • getSeverity

        public NotificationSeverity getSeverity()
        Returns notification severity
        Returns:
        notification severity
      • setSeverity

        public void setSeverity​(NotificationSeverity severity)
        Sets notification severity
        Parameters:
        severity - new notification severity
      • getContext

        public Notification.Context getContext()
        Returns notification context
        Returns:
        notification context
      • setContext

        public void setContext​(Notification.Context context)
        Sets new notification context
        Parameters:
        context - notification context
      • setLongText

        public void setLongText​(@CheckForNull
                                java.lang.String longText)
        Description copied from class: AbstractNotification
        Sets notification long text
        Overrides:
        setLongText in class AbstractNotification
        Parameters:
        longText - notification long text
      • isLogExpanded

        public boolean isLogExpanded()
      • setLogExpanded

        public void setLogExpanded​(boolean logExpanded)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object