com.novell.utility.nmsgbox
Class NMsgBox

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--com.novell.application.console.widgets.NDialog
                                      |
                                      +--com.novell.utility.nmsgbox.NMsgBox
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, com.novell.application.console.testing.C1Automation, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class NMsgBox
extends com.novell.application.console.widgets.NDialog
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, com.novell.application.console.testing.C1Automation

Provides a common message box for displaying messages.

This message box consists of the following four types:


Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int CANCEL
          [Cancel] button identifier.
static int CLOSE
          [Close] button identifier.
static int CONFIRM
          Confirmation message box type.
static int DETAILS
          [Details] button identifier.
static int ERROR
          Error message box type.
static int ERROR_IGNORE
          Error allowing the user to ignore, ignore all, or cancel.
static int IGNORE
          [IGNORE] button identifier.
static int IGNORE_ALL
          [IGNORE_ALL] button identifier.
static int INFO
          Information message box type.
static int NO
          [No] button identifier.
static int NO_ALL
          [No All] button identifier.
static int OK
          [OK] button identifier.
static int PROMPT
          [Prompt] button identifier.
static int WARN
          Warning message box type.
static int WARN_ALL
          Warning all message box type.
static int WARN_ALL_WITH_CANCEL
          Warning all message box type with cancel.
static int WARN_PROMPT_WITH_CANCEL
          Warn with prompt option and cancel.
static int WARN_WITH_CANCEL
          Warning message box type with cancel.
static int YES
          [Yes] button identifier.
static int YES_ALL
          [Yes All] button identifier.
 
Fields inherited from class com.novell.application.console.widgets.NDialog
CANCEL_BUTTON, CLOSE_BUTTON, HELP_BUTTON, NO_BUTTON, NULL_BUTTON, OK_BUTTON, parent, YES_BUTTON
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
NMsgBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, int type)
          Creates a pre-defined modal message box without help system support.
NMsgBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, int type, java.lang.String helpSetName)
          Creates a pre-defined modal message box with help system support.
NMsgBox(java.awt.Component parent, java.lang.String title, java.lang.String msg, int type, java.lang.String helpSetName, java.lang.String helpID)
          Creates a pre-defined modal message box with help system support.
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
          Adds a component to the button panel.
 java.util.Vector c1AutomationInvoke(java.util.Vector vTokens)
           
 java.awt.Dimension getPreferredSize()
          Return the preferred size of the message box dialog.
 int getPressedButton()
          Returns the button that was pressed.
protected  void help()
          Override superclass help method.
 void keyPressed(java.awt.event.KeyEvent event)
           
 void keyReleased(java.awt.event.KeyEvent event)
           
 void keyTyped(java.awt.event.KeyEvent event)
           
 int launch()
          Launches the message box, calls setVisible(true), and calls getPressedButton() to return the button that the user pressed.
 void setVisible(boolean state)
          Override the setVisible() and try to work out a more thread safe war of doing nMsgBox.
 
Methods inherited from class com.novell.application.console.widgets.NDialog
add, add, add, add, closeDialog, processEvent, setEmptyBorder, setEmptyBorder, setLayout, setPressedButton, show
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIRM

public static final int CONFIRM
Confirmation message box type.

(CONFIRM = 0)


INFO

public static final int INFO
Information message box type.

(INFO = 1)


WARN

public static final int WARN
Warning message box type.

(WARN = 2)


ERROR

public static final int ERROR
Error message box type.

(ERROR = 3)


WARN_ALL

public static final int WARN_ALL
Warning all message box type.

(WARN_ALL = 4)


WARN_WITH_CANCEL

public static final int WARN_WITH_CANCEL
Warning message box type with cancel.

(WARN_WITH_CANCEL = 5)


WARN_ALL_WITH_CANCEL

public static final int WARN_ALL_WITH_CANCEL
Warning all message box type with cancel.

(WARN_ALL_WITH_CANCEL = 6)


WARN_PROMPT_WITH_CANCEL

public static final int WARN_PROMPT_WITH_CANCEL
Warn with prompt option and cancel.

(WARN_PROMPT_WITH_CANCEL = 7)


ERROR_IGNORE

public static final int ERROR_IGNORE
Error allowing the user to ignore, ignore all, or cancel.

(ERROR_IGNORE = 8)


OK

public static final int OK
[OK] button identifier.

(OK = 0x0001)


CANCEL

public static final int CANCEL
[Cancel] button identifier.

(CANCEL = 0x0002)


CLOSE

public static final int CLOSE
[Close] button identifier.

(CLOSE = 0x0004)


YES

public static final int YES
[Yes] button identifier.

(YES = 0x0008)


NO

public static final int NO
[No] button identifier.

(NO = 0x0010)


DETAILS

public static final int DETAILS
[Details] button identifier.

(DETAILS = 0x00020)


YES_ALL

public static final int YES_ALL
[Yes All] button identifier.

(YES_ALL = 0x0040)


NO_ALL

public static final int NO_ALL
[No All] button identifier.

(NO_ALL = 0x0080)


PROMPT

public static final int PROMPT
[Prompt] button identifier.

(PROMPT = 0x0100)


IGNORE

public static final int IGNORE
[IGNORE] button identifier.

(IGNORE = 0x0102


IGNORE_ALL

public static final int IGNORE_ALL
[IGNORE_ALL] button identifier.

(IGNORE_ALL = 0x0104

Constructor Detail

NMsgBox

public NMsgBox(java.awt.Component parent,
               java.lang.String title,
               java.lang.String msg,
               int type,
               java.lang.String helpSetName,
               java.lang.String helpID)
Creates a pre-defined modal message box with help system support.
Parameters:
parent - The parent Component.
title - The title to be put in the title bar.
msg - The message to be displayed in the message area.
type - The type of the pre-built message box.
helpSetName - The help set file name (pass in 'null' for no help).
helpID - The help set ID.

NMsgBox

public NMsgBox(java.awt.Component parent,
               java.lang.String title,
               java.lang.String msg,
               int type,
               java.lang.String helpSetName)
Creates a pre-defined modal message box with help system support.
Parameters:
parent - The parent component.
title - The title to be put in the title bar.
msg - The message to be displayed in the message area.
type - The type of the pre-built message box.
helpSetName - The help set file name (pass in 'null' for no help).

NMsgBox

public NMsgBox(java.awt.Component parent,
               java.lang.String title,
               java.lang.String msg,
               int type)
Creates a pre-defined modal message box without help system support.
Parameters:
parent - The parent component.
title - The title to be put in the title bar.
msg - The message to be displayed in the message area.
type - The type of the pre-built message box.
Method Detail

add

public java.awt.Component add(java.awt.Component comp)
Adds a component to the button panel.
Parameters:
comp - The Component to add to the button panel.
Returns:
The Component added to the button panel.
Overrides:
add in class com.novell.application.console.widgets.NDialog

getPreferredSize

public java.awt.Dimension getPreferredSize()
Return the preferred size of the message box dialog.

You can override the Dimension returned from getPreferredSize() to make sure your page is shown properly, otherwise the page will be displayed at the default standard size.

Returns:
The preferred size as a Dimension type.
Overrides:
getPreferredSize in class java.awt.Container

launch

public int launch()
Launches the message box, calls setVisible(true), and calls getPressedButton() to return the button that the user pressed.
Returns:
The integer ID of the button that the user pressed to dismiss the message box.
Overrides:
launch in class com.novell.application.console.widgets.NDialog
See Also:
setVisible(boolean), getPressedButton()

setVisible

public void setVisible(boolean state)
Override the setVisible() and try to work out a more thread safe war of doing nMsgBox. This may not be on the main event loop thread and it causes problems some places like JRE 1.3 on Linux
Overrides:
setVisible in class com.novell.application.console.widgets.NDialog
See Also:
setVisible(boolean)

getPressedButton

public int getPressedButton()
Returns the button that was pressed.

This method is intended to be called after the message box is launched and then dismissed.

Returns:
Integer ID of the button that was pressed.
Overrides:
getPressedButton in class com.novell.application.console.widgets.NDialog
See Also:
launch()

help

protected void help()
Override superclass help method.
Overrides:
help in class com.novell.application.console.widgets.NDialog

keyReleased

public void keyReleased(java.awt.event.KeyEvent event)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent event)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent event)
Specified by:
keyTyped in interface java.awt.event.KeyListener

c1AutomationInvoke

public java.util.Vector c1AutomationInvoke(java.util.Vector vTokens)
Specified by:
c1AutomationInvoke in interface com.novell.application.console.testing.C1Automation


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.