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.
|
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 |
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, toString
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, normalizeZOrder, onWidgetAdded, onWidgetRemoved, prepareWidgets, reflectAncestorChange, reflectLocationChange, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setTabItemList, setWidth, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hidden, highlighted, ignoreAction, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, 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, remove, removeContainerStateListener, replace, setFocus, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, widgets, widgetsAsList
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, isCurrent, isDirectManipulable, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, 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 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 IsModal
public 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 registry