public class AlertBoxImpl extends TitledWindow<ChuiOutputManager> implements AlertBox<ChuiOutputManager>
| 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.
|
listeners, 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 |
dismiss()
Let the modal UI element now that it should finish its modal input processing.
|
void |
doLayout()
Lay out container.
|
void |
draw()
The main AlertBox renderer.
|
boolean |
findButton(KeyInput keyEvent)
Find the button that matches a passed key event.
|
logical |
getResult()
Helper method to get the edited result when finished.
|
java.util.List<Widget<ChuiOutputManager>> |
getTabItemList()
Returns the tab item list for this container that is the same as its widgets list.
|
void |
hide()
Hide this widget and remove it.
|
boolean |
isDismissed()
Returns
true when the modal UI element has dismissed (finished its modal input). |
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 |
setClipboardSelection()
Chui does not support selection.
|
void |
setResult(logical value)
Sets the alert-box result value.
|
void |
setVisible(boolean visible)
Hide/show widget.
|
destroy, destroyWidgets, findMouseSource, focusTraversable, getWorkspaceSize, getZOrderClass, hasFocus, hasTitle, hasTitlebar, isDisplayed, isModal, processEvent, processKeyEvent, screenLocation, setTitle, show, title, toStringadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hasFocus, hasTooltip, hidden, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, add, add, addContainerStateListener, childrenLocation, clipping, currentFocus, currentFocus, defaultFocus, detach, endSizeChange, firstFocus, focus, get, getClipRect, getIgnoreFocus, getLayout, hasFocusable, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, parentOf, remove, removeContainerStateListener, replace, setFocus, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, widgets, widgetsAsList, widgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, config, defaultMousePtr, destroy, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, height, hidden, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, width, windowprivate 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 setResult(logical value)
setResult in interface AlertBox<ChuiOutputManager>value - The result logical value.public void dismiss()
public boolean isDismissed()
true when the modal UI element has dismissed (finished its modal input).isDismissed in interface IsModalpublic logical getResult()
getResult in interface AlertBox<ChuiOutputManager>public java.util.List<Widget<ChuiOutputManager>> getTabItemList()
getTabItemList in interface Container<ChuiOutputManager>getTabItemList in class AbstractContainer<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 registrypublic void setClipboardSelection()
setClipboardSelection in interface AlertBox<ChuiOutputManager>