@@ -18,12 +18,14 @@ package org.utplsql.sqldev.ui.runner
18
18
import java.awt.Color
19
19
import java.awt.Component
20
20
import java.awt.Dimension
21
+ import java.awt.FlowLayout
21
22
import java.awt.GridBagConstraints
22
23
import java.awt.GridBagLayout
23
24
import java.awt.Insets
24
25
import java.awt.event.FocusEvent
25
26
import java.awt.event.FocusListener
26
27
import java.text.DecimalFormat
28
+ import javax.swing.JComponent
27
29
import javax.swing.JLabel
28
30
import javax.swing.JPanel
29
31
import javax.swing.JProgressBar
@@ -51,6 +53,7 @@ class RunnerPanel implements FocusListener {
51
53
JLabel testCounterValueLabel
52
54
JLabel errorCounterValueLabel
53
55
JLabel failureCounterValueLabel
56
+ JLabel disabledCounterValueLabel
54
57
JProgressBar progressBar;
55
58
TestOverviewTableModel testOverviewTableModel
56
59
JTable testOverviewTable
@@ -114,6 +117,7 @@ class RunnerPanel implements FocusListener {
114
117
testCounterValueLabel. text = ' ' ' «run.totalNumberOfCompletedTests»/«run.totalNumberOfTests»' ' '
115
118
errorCounterValueLabel. text = ' ' ' «run.counter.error»' ' '
116
119
failureCounterValueLabel. text = ' ' ' «run.counter.failure»' ' '
120
+ disabledCounterValueLabel. text = ' ' ' «run.counter.disabled»' ' '
117
121
if (run. totalNumberOfTests == 0 ) {
118
122
progressBar. value = 100
119
123
} else {
@@ -227,7 +231,36 @@ class RunnerPanel implements FocusListener {
227
231
label. horizontalAlignment = if (col == = 2 ) {JLabel . RIGHT } else {JLabel . LEFT }
228
232
return label
229
233
}
230
- }
234
+ }
235
+
236
+ private def makeLabelledComponent (JLabel label , JComponent comp ) {
237
+ val groupPanel = new JPanel
238
+ groupPanel. layout = new GridBagLayout
239
+ var GridBagConstraints c = new GridBagConstraints
240
+ // label
241
+ c. gridx = 0
242
+ c. gridy = 0
243
+ c. gridwidth = 1
244
+ c. gridheight = 1
245
+ c. insets = new Insets (5 , 10 , 5 , 0 ) // top, left, bottom, right
246
+ c. anchor = GridBagConstraints :: WEST
247
+ c. fill = GridBagConstraints :: NONE
248
+ c. weightx = 0
249
+ c. weighty = 0
250
+ groupPanel. add(label, c)
251
+ // component
252
+ c. gridx = 1
253
+ c. gridy = 0
254
+ c. gridwidth = 1
255
+ c. gridheight = 1
256
+ c. insets = new Insets (5 , 5 , 5 , 10 ) // top, left, bottom, right
257
+ c. anchor = GridBagConstraints :: WEST
258
+ c. fill = GridBagConstraints :: NONE
259
+ c. weightx = 0
260
+ c. weighty = 0
261
+ groupPanel. add(comp, c)
262
+ return groupPanel
263
+ }
231
264
232
265
private def initializeGUI () {
233
266
// Base panel containing all components
@@ -239,7 +272,7 @@ class RunnerPanel implements FocusListener {
239
272
statusLabel = new JLabel
240
273
c. gridx = 0
241
274
c. gridy = 0
242
- c. gridwidth = 6
275
+ c. gridwidth = 1
243
276
c. gridheight = 1
244
277
c. insets = new Insets (10 , 10 , 10 , 10 ) // top, left, bottom, right
245
278
c. anchor = GridBagConstraints :: WEST
@@ -248,80 +281,40 @@ class RunnerPanel implements FocusListener {
248
281
c. weighty = 0
249
282
basePanel. add(statusLabel, c)
250
283
251
- // Test counter
284
+ // Counters
285
+ // - Test counter
286
+ val counterPanel = new JPanel
287
+ counterPanel. layout = new WrapLayout (FlowLayout . LEFT , 0 , 0 )
252
288
val testCounterLabel = new JLabel (UtplsqlResources . getString(" RUNNER_TESTS_LABEL" ) + " :" ,
253
289
UtplsqlResources . getIcon(" UTPLSQL_ICON" ), JLabel :: LEADING )
254
- c. gridx = 0
255
- c. gridy = 1
256
- c. gridwidth = 1
257
- c. gridheight = 1
258
- c. insets = new Insets (10 , 10 , 10 , 5 ) // top, left, bottom, right
259
- c. anchor = GridBagConstraints :: WEST
260
- c. fill = GridBagConstraints :: NONE
261
- c. weightx = 0
262
- c. weighty = 0
263
- basePanel. add(testCounterLabel, c)
264
290
testCounterValueLabel = new JLabel
265
- c. gridx = 1
266
- c. gridy = 1
267
- c. gridwidth = 1
268
- c. gridheight = 1
269
- c. insets = new Insets (10 , 0 , 10 , 10 ) // top, left, bottom, right
270
- c. anchor = GridBagConstraints :: WEST
271
- c. fill = GridBagConstraints :: NONE
272
- c. weightx = 0
273
- c. weighty = 0
274
- basePanel. add(testCounterValueLabel, c)
275
-
276
- // Failure counter
291
+ counterPanel. add(makeLabelledComponent(testCounterLabel, testCounterValueLabel))
292
+ // - Failure counter
277
293
val failureCounterLabel = new JLabel (UtplsqlResources . getString(" RUNNER_FAILURES_LABEL" ) + " :" ,
278
294
UtplsqlResources . getIcon(" FAILURE_ICON" ), JLabel :: LEADING )
279
- c. gridx = 2
280
- c. gridy = 1
281
- c. gridwidth = 1
282
- c. gridheight = 1
283
- c. insets = new Insets (10 , 10 , 10 , 5 ) // top, left, bottom, right
284
- c. anchor = GridBagConstraints :: WEST
285
- c. fill = GridBagConstraints :: NONE
286
- c. weightx = 0
287
- c. weighty = 0
288
- basePanel. add(failureCounterLabel, c)
289
295
failureCounterValueLabel = new JLabel
290
- c. gridx = 3
291
- c. gridy = 1
292
- c. gridwidth = 1
293
- c. gridheight = 1
294
- c. insets = new Insets (10 , 0 , 10 , 10 ) // top, left, bottom, right
295
- c. anchor = GridBagConstraints :: WEST
296
- c. fill = GridBagConstraints :: NONE
297
- c. weightx = 0
298
- c. weighty = 0
299
- basePanel. add(failureCounterValueLabel, c)
300
-
301
- // Error counter
296
+ counterPanel. add(makeLabelledComponent(failureCounterLabel,failureCounterValueLabel))
297
+ // - Error counter
302
298
val errorCounterLabel = new JLabel (UtplsqlResources . getString(" RUNNER_ERRORS_LABEL" ) + " :" ,
303
299
UtplsqlResources . getIcon(" ERROR_ICON" ), JLabel :: LEADING )
304
- c. gridx = 4
305
- c. gridy = 1
306
- c. gridwidth = 1
307
- c. gridheight = 1
308
- c. insets = new Insets (10 , 10 , 10 , 5 ) // top, left, bottom, right
309
- c. anchor = GridBagConstraints :: WEST
310
- c. fill = GridBagConstraints :: NONE
311
- c. weightx = 0
312
- c. weighty = 0
313
- basePanel. add(errorCounterLabel, c)
314
300
errorCounterValueLabel = new JLabel
315
- c. gridx = 5
301
+ counterPanel. add(makeLabelledComponent(errorCounterLabel, errorCounterValueLabel))
302
+ // - Disabled counter
303
+ val disabledCounterLabel = new JLabel (UtplsqlResources . getString(" RUNNER_DISABLED_LABEL" ) + " :" ,
304
+ UtplsqlResources . getIcon(" DISABLED_ICON" ), JLabel :: LEADING )
305
+ disabledCounterValueLabel = new JLabel
306
+ counterPanel. add(makeLabelledComponent(disabledCounterLabel, disabledCounterValueLabel))
307
+ // - add everything to basePanel
308
+ c. gridx = 0
316
309
c. gridy = 1
317
310
c. gridwidth = 1
318
311
c. gridheight = 1
319
- c. insets = new Insets (10 , 0 , 10 , 10 ) // top, left, bottom, right
312
+ c. insets = new Insets (5 , 0 , 5 , 0 ) // top, left, bottom, right
320
313
c. anchor = GridBagConstraints :: WEST
321
- c. fill = GridBagConstraints :: NONE
322
- c. weightx = 0
314
+ c. fill = GridBagConstraints :: HORIZONTAL
315
+ c. weightx = 1
323
316
c. weighty = 0
324
- basePanel. add(errorCounterValueLabel, c)
317
+ basePanel. add(counterPanel,c)
325
318
326
319
// Progress bar
327
320
progressBar = new JProgressBar
@@ -333,7 +326,7 @@ class RunnerPanel implements FocusListener {
333
326
progressBar. UI = new BasicProgressBarUI
334
327
c. gridx = 0
335
328
c. gridy = 2
336
- c. gridwidth = 6
329
+ c. gridwidth = 1
337
330
c. gridheight = 1
338
331
c. insets = new Insets (10 , 10 , 10 , 10 ) // top, left, bottom, right
339
332
c. anchor = GridBagConstraints :: WEST
@@ -701,7 +694,7 @@ class RunnerPanel implements FocusListener {
701
694
horizontalSplitPane. resizeWeight = 0.5
702
695
c. gridx = 0
703
696
c. gridy = 3
704
- c. gridwidth = 6
697
+ c. gridwidth = 1
705
698
c. gridheight = 1
706
699
c. insets = new Insets (10 , 10 , 10 , 10 ) // top, left, bottom, right
707
700
c. anchor = GridBagConstraints :: WEST
0 commit comments