public class AlertBoxCommons<O extends OutputManager<?>> extends java.lang.Object implements ActionListener
AlertBox
.Modifier and Type | Field and Description |
---|---|
private AlertBox<O> |
alertBox
The related alert box reference.
|
Color |
alertColor
Default color scheme.
|
private Container<O> |
buttonsContainer
The buttons container.
|
int |
buttonSet
The button configuration.
|
java.lang.Object[] |
content
Alert box items.
|
boolean |
forceTitleLeftAlign
Flag indicating the title must be forced to left-align.
|
private boolean |
inputDone
Flag which tracks user input.
|
logical |
result
The variable which is being edited.
|
private java.lang.String |
stack
The Progress stack trace
|
WidgetFactory<O> |
widgetFactory
Cached widget factory reference.
|
Constructor and Description |
---|
AlertBoxCommons(AlertBox<O> alertBox,
Container<O> buttonsContainer,
WidgetFactory<O> widgetFactory,
java.lang.Object[] content,
int buttonSet,
logical var,
Color color,
java.lang.String[] stack)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildMessageText()
Builds a multiline string from the alert box content array.
|
private Button<O> |
createButton(java.lang.String text)
Creates and initializes a button widget to be used in the alert box.
|
private Button<O> |
createButton(java.lang.String text,
Container<O> container,
boolean enable)
Creates and initializes a button widget to be used in the alert box.
|
java.util.List<Button<O>> |
createButtonSet()
Constructs the alert box button set.
|
private Widget<O> |
createSkip(WidgetRegistry<O> registry,
int lines)
Create SKIP(n) widget
|
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.
|
int |
getDefaultButton()
Returns the index of the default button.
|
logical |
getResult()
Helper method to get the edited result when finished.
|
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 |
onAction(ActionEvent action)
Action handler to process the AlertBox buttons event.
|
void |
prevFocus()
Move the input focus to the last widget which can receive a focus in
the peer container.
|
private void |
showStackTrace()
Display dialog with the Progress stack trace
|
public java.lang.Object[] content
public Color alertColor
public logical result
public int buttonSet
public boolean forceTitleLeftAlign
public WidgetFactory<O extends OutputManager<?>> widgetFactory
private boolean inputDone
private AlertBox<O extends OutputManager<?>> alertBox
private Container<O extends OutputManager<?>> buttonsContainer
private final java.lang.String stack
public AlertBoxCommons(AlertBox<O> alertBox, Container<O> buttonsContainer, WidgetFactory<O> widgetFactory, java.lang.Object[] content, int buttonSet, logical var, Color color, java.lang.String[] stack)
alertBox
- The owner instance.buttonsContainer
- The buttons container.widgetFactory
- Reference to widget factory.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.color
- Color scheme to use.stack
- Progress stack tracepublic void onAction(ActionEvent action)
onAction
in interface ActionListener
action
- The action event to handle is coming from defined buttons.public void finished(logical rc)
rc
- The result code for the alert box.public logical getResult()
public boolean inputDone()
public java.util.List<Button<O>> createButtonSet()
logical
variable being edited determines the default
button (true
== the first button, false
== the second button and for a 3-button dialog, unknown
==
the third button).public int getDefaultButton()
createButtonSet()
.public void nextFocus()
public void prevFocus()
public boolean findButton(KeyInput keyEvent)
keyEvent
- Event to check.true
if matching button is found and event is
processed.public java.lang.String buildMessageText()
private void showStackTrace()
private Widget<O> createSkip(WidgetRegistry<O> registry, int lines)
registry
- widget registrylines
- lines to skipprivate Button<O> createButton(java.lang.String text)
Button
instance.