wip on grouping by file

This commit is contained in:
Zlatin Balevsky
2019-11-08 16:09:05 +00:00
parent 72960c24a8
commit cc9b384907
2 changed files with 115 additions and 46 deletions

View File

@@ -24,6 +24,7 @@ class SearchTabModel {
@Observable boolean browseActionEnabled @Observable boolean browseActionEnabled
@Observable boolean viewCommentActionEnabled @Observable boolean viewCommentActionEnabled
@Observable boolean viewCertificatesActionEnabled @Observable boolean viewCertificatesActionEnabled
@Observable boolean groupedByFile
Core core Core core
UISettings uiSettings UISettings uiSettings

View File

@@ -47,6 +47,7 @@ class SearchTabView {
def resultsTable def resultsTable
def lastSortEvent def lastSortEvent
def sequentialDownloadCheckbox def sequentialDownloadCheckbox
def sequentialDownloadCheckbox2
void initUI() { void initUI() {
int rowHeight = application.context.get("row-height") int rowHeight = application.context.get("row-height")
@@ -55,6 +56,10 @@ class SearchTabView {
def sendersTable def sendersTable
def sequentialDownloadCheckbox def sequentialDownloadCheckbox
def pane = panel { def pane = panel {
borderLayout()
panel (id : "results-panel", constraints : BorderLayout.CENTER) {
cardLayout()
panel (constraints : "grouped-by-sender"){
gridLayout(rows :1, cols : 1) gridLayout(rows :1, cols : 1)
splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) { splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) {
panel { panel {
@@ -110,6 +115,56 @@ class SearchTabView {
} }
} }
} }
panel (constraints : "grouped-by-file") {
gridLayout(rows : 1, cols : 1)
splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) {
panel {
borderLayout()
scrollPane(constraints : BorderLayout.CENTER) {
}
panel (constraints : BorderLayout.SOUTH) {
gridLayout(rows :1, cols : 3)
panel {}
panel {
button(text : "Download", enabled : bind {model.downloadActionEnabled}, downloadAction)
}
panel {
gridBagLayout()
label(text : "Download sequentially", constraints : gbc(gridx : 0, gridy : 0, weightx : 100, anchor : GridBagConstraints.LINE_END))
sequentialDownloadCheckbox2 = checkBox( constraints : gbc(gridx: 1, gridy:0, weightx: 0, anchor : GridBagConstraints.LINE_END))
}
}
}
panel {
borderLayout()
scrollPane(constraints : BorderLayout.CENTER) {
}
panel (constraints : BorderLayout.SOUTH) {
gridLayout(rows : 1, cols : 2)
panel (border : etchedBorder()) {
button(text : "Browse Host", enabled : bind {model.browseActionEnabled}, browseAction)
button(text : "View Comment", enabled : bind {model.viewCommentActionEnabled}, showCommentAction)
button(text : "View Certificates", enabled : bind {model.viewCertificatesActionEnabled}, viewCertificatesAction)
}
panel (border : etchedBorder()) {
button(text : "Trust", enabled: bind {model.trustButtonsEnabled }, trustAction)
button(text : "Neutral", enabled: bind {model.trustButtonsEnabled}, neutralAction)
button(text : "Distrust", enabled : bind {model.trustButtonsEnabled}, distrustAction)
}
}
}
}
}
}
panel (constraints : BorderLayout.SOUTH) {
label(text : "Group by")
buttonGroup(id : "groupBy")
radioButton(text : "Sender", selected : true, buttonGroup : groupBy, actionPerformed: showSenderGrouping)
radioButton(text : "File", selected : false, buttonGroup : groupBy, actionPerformed: showFileGrouping)
}
}
this.pane = pane this.pane = pane
this.pane.putClientProperty("mvc-group", mvcGroup) this.pane.putClientProperty("mvc-group", mvcGroup)
@@ -223,6 +278,7 @@ class SearchTabView {
} }
}) })
showSenderGrouping.call()
} }
def closeTab = { def closeTab = {
@@ -306,4 +362,16 @@ class SearchTabView {
row = sendersTable.rowSorter.convertRowIndexToModel(row) row = sendersTable.rowSorter.convertRowIndexToModel(row)
row row
} }
def showSenderGrouping = {
model.groupedByFile = false
def cardsPanel = builder.getVariable("results-panel")
cardsPanel.getLayout().show(cardsPanel, "grouped-by-sender")
}
def showFileGrouping = {
model.groupedByFile = true
def cardsPanel = builder.getVariable("results-panel")
cardsPanel.getLayout().show(cardsPanel, "grouped-by-file")
}
} }