com.leafdigital.ui.api
Interface Dialog

All Superinterfaces:
WidgetOwner

public interface Dialog
extends WidgetOwner

This interface represents the contents of a single Dialog within the system. (Dialogs are similar to Windows, but modal i.e. user has to dismiss the dialog before they do anything else. For this reason they should be used sparingly.)


Method Summary
 void close()
          Closes the dialog.
 void setCloseable(boolean closeable)
          Set whether the user can close the dialog by clicking the X button.
 void setContents(org.w3c.dom.Element e)
          Clears existing contents and sets the contents of the dialog based on an XML document.
 void setContents(Widget w)
          Clears existing contents and sets the contents of the dialog to a single widget.
 void setInitialSize(int width, int height)
          Set the dialog's initial size.
 void setMinSize(int minWidth, int minHeight)
          Set the minimum size for this dialog.
 void setOnClosed(java.lang.String callback)
          Sets the action method called when dialog is closed.
 void setResizable(boolean resizable)
          Set whether the user can resize the dialog.
 void setTitle(java.lang.String title)
          Sets the dialog's title; used in title bar
 void show(WidgetOwner parent)
          Call when the dialog is ready to show.
 
Methods inherited from interface com.leafdigital.ui.api.WidgetOwner
getCallbackHandler, getGroupSelected, getWidget, isCreated, setWidgetID
 

Method Detail

setTitle

void setTitle(java.lang.String title)
Sets the dialog's title; used in title bar

Parameters:
title - New title text

setInitialSize

void setInitialSize(int width,
                    int height)
Set the dialog's initial size. This size is used when the dialog is shown.

Calling this after the dialog has been shown has no effect. If you choose a size lower than the minimum, the minimum will be used.

Parameters:
width - Initial width
height - Initial height

setResizable

void setResizable(boolean resizable)
Set whether the user can resize the dialog. The default is false.

Parameters:
resizable - True if user can resize window

setCloseable

void setCloseable(boolean closeable)
Set whether the user can close the dialog by clicking the X button. The default is true.

Parameters:
closeable - True if user can close window

setMinSize

void setMinSize(int minWidth,
                int minHeight)
Set the minimum size for this dialog. The system imposes its own minimum, so if you choose a very low minimum size it will be ignored.

Parameters:
minWidth -
minHeight -

show

void show(WidgetOwner parent)
Call when the dialog is ready to show. Nothing will be displayed until you call this method.

Unlike windows, your application is responsible for closing the dialog using close(). The user will not be able to access other windows until the dialog is hidden.

Parameters:
parent - The dialog is positioned relative to this. Null is OK.

setContents

void setContents(Widget w)
Clears existing contents and sets the contents of the dialog to a single widget.

Parameters:
w - Desired widget

setContents

void setContents(org.w3c.dom.Element e)
Clears existing contents and sets the contents of the dialog based on an XML document.

Parameters:
e - XML element; must follow the appropriate format
Throws:
BugException - If there are format problems with the XML

close

void close()
Closes the dialog. This is a permanent operation; once closed, the window may not be shown again.

After this call, the application will resume as normal.


setOnClosed

@UICallback
void setOnClosed(java.lang.String callback)
Sets the action method called when dialog is closed.

Parameters:
callback - Name of method
Throws:
BugException - If method doesn't exist etc.


Copyright © 2011 Samuel Marshall. All rights reserved.