wip on grouping by file
This commit is contained in:
@@ -24,6 +24,7 @@ class SearchTabModel {
|
||||
@Observable boolean browseActionEnabled
|
||||
@Observable boolean viewCommentActionEnabled
|
||||
@Observable boolean viewCertificatesActionEnabled
|
||||
@Observable boolean groupedByFile
|
||||
|
||||
Core core
|
||||
UISettings uiSettings
|
||||
|
@@ -47,6 +47,7 @@ class SearchTabView {
|
||||
def resultsTable
|
||||
def lastSortEvent
|
||||
def sequentialDownloadCheckbox
|
||||
def sequentialDownloadCheckbox2
|
||||
|
||||
void initUI() {
|
||||
int rowHeight = application.context.get("row-height")
|
||||
@@ -55,6 +56,10 @@ class SearchTabView {
|
||||
def sendersTable
|
||||
def sequentialDownloadCheckbox
|
||||
def pane = panel {
|
||||
borderLayout()
|
||||
panel (id : "results-panel", constraints : BorderLayout.CENTER) {
|
||||
cardLayout()
|
||||
panel (constraints : "grouped-by-sender"){
|
||||
gridLayout(rows :1, cols : 1)
|
||||
splitPane(orientation: JSplitPane.VERTICAL_SPLIT, continuousLayout : true, dividerLocation: 300 ) {
|
||||
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.putClientProperty("mvc-group", mvcGroup)
|
||||
@@ -223,6 +278,7 @@ class SearchTabView {
|
||||
}
|
||||
})
|
||||
|
||||
showSenderGrouping.call()
|
||||
}
|
||||
|
||||
def closeTab = {
|
||||
@@ -306,4 +362,16 @@ class SearchTabView {
|
||||
row = sendersTable.rowSorter.convertRowIndexToModel(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")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user