com.aelitis.azureus.ui.swt.views.skin
Class VuzeMessageBox

java.lang.Object
  extended by com.aelitis.azureus.ui.swt.views.skin.VuzeMessageBox
All Implemented Interfaces:
SkinnedDialog.SkinnedDialogClosedListener, UIFunctionsUserPrompter

public class VuzeMessageBox
extends java.lang.Object
implements UIFunctionsUserPrompter, SkinnedDialog.SkinnedDialogClosedListener


Constructor Summary
VuzeMessageBox(java.lang.String title, java.lang.String text, java.lang.String[] buttons, int defaultOption)
           
 
Method Summary
protected  void _open(UserPrompterResultListener l)
           
 void addListener(UserPrompterResultListener l)
           
 void addResourceBundle(java.lang.Class<?> cla, java.lang.String path, java.lang.String name)
           
 void close(int buttonNo)
          Deprecated. Since buttons can swap around, you should use closeWithButtonVal(int)
 void closeWithButtonVal(int buttonVal)
           
 int getAutoCloseInMS()
          Returns the number milliseconds the prompt will wait around until it auto closes.
 org.eclipse.swt.widgets.Button[] getButtons()
           
 java.lang.String getHtml()
          Returns the HTML that will be displayed along with the prompt
 java.lang.String getRememberID()
          Retrieves the Remember ID associated with this prompt
 java.lang.String getRememberText()
          Retrieves the text to be displayed by the "Remember this Action" checkbox
 boolean isAutoClosed()
          Determines if the prompt was auto closed after #open() was called, or if the user chose an option.
 void open(UserPrompterResultListener l)
          Opens the prompt.
 void setAutoCloseInMS(int autoCloseInMS)
          Sets the # of milliseconds before auto closing.
 void setButtonEnabled(int buttonVal, boolean enable)
           
 void setButtonVals(java.lang.Integer[] buttonVals)
           
 void setDefaultButtonByPos(int pos)
           
 void setHtml(java.lang.String html)
           
 void setIconResource(java.lang.String resource)
           
 void setListener(VuzeMessageBoxListener l)
           
 void setOneInstanceOf(java.lang.String instanceID)
          Prevent more than one dialog of instanceID from showing up at once
 void setRelatedObject(java.lang.Object relatedObject)
           
 void setRelatedObjects(java.lang.Object[] relatedObjects)
           
 void setRemember(java.lang.String rememberID, boolean rememberByDefault, java.lang.String rememberText)
           
 void setRememberOnlyIfButton(int button)
           
 void setRememberText(java.lang.String rememberText)
           
 void setSkinnedDialagTemplate(java.lang.String dialogTempate)
           
 void setSubTitle(java.lang.String s)
           
 void setTextIconResource(java.lang.String resource)
           
 void setUrl(java.lang.String url)
           
 void skinDialogClosed(SkinnedDialog dialog)
           
 int waitUntilClosed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VuzeMessageBox

public VuzeMessageBox(java.lang.String title,
                      java.lang.String text,
                      java.lang.String[] buttons,
                      int defaultOption)
Method Detail

setButtonEnabled

public void setButtonEnabled(int buttonVal,
                             boolean enable)

setButtonVals

public void setButtonVals(java.lang.Integer[] buttonVals)

setSubTitle

public void setSubTitle(java.lang.String s)

getAutoCloseInMS

public int getAutoCloseInMS()
Description copied from interface: UIFunctionsUserPrompter
Returns the number milliseconds the prompt will wait around until it auto closes. Timer starts after the user is prompted (when #open() is called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)

Specified by:
getAutoCloseInMS in interface UIFunctionsUserPrompter
Returns:
MS before prompt auto-closes, 0 for no auto-close

getHtml

public java.lang.String getHtml()
Description copied from interface: UIFunctionsUserPrompter
Returns the HTML that will be displayed along with the prompt

TODO: Create a boolean canHandleHTML()

Specified by:
getHtml in interface UIFunctionsUserPrompter
Returns:

getRememberID

public java.lang.String getRememberID()
Description copied from interface: UIFunctionsUserPrompter
Retrieves the Remember ID associated with this prompt

Specified by:
getRememberID in interface UIFunctionsUserPrompter
Returns:
Remember ID

getRememberText

public java.lang.String getRememberText()
Description copied from interface: UIFunctionsUserPrompter
Retrieves the text to be displayed by the "Remember this Action" checkbox

Specified by:
getRememberText in interface UIFunctionsUserPrompter
Returns:
Remember text

isAutoClosed

public boolean isAutoClosed()
Description copied from interface: UIFunctionsUserPrompter
Determines if the prompt was auto closed after #open() was called, or if the user chose an option.

Specified by:
isAutoClosed in interface UIFunctionsUserPrompter
Returns:
true: auto-closed after timeout
false: user chose an option

open

public void open(UserPrompterResultListener l)
Description copied from interface: UIFunctionsUserPrompter
Opens the prompt. returns when user has chosen an action, or auto-close

Specified by:
open in interface UIFunctionsUserPrompter

setSkinnedDialagTemplate

public void setSkinnedDialagTemplate(java.lang.String dialogTempate)

_open

protected void _open(UserPrompterResultListener l)

getButtons

public org.eclipse.swt.widgets.Button[] getButtons()

setAutoCloseInMS

public void setAutoCloseInMS(int autoCloseInMS)
Description copied from interface: UIFunctionsUserPrompter
Sets the # of milliseconds before auto closing. Timer starts after the user is prompted (when #open() is called), and typically does not decrease while the user is viewing the prompt (certain implementations may operate differently)

Specified by:
setAutoCloseInMS in interface UIFunctionsUserPrompter

setHtml

public void setHtml(java.lang.String html)
Specified by:
setHtml in interface UIFunctionsUserPrompter

setIconResource

public void setIconResource(java.lang.String resource)
Specified by:
setIconResource in interface UIFunctionsUserPrompter
Parameters:
resource - image repository resource name (e.g. "error", "warning", "info")

setRelatedObject

public void setRelatedObject(java.lang.Object relatedObject)
Specified by:
setRelatedObject in interface UIFunctionsUserPrompter

setRelatedObjects

public void setRelatedObjects(java.lang.Object[] relatedObjects)
Specified by:
setRelatedObjects in interface UIFunctionsUserPrompter

setRemember

public void setRemember(java.lang.String rememberID,
                        boolean rememberByDefault,
                        java.lang.String rememberText)
Specified by:
setRemember in interface UIFunctionsUserPrompter

setRememberText

public void setRememberText(java.lang.String rememberText)
Specified by:
setRememberText in interface UIFunctionsUserPrompter

setRememberOnlyIfButton

public void setRememberOnlyIfButton(int button)
Specified by:
setRememberOnlyIfButton in interface UIFunctionsUserPrompter

setUrl

public void setUrl(java.lang.String url)
Specified by:
setUrl in interface UIFunctionsUserPrompter

waitUntilClosed

public int waitUntilClosed()
Specified by:
waitUntilClosed in interface UIFunctionsUserPrompter

skinDialogClosed

public void skinDialogClosed(SkinnedDialog dialog)
Specified by:
skinDialogClosed in interface SkinnedDialog.SkinnedDialogClosedListener

setListener

public void setListener(VuzeMessageBoxListener l)

close

public void close(int buttonNo)
Deprecated. Since buttons can swap around, you should use closeWithButtonVal(int)


closeWithButtonVal

public void closeWithButtonVal(int buttonVal)

addResourceBundle

public void addResourceBundle(java.lang.Class<?> cla,
                              java.lang.String path,
                              java.lang.String name)

setTextIconResource

public void setTextIconResource(java.lang.String resource)

addListener

public void addListener(UserPrompterResultListener l)

setDefaultButtonByPos

public void setDefaultButtonByPos(int pos)

setOneInstanceOf

public void setOneInstanceOf(java.lang.String instanceID)
Description copied from interface: UIFunctionsUserPrompter
Prevent more than one dialog of instanceID from showing up at once

Specified by:
setOneInstanceOf in interface UIFunctionsUserPrompter