net.xoetrope.awt
Class XMessageBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by net.xoetrope.xui.XPage
              extended by net.xoetrope.awt.XDialog
                  extended by net.xoetrope.awt.XMessageBox
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, XExceptionHandler, PageSupport, XContentPane, XMessageBoxSetup, XPage.IXDialog

public class XMessageBox
extends XDialog

    
implements XMessageBoxSetup

    

Creates a simple modal MessageBox with a label for the text and a close button

Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt $Revision: 2.8 $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.xoetrope.xui.XPage
XPage.IXDialog
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  XButton btnCancel
          The close button displayed on the message box title bar
static int CLOSE
          Show just an ok/close button
protected  int messageBoxStyle
          The message box style
static int OK_CANCEL
          Show an OK and a Cancel button
static int YES_NO_CANCEL
          Show an YES and a NO button
 
Fields inherited from class net.xoetrope.awt.XDialog
CANCEL_CLICKED, CLOSE_CLICKED, closeButtonID, contentPanel, DEFAULT_PADDING, focusComponent, lastReturnValue, NO_CLICKED, NOTHING_CLICKED_YET, OK_CLICKED, padding, returnObject, returnValue, saveOnClose, trueField
 
Fields inherited from class net.xoetrope.xui.XPage
ACTIVATED, adapter, ANNOTATEDIMAGE, antiAlias, BORDER_LAYOUT, BOX_LAYOUT, BUTTON, CARD_LAYOUT, CHECK, COMBO, componentFactory, CREATED, DEACTIVATED, DISCARDED, EDIT, FLOW_LAYOUT, GRID_LAYOUT, GRIDBAG_LAYOUT, GROUP, GUIDE_LAYOUT, HOTSPOTIMAGE, IMAGE, IMAGEMAP, LABEL, LIST, LOADED, MENU, MENUBAR, MENUITEM, METACONTENT, NULL_LAYOUT, pageHelper, pageMgr, PANEL, PASSWORD, project, RADIO, rootModel, SCALE_LAYOUT, SCROLLABLEMETACONTENT, SCROLLPANE, SPLITPANE, SPRING_LAYOUT, TABLE, TABPANEL, TEXTAREA, UNKNOWN, UNKNOWN_PAGE_STATE, WMF, XUI_AWT_PACKAGE, XUI_HTML_PACKAGE, XUI_SWING_PACKAGE, XUI_SWT_PACKAGE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
XMessageBox()
          Constructor creates the close image and the label for displaying the message.
 
Method Summary
 void cancelDlg()
          Cancel the dialog.
 void closeDlg()
          Close the dialog.
 void setSize(int width, int height)
          Adjust the size and locatio of the close image and the message label.
 void setup(java.lang.String title, java.lang.String msg, java.lang.Object size, java.lang.Object con)
          Setup the content of the message box
 void setup(java.lang.String title, java.lang.String msg, java.lang.Object size, java.lang.Object con, int style)
          Setup the content of the message box
 
Methods inherited from class net.xoetrope.awt.XDialog
getContentPane, getFocusComponent, getLastReturnValue, getMinimumSize, getPreferredSize, getReturnObject, pack, pageCreated, setBackground, setCaption, setFont, setForeground, setLocation, setModal, setResizable, setSaveOnClose, setUseNativeHeaders, showDialog, showDialog, showDialog, showModalWindow, wasMouseClicked
 
Methods inherited from class net.xoetrope.xui.XPage
accumulateMessages, addActionHandler, addBinding, addFocusHandler, addHandler, addHandler, addItemHandler, addKeyHandler, addListener, addMenuHandler, addMouseHandler, addMouseMotionHandler, addNotify, addTextHandler, addValidation, addValidation, addValidation, checkValidations, clearValidations, evaluateAttribute, evaluatePath, findComponent, findComponent, getAttribute, getAttribute, getAttributes, getBinding, getBinding, getBindings, getComponentFactory, getComponentName, getCurrentEvent, getEventAttribute, getEventHandler, getGraphics, getOwner, getPageName, getPageSize, getStatus, getValidationHandler, handleEventHandlerException, handleException, isFocusChangeSuppressed, layout, pageActivated, pageDeactivated, paint, paintSuper, removeBinding, saveBoundComponentValues, setAttribute, setClearPage, setComponentFactory, setEventHandler, setExceptionHandler, setLayout, setPageName, setStatus, setValidationFactory, setValidationFactory, showComponents, showHandCursor, showMessage, showMessage, showPage, showPage, showPrevious, stripAttributeValues, translate, update, updateBinding, updateBindings, updateBoundComponentValues, updateChildLayouts, validationHandler, wasMouseDoubleClicked, wasMouseRightClicked
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.xoetrope.xui.PageSupport
doLayout, getName, setLocation, setName, setVisible, validate
 

Field Detail

CLOSE

public static final int CLOSE
Show just an ok/close button

See Also:
Constant Field Values

OK_CANCEL

public static final int OK_CANCEL
Show an OK and a Cancel button

See Also:
Constant Field Values

YES_NO_CANCEL

public static final int YES_NO_CANCEL
Show an YES and a NO button

See Also:
Constant Field Values

btnCancel

protected XButton btnCancel
The close button displayed on the message box title bar


messageBoxStyle

protected int messageBoxStyle
The message box style

Constructor Detail

XMessageBox

public XMessageBox()
Constructor creates the close image and the label for displaying the message.

Method Detail

setup

public void setup(java.lang.String title,
                  java.lang.String msg,
                  java.lang.Object size,
                  java.lang.Object con)
Setup the content of the message box

Specified by:
setup in interface XMessageBoxSetup
Parameters:
title - the message box title or caption
msg - the text of the message
size - the size of the owner page
con - the container owning the message box

setup

public void setup(java.lang.String title,
                  java.lang.String msg,
                  java.lang.Object size,
                  java.lang.Object con,
                  int style)
Setup the content of the message box

Parameters:
title - the message box title or caption
msg - the text of the message
size - the size of the owner page
style - the message box style CLOSE or OK_CANCEL

cancelDlg

public void cancelDlg()
Cancel the dialog.

Overrides:
cancelDlg in class XDialog

closeDlg

public void closeDlg()
Close the dialog.

Overrides:
closeDlg in class XDialog

setSize

public void setSize(int width,
                    int height)
Adjust the size and locatio of the close image and the message label.

Specified by:
setSize in interface PageSupport
Overrides:
setSize in class XDialog
Parameters:
width - The new width of the dialog.
height - The new height of the dialog.