Class NotificationOptionDialogFrame

    • Constructor Detail

      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(Notification.Option... options)
        Options constructor. Duplicate options are ignored.
        Parameters:
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given options is null.
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(Notification notification)
        Notification constructor. Duplicate options are ignored.
        Parameters:
        notification - The notification that specifies the message and options.
        Throws:
        java.lang.NullPointerException - if the given notification is null. #see TextBox
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(java.lang.String text,
                                             Notification.Option... options)
        Text constructor with a default Text.PLAIN_CONTENT_TYPE content type. Duplicate options are ignored.
        Parameters:
        text - The text, which may include a resource reference, or null if there is no text.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given options is null. #see TextBox
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(java.lang.String text,
                                             com.globalmentor.net.ContentType textContentType,
                                             Notification.Option... options)
        Text and content type constructor Duplicate options are ignored.
        Parameters:
        text - The text, which may include a resource reference, or null if there is no text.
        textContentType - The content type of the text.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given content type and/or options is null.
        java.lang.IllegalArgumentException - if the given content type is not a text content type. #see TextBox
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(Component component,
                                             Notification.Option... options)
        Component and options constructor. Duplicate options are ignored.
        Parameters:
        component - The single child component, or null if this frame should have no child component.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given options is null.
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(ValueModel<Notification.Option> valueModel,
                                             Notification.Option... options)
        Value model, and options constructor. Duplicate options are ignored.
        Parameters:
        valueModel - The frame value model.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given value model and or options is null.
      • NotificationOptionDialogFrame

        public NotificationOptionDialogFrame​(ValueModel<Notification.Option> valueModel,
                                             Component component,
                                             Notification.Option... options)
        Value model, component, and options constructor. Duplicate options are ignored.
        Parameters:
        valueModel - The frame value model.
        component - The component representing the content of the option dialog frame, or null if there is no content component.
        options - The available options.
        Throws:
        java.lang.NullPointerException - if the given value model and/or options is null.
    • Method Detail

      • open

        public void open​(java.lang.Runnable afterNotify)
        Opens the frame as modal with a Runnable to be performed after modality ends successfully. When the frame closes, if a non-fatal option was chosen the given runnable is executed. This is a convenience method that delegates to Frame.open(com.globalmentor.beans.GenericPropertyChangeListener). If the selected option to any notification is fatal, the specified logic, if any, will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification.
        Parameters:
        afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
        See Also:
        Frame.open(com.globalmentor.beans.GenericPropertyChangeListener), Notification.Option.isFatal()