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 Object
implements UIFunctionsUserPrompter, SkinnedDialog.SkinnedDialogClosedListener


Constructor Summary
VuzeMessageBox(String title, String text, String[] buttons, int defaultOption)
           
 
Method Summary
protected  void _open(UserPrompterResultListener l)
           
 void addListener(UserPrompterResultListener l)
           
 void addResourceBundle(Class<?> cla, String path, 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()
           
 String getHtml()
          Returns the HTML that will be displayed along with the prompt
 String getRememberID()
          Retrieves the Remember ID associated with this prompt
 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(Integer[] buttonVals)
           
 void setDefaultButtonByPos(int pos)
           
 void setHtml(String html)
           
 void setIconResource(String resource)
           
 void setListener(VuzeMessageBoxListener l)
           
 void setOneInstanceOf(String instanceID)
          Prevent more than one dialog of instanceID from showing up at once
 void setRelatedObject(Object relatedObject)
           
 void setRelatedObjects(Object[] relatedObjects)
           
 void setRemember(String rememberID, boolean rememberByDefault, String rememberText)
           
 void setRememberOnlyIfButton(int button)
           
 void setRememberText(String rememberText)
           
 void setSkinnedDialagTemplate(String dialogTempate)
           
 void setSubTitle(String s)
           
 void setTextIconResource(String resource)
           
 void setUrl(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(String title,
                      String text,
                      String[] buttons,
                      int defaultOption)
Method Detail

setButtonEnabled

public void setButtonEnabled(int buttonVal,
                             boolean enable)

setButtonVals

public void setButtonVals(Integer[] buttonVals)

setSubTitle

public void setSubTitle(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 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 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 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(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(String html)
Specified by:
setHtml in interface UIFunctionsUserPrompter

setIconResource

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

setRelatedObject

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

setRelatedObjects

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

setRemember

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

setRememberText

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

setRememberOnlyIfButton

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

setUrl

public void setUrl(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(Class<?> cla,
                              String path,
                              String name)

setTextIconResource

public void setTextIconResource(String resource)

addListener

public void addListener(UserPrompterResultListener l)

setDefaultButtonByPos

public void setDefaultButtonByPos(int pos)

setOneInstanceOf

public void setOneInstanceOf(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