pack the group-by-file senders table

java-i2p-warning
Zlatin Balevsky 2022-08-30 07:46:48 +01:00
parent bda8c4dca3
commit 7bf7151f65
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 10 additions and 6 deletions

View File

@ -1,8 +1,10 @@
package com.muwire.gui.resultdetails
import com.google.common.collect.Sets
import com.muwire.core.search.UIResultEvent
import com.muwire.core.trust.TrustLevel
import com.muwire.gui.HTMLSanitizer
import com.muwire.gui.TableUtil
import com.muwire.gui.TrustCellRenderer
import com.muwire.gui.profile.PersonaOrProfile
import com.muwire.gui.profile.PersonaOrProfileCellRenderer
@ -72,20 +74,20 @@ class ResultDetailsTabsView {
scrollPane(constraints: BorderLayout.CENTER) {
sendersTable = table(autoCreateRowSorter : true, rowHeight : rowHeight) {
tableModel(list: model.results) {
closureColumn(header: trans("SENDER"), preferredWidth: 150, type: PersonaOrProfile, read : {it})
closureColumn(header: trans("TRUST_STATUS"), preferredWidth: 10, type: TrustLevel, read : { ResultPOP row ->
closureColumn(header: trans("SENDER"), type: PersonaOrProfile, read : {it})
closureColumn(header: trans("TRUST_STATUS"), type: TrustLevel, read : { ResultPOP row ->
model.core.trustService.getLevel(row.getPersona().destination)
})
closureColumn(header: trans("NAME"), preferredWidth: 700, type: String, read : { ResultPOP row ->
HTMLSanitizer.sanitize(row.getEvent().getFullPath())
})
closureColumn(header: trans("COMMENTS"), preferredWidth: 20, type: Boolean, read : { ResultPOP row ->
closureColumn(header: trans("COMMENTS"), type: Boolean, read : { ResultPOP row ->
row.getEvent().comment != null
})
closureColumn(header: trans("CERTIFICATES"), preferredWidth: 20, type: Integer, read : { ResultPOP row ->
closureColumn(header: trans("CERTIFICATES"), type: Integer, read : { ResultPOP row ->
row.getEvent().certificates
})
closureColumn(header: trans("COLLECTIONS"), preferredWidth: 20, type: Integer, read: { ResultPOP row ->
closureColumn(header: trans("COLLECTIONS"), type: Integer, read: { ResultPOP row ->
row.getEvent().collections.size()
})
}
@ -99,6 +101,8 @@ class ResultDetailsTabsView {
}
}
TableUtil.packColumns(sendersTable, Sets.newHashSet(0,2))
commentsPanel = builder.panel {
cardLayout()
panel(constraints: "no-comments") {