Interface UIMessage

  • All Known Implementing Classes:
    AbstractUIMessage, UIMessageImpl

    public interface UIMessage
    This interface provides a mechanism to display a message to the user, potentially to ask the user a question.

    There are four main elements to set:

    • the message type - defaults to MSG_NONE.
    • the input type - defaults to INPUT_OK.
    • the message title.
    • the message text.
    In the case of the main SWT interface, the use of this object will present a message box to a user. The message type indicates what sort of icon to display, the input type indicates what buttons are present, the message title is the message box title and the message text is the main message to be displayed.

    There are various methods which have a setXXX and setLocalisedXXX counterparts. The setXXX methods will attempt to translate the given string to a localised representation of it - the setLocalisedXXX method will assume that the localisation has already been done, and leave it intact.

    Note: Only for implementation by Azureus, not plugins.

    Since:
    3.0.5.3
    • Method Detail

      • setMessageType

        void setMessageType​(int msg_type)
        Sets what type of message to display - use one of the MSG_ constants defined here.
      • setInputType

        void setInputType​(int input_type)
        Sets what type of input is allowed - use one of the INPUT_ constants defined here.
      • setTitle

        void setTitle​(java.lang.String title)
        Sets the title for the message. For some interfaces, this means that a window will be presented, and the title of the window will be the value passed here.
      • setLocalisedTitle

        void setLocalisedTitle​(java.lang.String title)
        Sets the title for the message. For some interfaces, this means that a window will be presented, and the title of the window will be the value passed here.
      • setMessage

        void setMessage​(java.lang.String message)
        Sets the main message to display the user. For multiple lines, see setMessages(java.lang.String[]).
      • setMessages

        void setMessages​(java.lang.String[] messages)
        Sets the main message to display the user.

        The value passed here will be an array of strings - each string will be usually outputted on its own line.

      • setLocalisedMessages

        void setLocalisedMessages​(java.lang.String[] messages)
        Sets the main message to display the user.

        The value passed here will be an array of strings - each string will be usually outputted on its own line.

      • ask

        int ask()
        This displays the message to the user. The way that the user acknowledges will be the method result - which will be one of the ANSWER_ constants defined here.