update list view tables
This commit is contained in:
@ -27,6 +27,7 @@ class TrustListController {
|
||||
return
|
||||
Persona p = model.trusted[selectedRow]
|
||||
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.TRUSTED))
|
||||
view.fireUpdate("trusted-table")
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
@ -36,6 +37,7 @@ class TrustListController {
|
||||
return
|
||||
Persona p = model.distrusted[selectedRow]
|
||||
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.TRUSTED))
|
||||
view.fireUpdate("distrusted-table")
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
@ -45,6 +47,7 @@ class TrustListController {
|
||||
return
|
||||
Persona p = model.trusted[selectedRow]
|
||||
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED))
|
||||
view.fireUpdate("trusted-table")
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
@ -54,5 +57,6 @@ class TrustListController {
|
||||
return
|
||||
Persona p = model.distrusted[selectedRow]
|
||||
eventBus.publish(new TrustEvent(persona : p, level : TrustLevel.DISTRUSTED))
|
||||
view.fireUpdate("distrusted-table")
|
||||
}
|
||||
}
|
@ -83,10 +83,12 @@ class TrustListView {
|
||||
|
||||
def trustedTable = builder.getVariable("trusted-table")
|
||||
trustedTable.rowSorter.addRowSorterListener({evt -> sortEvents["trusted-table"] = evt})
|
||||
trustedTable.rowSorter.setSortsOnUpdates(true)
|
||||
trustedTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
|
||||
|
||||
def distrustedTable = builder.getVariable("distrusted-table")
|
||||
distrustedTable.rowSorter.addRowSorterListener({evt -> sortEvents["distrusted-table"] = evt})
|
||||
distrustedTable.rowSorter.setSortsOnUpdates(true)
|
||||
distrustedTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
|
||||
|
||||
dialog.getContentPane().add(mainPanel)
|
||||
@ -110,4 +112,9 @@ class TrustListView {
|
||||
selectedRow = table.rowSorter.convertRowIndexToModel(selectedRow)
|
||||
selectedRow
|
||||
}
|
||||
|
||||
void fireUpdate(String tableName) {
|
||||
def table = builder.getVariable(tableName)
|
||||
table.model.fireTableDataChanged()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user