Skip to content

Commit 7a0b4e9

Browse files
calculate common prefix also for initially empty model
1 parent 3b52818 commit 7a0b4e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,29 @@ import org.utplsql.sqldev.resources.UtplsqlResources
2525
class TestOverviewTableModel extends DefaultTableModel {
2626
LinkedHashMap<String, Test> tests
2727
String commonPrefix
28+
boolean commonPrefixCalculated
2829

2930
new() {
3031
super()
3132
}
3233

34+
private def calcCommonPrefix() {
35+
if (!commonPrefixCalculated && tests.size > 0) {
36+
this.commonPrefix = PrefixTools.commonPrefix(tests.keySet.toList)
37+
fireTableDataChanged()
38+
commonPrefixCalculated = true
39+
}
40+
}
41+
3342
def setModel(LinkedHashMap<String, Test> tests) {
43+
commonPrefixCalculated = false
3444
this.tests = tests
35-
this.commonPrefix = PrefixTools.commonPrefix(tests.keySet.toList)
45+
calcCommonPrefix
3646
fireTableDataChanged()
3747
}
3848

3949
def getTestIdColumnName() {
50+
calcCommonPrefix
4051
if (commonPrefix === null || commonPrefix == "") {
4152
return UtplsqlResources.getString("RUNNER_TEST_ID")
4253
} else {

0 commit comments

Comments
 (0)