|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--com.jthomas.mailfaces.Prompter
Prompter.java Object that will prompt the user for some input. This implementation is primarily done to get around a bug in Java 1.0.2 modal Dialogs that does not wait for the User input before continuing. This Object is used as follows to display a message and wait for the user to press OK or Cancel: Prompter p = Prompter.create(); do this only once p.setMsgPrompt("Multiline \n msg"); p.showPrompt(); if (p.getStatus() == Prompter.STATUS_OK) ----- else System.exit(0); This Object is used as follows to display a prompt for input text and wait for the user to press OK or Cancel: Prompter p = Prompter.create(); do this only once p.setTextInputPrompt("Prompt msg","default value","Title line"); p.showPrompt(); if (p.getStatus() == Prompter.STATUS_OK) String result = p.getTextInput(); else System.exit(0); If used from within an action method, then the call to p.getStatus() should be done outside of of the action thread. Uses the MultiLineDialog from David Flanagan "Java in a Netshell"
Nested Class Summary |
Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected static java.awt.Frame |
_DialogFrame
|
protected static Prompter |
_Prompter
|
int |
_Status
|
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 |
Method Summary | |
static Prompter |
create()
|
static Prompter |
create(java.awt.Frame frame,
boolean modal)
create(String Prompt,String default) -> reference to Prompter object This is a Class method that the user of Prompter will invoke to build a Prompter dialog object This method should be invoked only once to build a reuseable Prompter object |
int |
getStatus()
getStatus() -> int _Status This is the method that is called by the program using Prompter when it wants the Users input. |
java.lang.String |
getTextInput()
|
static void |
main(java.lang.String[] args)
|
void |
setMsgPrompt(java.lang.String msg)
Method to setup a Msg Dialog The message can have multiple lines (using "\n") |
void |
setTextInputPrompt(java.lang.String prompt,
java.lang.String deflt,
java.lang.String title)
|
protected java.awt.Panel |
setupButtons()
setup a panel with the OK and Cancel buttons |
void |
setVisible(boolean show)
setVisible() -> show or hide the window This is the method that is called by the program using Prompter when it wants the Prompt dialog to be displayed for the user. |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, 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, 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, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static java.awt.Frame _DialogFrame
protected static Prompter _Prompter
public int _Status
Method Detail |
public static Prompter create(java.awt.Frame frame, boolean modal)
public static Prompter create()
public void setMsgPrompt(java.lang.String msg)
public void setTextInputPrompt(java.lang.String prompt, java.lang.String deflt, java.lang.String title)
protected java.awt.Panel setupButtons()
public java.lang.String getTextInput()
public void setVisible(boolean show)
setVisible
in class java.awt.Component
public int getStatus()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |