|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.yospace.yae.yogi.YogiComponent
|
+--com.yospace.yae.yogi.YogiPopup
A popup component. The popup is added to the root content pane in the correct layer with respect to the popup's associated modal root pane. The showDialog static methods constitute convenience methods where the Panelet writer requires a "dialog"-style popup such as an alert, a confirm box, a text entry prompt or a "waiting"-style message.
| Field Summary | |
static int |
DIALOG_ALERT
The constant used to create alert dialogs. |
static int |
DIALOG_CONFIRM
The constant used to create confirm dialogs. |
static int |
DIALOG_PROMPT
The constant used to create prompt dialogs. |
static int |
DIALOG_WAITING
The constant used to create waiting dialogs. |
static int |
PROPERTY_COMPONENT_PARENT
The property constant used for defining the parent of the popup. |
static int |
PROPERTY_MODAL
The property constant used for defining whether the popup is modal. |
boolean |
usingCustomComponent
Whether or not this dialog is using a custom component. |
| Constructor Summary | |
YogiPopup()
Default constructor sets up the component parent to be null and the popup to be non-modal. |
|
YogiPopup(YogiComponent componentParent,
boolean modal)
This constructor should be used where possible. |
|
| Method Summary | |
int |
getButtonPressedIndex()
Accessor method for getting the button that was pressed on this dialog. |
YogiComponent |
getComponentParent()
Accessor method for getting hold of the parent of the YogiPopup. |
int |
getDialogType()
Accessor method for getting the type of dialog that popup is. |
YogiComponent |
getParent()
Overrides inheritted method to always return null, thus stopping the application writer from accessing components outside of the confines of the popup. |
PopupModalRoot |
getPopupModalRoot()
Accessor method for getting hold of the popup modal root. |
void |
hide()
Hides the popup. |
boolean |
isModal()
Accessor method for getting the component's modal state. |
void |
setComponentParent(YogiComponent c)
Sets the conceptual parent of this popup to be the given component. |
static void |
setLayeredPane(YogiRootWindow key)
Method used at startup to register the layered pane to add all popups to. |
void |
setModal(boolean modal)
Setter method for the popup's modal state. |
void |
show()
Displays the popup. |
static void |
showDialog(YogiComponent componentParent,
int type,
java.lang.String message,
java.lang.String[] buttonText,
ActionListener userDialogListener)
Static convenience method which simply takes one less parameter, component, than its
six argument equivalent. |
static void |
showDialog(YogiComponent componentParent,
int type,
java.lang.String message,
YogiComponent component,
java.lang.String[] buttonText,
ActionListener userDialogListener)
Static convenience method which allows for a (user configured) dialog-style popup to be displayed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PROPERTY_COMPONENT_PARENT
public static final int PROPERTY_MODAL
public static final int DIALOG_ALERT
public static final int DIALOG_CONFIRM
public static final int DIALOG_PROMPT
public static final int DIALOG_WAITING
public boolean usingCustomComponent
| Constructor Detail |
public YogiPopup()
public YogiPopup(YogiComponent componentParent,
boolean modal)
componentParent - the conceptual parent of this component.modal - whether the Popup is modal or not.| Method Detail |
public YogiComponent getParent()
getParent in class YogiComponentpublic static void setLayeredPane(YogiRootWindow key)
key - the root window, of which the layered pane is a child.public final void setComponentParent(YogiComponent c)
c - the conceptual parent of the popup.public YogiComponent getComponentParent()
null if it has not been set.public PopupModalRoot getPopupModalRoot()
null if it has not been set.public void setModal(boolean modal)
modal - the modality value to set for this popup.public boolean isModal()
public void show()
public void hide()
show has not yet been
called. Resets the popup modal root's enabled state back to its value before the popup was shown.
A subsequent call to show() should cause the popup to be re-displayed in the
state that it was just prior to the call to hide().
public static void showDialog(YogiComponent componentParent,
int type,
java.lang.String message,
YogiComponent component,
java.lang.String[] buttonText,
ActionListener userDialogListener)
x Strings in the array represent the text on the default buttons,
where x is the number of default buttons associated with this dialog type. Adding entries
in the String array beyond x tells the method to add extra custom buttons to the dialog.
Using null in an array index represents a request to use the default string, if one exists.
and performing a((YogiPopup)source).getButtonPressedIndex();
switch on this value to decide what subsequent action to take. Once any button
is pressed on the popup, the dialog is automatically removed from the screen.
PROMPT dialog,
and if the component given is a YogiImageComponent then this image component is used
instead of the default one. Similarly, if we have a PROMPT dialog and the component is a YogiTextField then this text field is used.componentParent - the component which is requesting this dialog.type - the desired dialog type. For valid types see above.message - the text to be displayed in the text area of the dialog.component - a custom YogiImageComponent or YogiTextField to be used in the dialog.buttonText - the array of Strings to be used on the generated buttons.userDialogListener - an instance of ActionListener which is associated with the dialog, and
includes action code for when each button is pressed.java.lang.IllegalArgumentException - if the given dialog type is invalid.
public static void showDialog(YogiComponent componentParent,
int type,
java.lang.String message,
java.lang.String[] buttonText,
ActionListener userDialogListener)
component, than its
six argument equivalent. Simply calls #showDialog(YogiComponent, int, String, YogiComponent, String[], ActionListener) with null in
component field.componentParent - the component which is requesting this dialog.type - the desired dialog type.message - the text to be displayed in the text area of the dialog.buttonText - the array of Strings to be used on the generated buttons.userDialogListener - an instance of ActionListener which is associated with the dialog, and
receives an event when one of the dialog's buttons is pressed.public int getDialogType()
public int getButtonPressedIndex()
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||