trust panel ui
This commit is contained in:
@@ -101,6 +101,33 @@ class MainFrameController {
|
||||
def downloader = selectedDownload()
|
||||
downloader.resume()
|
||||
}
|
||||
|
||||
private void markTrust(String tableName, TrustLevel level, def list) {
|
||||
int row = builder.getVariable(tableName).getSelectedRow()
|
||||
if (row < 0)
|
||||
return
|
||||
core.eventBus.publish(new TrustEvent(persona : list[row], level : level))
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void markTrusted() {
|
||||
markTrust("distrusted-table", TrustLevel.TRUSTED, model.distrusted)
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void markNeutralFromDistrusted() {
|
||||
markTrust("distrusted-table", TrustLevel.NEUTRAL, model.distrusted)
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void markDistrusted() {
|
||||
markTrust("trusted-table", TrustLevel.DISTRUSTED, model.trusted)
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void markNeutralFromTrusted() {
|
||||
markTrust("trusted-table", TrustLevel.NEUTRAL, model.trusted)
|
||||
}
|
||||
|
||||
void mvcGroupInit(Map<String, String> args) {
|
||||
application.addPropertyChangeListener("core", {e->
|
||||
|
||||
@@ -201,8 +201,8 @@ class MainFrameModel {
|
||||
|
||||
void onTrustEvent(TrustEvent e) {
|
||||
runInsideUIAsync {
|
||||
JTable table = builder.getVariable("results-table")
|
||||
table.model.fireTableDataChanged()
|
||||
|
||||
// TODO: refresh any search tabs
|
||||
|
||||
trusted.clear()
|
||||
trusted.addAll(core.trustService.good.values())
|
||||
|
||||
7
gui/griffon-app/resources/trust.html
Normal file
7
gui/griffon-app/resources/trust.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
Some html goes here
|
||||
<ul>
|
||||
<li>1</li>
|
||||
<li>2</li>
|
||||
</ul>
|
||||
</html>
|
||||
@@ -22,6 +22,7 @@ import java.awt.FlowLayout
|
||||
import java.awt.GridBagConstraints
|
||||
import java.awt.GridBagLayout
|
||||
import java.awt.Insets
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
import javax.annotation.Nonnull
|
||||
|
||||
@@ -183,8 +184,8 @@ class MainFrameView {
|
||||
}
|
||||
}
|
||||
panel(constraints : "trust window") {
|
||||
gridLayout(rows: 1, cols :3)
|
||||
panel {
|
||||
gridLayout(rows: 1, cols :2)
|
||||
panel (border : etchedBorder()){
|
||||
borderLayout()
|
||||
panel (constraints : BorderLayout.NORTH) {
|
||||
label("Trusted users")
|
||||
@@ -196,9 +197,13 @@ class MainFrameView {
|
||||
}
|
||||
}
|
||||
}
|
||||
panel (constraints : BorderLayout.EAST) {
|
||||
gridBagLayout()
|
||||
button(text : "Mark Neutral", constraints : gbc(gridx: 0, gridy: 0), markNeutralFromTrustedAction)
|
||||
button(text : "Mark Distrusted", constraints : gbc(gridx: 0, gridy:1), markDistrustedAction)
|
||||
}
|
||||
}
|
||||
panel { label("buttons go here")}
|
||||
panel {
|
||||
panel (border : etchedBorder()){
|
||||
borderLayout()
|
||||
panel (constraints : BorderLayout.NORTH) {
|
||||
label("Distrusted users")
|
||||
@@ -210,6 +215,11 @@ class MainFrameView {
|
||||
}
|
||||
}
|
||||
}
|
||||
panel(constraints : BorderLayout.WEST) {
|
||||
gridBagLayout()
|
||||
button(text: "Mark Neutral", constraints: gbc(gridx: 0, gridy: 0), markNeutralFromDistrustedAction)
|
||||
button(text: "Mark Trusted", constraints : gbc(gridx: 0, gridy : 1), markTrustedAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user