Package eu.simuline.testhelpers
Class GUIRunner.StackTraceLister
- java.lang.Object
-
- eu.simuline.testhelpers.GUIRunner.StackTraceLister
-
- All Implemented Interfaces:
java.util.EventListener
,javax.swing.event.ListSelectionListener
- Enclosing class:
- GUIRunner
static class GUIRunner.StackTraceLister extends java.lang.Object implements javax.swing.event.ListSelectionListener
Represents the stack trace of the throwable,thrw
currently selected in the error list. The representation consists in the string representationthrwMessager
and in the stack trace given bystacktrace
.This class is also a
ListSelectionListener
which opensemacsclient
with the source file and the line number given by the selected stack trace element.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.ListSelectionModel
stackElemSelection
The selection of this stack trace: This is either empty (which is mandatory for emptythrwMessager
) or selects a single stack element.private javax.swing.DefaultListModel<java.lang.String>
stacktrace
Is either empty or contains the stacktrace of the represented throwablethrw
.private java.lang.Throwable
thrw
Represents a throwable or isnull
if no throwable is represented.private javax.swing.JLabel
thrwMessager
-
Constructor Summary
Constructors Constructor Description StackTraceLister()
Creates a new StackTraceLister with empty throwable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
clearStack()
Clears the represented stack includingthrw
and text.(package private) java.awt.Component
getStackTraceBox()
Returns a graphical representation of this StackTraceLister.(package private) void
setStack(java.lang.Throwable thrw)
Represents the throwablethrw
if this is notnull
; otherwise just clears this stack trace lister as is done byclearStack()
.void
valueChanged(javax.swing.event.ListSelectionEvent lse)
If an entry is selected, move with emacs to the according place.
-
-
-
Field Detail
-
thrw
private java.lang.Throwable thrw
Represents a throwable or isnull
if no throwable is represented. This is also the initial value.
-
thrwMessager
private final javax.swing.JLabel thrwMessager
-
stacktrace
private final javax.swing.DefaultListModel<java.lang.String> stacktrace
Is either empty or contains the stacktrace of the represented throwablethrw
.
-
stackElemSelection
private final javax.swing.ListSelectionModel stackElemSelection
The selection of this stack trace: This is either empty (which is mandatory for emptythrwMessager
) or selects a single stack element. If so, by selectionemacsclient
is started at the place the stack element points to.
-
-
Method Detail
-
getStackTraceBox
java.awt.Component getStackTraceBox()
Returns a graphical representation of this StackTraceLister.
-
clearStack
void clearStack()
Clears the represented stack includingthrw
and text.
-
setStack
void setStack(java.lang.Throwable thrw)
Represents the throwablethrw
if this is notnull
; otherwise just clears this stack trace lister as is done byclearStack()
. The selection is cleared anyway.
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent lse)
If an entry is selected, move with emacs to the according place.- Specified by:
valueChanged
in interfacejavax.swing.event.ListSelectionListener
-
-