@@ -45,6 +45,7 @@ import javax.swing.JSplitPane
45
45
import javax.swing.JTabbedPane
46
46
import javax.swing.JTable
47
47
import javax.swing.RepaintManager
48
+ import javax.swing.RowFilter
48
49
import javax.swing.SwingConstants
49
50
import javax.swing.Timer
50
51
import javax.swing.UIManager
@@ -55,6 +56,7 @@ import javax.swing.event.ListSelectionEvent
55
56
import javax.swing.event.ListSelectionListener
56
57
import javax.swing.plaf.basic.BasicProgressBarUI
57
58
import javax.swing.table.DefaultTableCellRenderer
59
+ import javax.swing.table.TableRowSorter
58
60
import oracle.dbtools.raptor.controls.grid.DefaultDrillLink
59
61
import oracle.dbtools.raptor.utils.Connections
60
62
import oracle.ide.config.Preferences
@@ -105,6 +107,8 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
105
107
JCheckBoxMenuItem showTestDescriptionCheckBoxMenuItem
106
108
JCheckBoxMenuItem showWarningIndicatorCheckBoxMenuItem
107
109
JCheckBoxMenuItem showInfoIndicatorCheckBoxMenuItem
110
+ JCheckBoxMenuItem showSuccessfulTestsCheckBoxMenuItem
111
+ JCheckBoxMenuItem showDisabledTestsCheckBoxMenuItem
108
112
JCheckBoxMenuItem syncDetailTabCheckBoxMenuItem
109
113
RunnerTextField testOwnerTextField
110
114
RunnerTextField testPackageTextField
@@ -220,6 +224,30 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
220
224
col. preferredWidth = 0
221
225
}
222
226
}
227
+
228
+ private def applyFilter (boolean showSuccessfulTests , boolean showDisabledTests ) {
229
+ val sorter = testOverviewTable. rowSorter as TableRowSorter<TestOverviewTableModel >
230
+ val filter = new RowFilter<TestOverviewTableModel , Integer > () {
231
+ override include(Entry<? extends TestOverviewTableModel , ? extends Integer > entry) {
232
+ val test = entry. model. getTest(entry. identifier)
233
+ val counter = test. counter
234
+ if (counter !== null ) {
235
+ if (counter. success > 0 ) {
236
+ if (! showSuccessfulTests) {
237
+ return false
238
+ }
239
+ }
240
+ if (counter. disabled > 0 ) {
241
+ if (! showDisabledTests) {
242
+ return false
243
+ }
244
+ }
245
+ }
246
+ return true
247
+ }
248
+ }
249
+ sorter. rowFilter = filter
250
+ }
223
251
224
252
private def openSelectedTest () {
225
253
val rowIndex = testOverviewTable. selectedRow
@@ -338,6 +366,9 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
338
366
fixCheckBoxMenuItem(showWarningIndicatorCheckBoxMenuItem)
339
367
showInfoIndicatorCheckBoxMenuItem. selected = preferences. showInfoIndicator
340
368
applyShowInfoIndicator(showInfoIndicatorCheckBoxMenuItem. selected)
369
+ showSuccessfulTestsCheckBoxMenuItem. selected = preferences. showSuccessfulTests
370
+ showDisabledTestsCheckBoxMenuItem. selected = preferences. showDisabledTests
371
+ applyFilter(showSuccessfulTestsCheckBoxMenuItem. selected, showDisabledTestsCheckBoxMenuItem. selected)
341
372
fixCheckBoxMenuItem(showInfoIndicatorCheckBoxMenuItem)
342
373
syncDetailTabCheckBoxMenuItem. selected = preferences. syncDetailTab
343
374
fixCheckBoxMenuItem(syncDetailTabCheckBoxMenuItem)
@@ -380,10 +411,13 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
380
411
testOverviewTableModel. fireTableDataChanged
381
412
} else {
382
413
if (testOverviewTableModel. rowCount > row) {
383
- val positionOfCurrentTest = testOverviewTable. getCellRect(row, 0 , true );
414
+ val positionOfCurrentTest = testOverviewTable. getCellRect(testOverviewTable . convertRowIndexToView( row) , 0 , true );
384
415
testOverviewTable. scrollRectToVisible = positionOfCurrentTest
385
416
testOverviewTableModel. fireTableRowsUpdated(row, row)
386
417
Thread . sleep(5 ) // reduce flickering
418
+ if (! showSuccessfulTestsCheckBoxMenuItem. selected || ! showDisabledTestsCheckBoxMenuItem. selected) {
419
+ applyFilter(showSuccessfulTestsCheckBoxMenuItem. selected, showDisabledTestsCheckBoxMenuItem. selected)
420
+ }
387
421
testOverviewTable. scrollRectToVisible = positionOfCurrentTest
388
422
}
389
423
}
@@ -485,6 +519,12 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
485
519
} else if (e. source == showInfoCounterCheckBoxMenuItem) {
486
520
applyShowInfoCounter(showInfoCounterCheckBoxMenuItem. selected)
487
521
fixCheckBoxMenuItem(showInfoCounterCheckBoxMenuItem)
522
+ } else if (e. source == showSuccessfulTestsCheckBoxMenuItem) {
523
+ applyFilter(showSuccessfulTestsCheckBoxMenuItem. selected, showDisabledTestsCheckBoxMenuItem. selected)
524
+ fixCheckBoxMenuItem(showSuccessfulTestsCheckBoxMenuItem)
525
+ } else if (e. source == showDisabledTestsCheckBoxMenuItem) {
526
+ applyFilter(showSuccessfulTestsCheckBoxMenuItem. selected, showDisabledTestsCheckBoxMenuItem. selected)
527
+ fixCheckBoxMenuItem(showDisabledTestsCheckBoxMenuItem)
488
528
} else if (e. source == showTestDescriptionCheckBoxMenuItem) {
489
529
applyShowTestDescription(showTestDescriptionCheckBoxMenuItem. selected)
490
530
fixCheckBoxMenuItem(showTestDescriptionCheckBoxMenuItem)
@@ -943,6 +983,13 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
943
983
testOverviewRunWorksheetMenuItem. addActionListener(this )
944
984
testOverviewPopupMenu. add(testOverviewRunWorksheetMenuItem)
945
985
testOverviewPopupMenu. add(new JSeparator )
986
+ showSuccessfulTestsCheckBoxMenuItem = new JCheckBoxMenuItem (UtplsqlResources . getString(" PREF_SHOW_SUCCESSFUL_TESTS_LABEL" ). replace(" ?" ," " ), true )
987
+ showSuccessfulTestsCheckBoxMenuItem. addActionListener(this )
988
+ testOverviewPopupMenu. add(showSuccessfulTestsCheckBoxMenuItem)
989
+ showDisabledTestsCheckBoxMenuItem = new JCheckBoxMenuItem (UtplsqlResources . getString(" PREF_SHOW_DISABLED_TESTS_LABEL" ). replace(" ?" ," " ), true )
990
+ showDisabledTestsCheckBoxMenuItem. addActionListener(this )
991
+ testOverviewPopupMenu. add(showDisabledTestsCheckBoxMenuItem)
992
+ testOverviewPopupMenu. add(new JSeparator )
946
993
showTestDescriptionCheckBoxMenuItem = new JCheckBoxMenuItem (UtplsqlResources . getString(" PREF_SHOW_TEST_DESCRIPTION_LABEL" ). replace(" ?" ," " ), true )
947
994
showTestDescriptionCheckBoxMenuItem. addActionListener(this )
948
995
testOverviewPopupMenu. add(showTestDescriptionCheckBoxMenuItem)
@@ -956,6 +1003,7 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
956
1003
syncDetailTabCheckBoxMenuItem. addActionListener(this )
957
1004
testOverviewPopupMenu. add(syncDetailTabCheckBoxMenuItem)
958
1005
testOverviewTable. componentPopupMenu = testOverviewPopupMenu
1006
+ testOverviewTable. tableHeader. componentPopupMenu = testOverviewPopupMenu
959
1007
960
1008
// Test tabbed pane (Test Properties)
961
1009
val testInfoPanel = new ScrollablePanel
0 commit comments