org.gudy.azureus2.plugins.ui
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:

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
Author:
Allan Crooks

Field Summary
static int ANSWER_ABORT
           
static int ANSWER_CANCEL
           
static int ANSWER_IGNORE
           
static int ANSWER_NO
           
static int ANSWER_OK
           
static int ANSWER_RETRY
           
static int ANSWER_YES
           
static int INPUT_OK
           
static int INPUT_OK_CANCEL
           
static int INPUT_RETRY_CANCEL
           
static int INPUT_RETRY_CANCEL_IGNORE
           
static int INPUT_YES_NO
           
static int INPUT_YES_NO_CANCEL
           
static int MSG_ERROR
           
static int MSG_INFO
           
static int MSG_NONE
           
static int MSG_QUESTION
           
static int MSG_WARN
           
static int MSG_WORKING
           
 
Method Summary
 int ask()
          This displays the message to the user.
 void setInputType(int input_type)
          Sets what type of input is allowed - use one of the INPUT_ constants defined here.
 void setLocalisedMessage(String message)
          Sets the main message to display the user.
 void setLocalisedMessages(String[] messages)
          Sets the main message to display the user.
 void setLocalisedTitle(String title)
          Sets the title for the message.
 void setMessage(String message)
          Sets the main message to display the user.
 void setMessages(String[] messages)
          Sets the main message to display the user.
 void setMessageType(int msg_type)
          Sets what type of message to display - use one of the MSG_ constants defined here.
 void setTitle(String title)
          Sets the title for the message.
 

Field Detail

MSG_NONE

static final int MSG_NONE
See Also:
Constant Field Values

MSG_ERROR

static final int MSG_ERROR
See Also:
Constant Field Values

MSG_INFO

static final int MSG_INFO
See Also:
Constant Field Values

MSG_WARN

static final int MSG_WARN
See Also:
Constant Field Values

MSG_QUESTION

static final int MSG_QUESTION
See Also:
Constant Field Values

MSG_WORKING

static final int MSG_WORKING
See Also:
Constant Field Values

INPUT_OK

static final int INPUT_OK
See Also:
Constant Field Values

INPUT_OK_CANCEL

static final int INPUT_OK_CANCEL
See Also:
Constant Field Values

INPUT_YES_NO

static final int INPUT_YES_NO
See Also:
Constant Field Values

INPUT_YES_NO_CANCEL

static final int INPUT_YES_NO_CANCEL
See Also:
Constant Field Values

INPUT_RETRY_CANCEL

static final int INPUT_RETRY_CANCEL
See Also:
Constant Field Values

INPUT_RETRY_CANCEL_IGNORE

static final int INPUT_RETRY_CANCEL_IGNORE
See Also:
Constant Field Values

ANSWER_OK

static final int ANSWER_OK
See Also:
Constant Field Values

ANSWER_CANCEL

static final int ANSWER_CANCEL
See Also:
Constant Field Values

ANSWER_YES

static final int ANSWER_YES
See Also:
Constant Field Values

ANSWER_NO

static final int ANSWER_NO
See Also:
Constant Field Values

ANSWER_RETRY

static final int ANSWER_RETRY
See Also:
Constant Field Values

ANSWER_IGNORE

static final int ANSWER_IGNORE
See Also:
Constant Field Values

ANSWER_ABORT

static final int ANSWER_ABORT
See Also:
Constant Field Values
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(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(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(String message)
Sets the main message to display the user. For multiple lines, see setMessages(java.lang.String[]).


setLocalisedMessage

void setLocalisedMessage(String message)
Sets the main message to display the user. For multiple lines, see setLocalisedMessages(java.lang.String[]).


setMessages

void setMessages(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(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.