Skip to content

Commit bc2c3c8

Browse files
committed
Update GUI accounts table to show account controllers
1 parent d0b5349 commit bc2c3c8

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

convex-gui/src/main/java/convex/gui/components/account/AccountsPanel.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,22 @@ public AccountsPanel(Convex convex,StateModel<State> model) {
152152
table.getColumnModel().getColumn(6).setPreferredWidth(100);
153153
table.getColumnModel().getColumn(6).setCellRenderer(cr);
154154
}
155+
156+
{ // Account Controller
157+
CellRenderer cr=new CellRenderer(JLabel.LEFT);
158+
cr.setToolTipText("Account Controller. May recover, modify or update the controlled account.");
159+
cr.setForeground(Color.WHITE);
160+
table.getColumnModel().getColumn(7).setPreferredWidth(80);
161+
table.getColumnModel().getColumn(7).setCellRenderer(cr);
162+
}
163+
155164

156165

157166
{ // Account public key
158167
AccountKeyRenderer cr=new AccountKeyRenderer();
159168
cr.setToolTipText("Public key of the account. Used to validate transactions from users.");
160-
table.getColumnModel().getColumn(7).setPreferredWidth(150);
161-
table.getColumnModel().getColumn(7).setCellRenderer(cr);
169+
table.getColumnModel().getColumn(8).setPreferredWidth(150);
170+
table.getColumnModel().getColumn(8).setCellRenderer(cr);
162171
}
163172

164173
final JPopupMenu popupMenu = new JPopupMenu();

convex-gui/src/main/java/convex/gui/models/AccountsTableModel.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public AccountsTableModel(State state) {
1919
this.state = state;
2020
}
2121

22-
private static final String[] FIXED_COLS = new String[] { "Address", "Type", "Seq.", "Balance", "Name", "Env.Size", "Allowance","Key" };
22+
private static final String[] FIXED_COLS = new String[] { "Address", "Type", "Seq.", "Balance", "Name", "Env.Size", "Allowance","Controller","Key" };
2323

2424
public String getColumnName(int col) {
2525
if (col < FIXED_COLS.length) return FIXED_COLS[col];
@@ -70,7 +70,11 @@ public Object getValueAt(int rowIndex, int columnIndex) {
7070
return Text.toFriendlyNumber(as.getMemorySize());
7171
case 6:
7272
return Text.toFriendlyNumber(as.getMemory());
73-
case 7:
73+
case 7: {
74+
ACell control= as.getController();
75+
return (control==null)?"":control;
76+
}
77+
case 8:
7478
return as.getAccountKey();
7579
default:
7680
return "";

0 commit comments

Comments
 (0)