Skip to content

Commit 837634d

Browse files
sync test detail tabs with most sensible content
1 parent b0934a8 commit 837634d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.xtend

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class RunnerPanel implements FocusListener {
7272
JTextArea testErrorStackTextArea
7373
JTextArea testWarningsTextArea
7474
JTextArea testServerOutputTextArea
75+
JTabbedPane testDetailTabbedPane
7576

7677
def Component getGUI() {
7778
if (basePanel === null) {
@@ -216,6 +217,19 @@ class RunnerPanel implements FocusListener {
216217
p.testErrorStackTextArea.text = test.errorStack
217218
p.testWarningsTextArea.text = test.warnings
218219
p.testServerOutputTextArea.text = test.serverOutput
220+
var int tabIndex
221+
if (test.counter.failure > 0) {
222+
tabIndex = 1
223+
} else if (test.counter.error > 0) {
224+
tabIndex = 2
225+
} else if (test.counter.warning > 0) {
226+
tabIndex = 3
227+
} else if (test.serverOutput !== null && test.serverOutput.length > 0) {
228+
tabIndex = 4
229+
} else {
230+
tabIndex = 0
231+
}
232+
p.testDetailTabbedPane.selectedIndex = tabIndex
219233
}
220234
}
221235
}
@@ -752,7 +766,7 @@ class RunnerPanel implements FocusListener {
752766
testServerOutputPanel.add(testServerOutputScrollPane, c)
753767

754768
// split pane with all tabs
755-
val testDetailTabbedPane = new JTabbedPane()
769+
testDetailTabbedPane = new JTabbedPane()
756770
testDetailTabbedPane.add("Test", testPropertiesScrollPane)
757771
testDetailTabbedPane.add("Failures", testFailuresPanel)
758772
testDetailTabbedPane.add("Errors", testErrorStackPanel)

0 commit comments

Comments
 (0)