public class AlertBoxImpl extends TitledWindow<ChuiOutputManager> implements AlertBox<ChuiOutputManager>
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private AlertBoxCommons<ChuiOutputManager> |
commons
Externalized logic.
|
private static int |
INITIAL_HEIGHT
Initial AlertBox width.
|
private static int |
INITIAL_WIDTH
Initial AlertBox width.
|
private WidgetFactory<ChuiOutputManager> |
widgetFactory
Cached widget factory.
|
private static int |
WIDTH_DELTA
Width delta - honor the border and a space on each side.
|
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
AlertBoxImpl(java.lang.Object[] content,
int buttonSet,
logical var,
java.lang.String title,
Color color,
java.lang.String[] stack)
Creates a modal dialog with a title and with a frame owner.
|
Modifier and Type | Method and Description |
---|---|
Widget<ChuiOutputManager> |
createGap(WidgetRegistry<ChuiOutputManager> registry)
Create effectively invisible widget (the gap) for the stack trace dialog
to avoid explicit coordinates' usage
TODO: at this moment the layout manager doesn't support this approach.
|
TitledWindow |
createStackTraceWindow(java.lang.String title)
Create window for the stack trace
|
void |
doLayout()
Lay out container.
|
void |
draw()
The main AlertBox renderer.
|
boolean |
findButton(KeyInput keyEvent)
Find the button that matches a passed key event.
|
void |
finished(logical rc)
Set the result code, hide the dialog and flag input as complete.
|
logical |
getResult()
Helper method to get the edited result when finished.
|
void |
hide()
Hide this widget and remove it.
|
boolean |
inputDone()
Get status of the input processing.
|
void |
nextFocus()
Move the input focus to the first widget which can receive a focus in
the peer container.
|
void |
prevFocus()
Move the input focus to the last widget which can receive a focus in
the peer container.
|
void |
setVisible(boolean visible)
Hide/show widget.
|
destroy, destroyWidgets, findMouseSource, focusTraversable, getWorkspaceSize, getZOrderClass, hasFocus, hasTitle, hasTitlebar, isDisplayed, isModal, processEvent, processKeyEvent, screenLocation, setTitle, show, title, toString
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, detach, dimension, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, prepareWidgets, remove, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, hidden, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, supportsCustomMousePointer, sync, topLevelWindow, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, add, childrenLocation, clipping, currentFocus, currentFocus, defaultFocus, detach, endSizeChange, firstFocus, focus, get, getClipRect, getIgnoreFocus, getLayout, hasFocusable, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, remove, replace, setFocus, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, widgets
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, config, defaultMousePtr, destroy, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, height, hidden, highlighted, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, topLevelWindow, unrealize, width, window
private static final int WIDTH_DELTA
private static final int INITIAL_WIDTH
private static final int INITIAL_HEIGHT
private AlertBoxCommons<ChuiOutputManager> commons
private WidgetFactory<ChuiOutputManager> widgetFactory
AlertBoxImpl(java.lang.Object[] content, int buttonSet, logical var, java.lang.String title, Color color, java.lang.String[] stack)
skip
elements
which are encoded as a Java Integer
instance where the
integral value is equivalent to the number of lines to skip.
The value of the var
being edited determines the default
button (true
is the first button, false
is the second button and for a 3-button dialog, unknown
is
the third button).
The result of the user's selection can be read via getResult()
.
The mapping of the result value to a button follows the same mapping
as used for setting the default button (see above).
content
- Array of elements which form alert box content.buttonSet
- Button set type to be constructed for this AlertBox.var
- The variable to be edited. The initial value sets the
default button and the resulting value is changed by the
user's press of a button.title
- AlertBox title to be rendered at the top of the one line
border.color
- Color scheme to use.stack
- Progress stack tracepublic void setVisible(boolean visible)
If the alert box is being shown and not yet attached to a window, attached it to the default window.
setVisible
in interface Widget<ChuiOutputManager>
setVisible
in class AbstractWidget<ChuiOutputManager>
visible
- New visible state.public void doLayout()
doLayout
in interface Container<ChuiOutputManager>
doLayout
in class AbstractContainer<ChuiOutputManager>
public void draw()
draw
in interface Widget<ChuiOutputManager>
draw
in class AbstractContainer<ChuiOutputManager>
public void hide()
hide
in interface Widget<ChuiOutputManager>
hide
in class TitledWindow<ChuiOutputManager>
public void nextFocus()
nextFocus
in interface Container<ChuiOutputManager>
nextFocus
in class AbstractContainer<ChuiOutputManager>
public void prevFocus()
prevFocus
in interface Container<ChuiOutputManager>
prevFocus
in class AbstractContainer<ChuiOutputManager>
public boolean findButton(KeyInput keyEvent)
findButton
in interface AlertBox<ChuiOutputManager>
keyEvent
- Event to check.true
if matching button is found and event is
processed.public void finished(logical rc)
finished
in interface AlertBox<ChuiOutputManager>
rc
- The result code for the alert box.public boolean inputDone()
inputDone
in interface AlertBox<ChuiOutputManager>
public logical getResult()
getResult
in interface AlertBox<ChuiOutputManager>
public TitledWindow createStackTraceWindow(java.lang.String title)
createStackTraceWindow
in interface AlertBox<ChuiOutputManager>
title
- window titlepublic Widget<ChuiOutputManager> createGap(WidgetRegistry<ChuiOutputManager> registry)
createGap
in interface AlertBox<ChuiOutputManager>
registry
- widget registry