SetPermissionsDialog setPermissionsDialog = new SetPermissionsDialog(
new RunLater<String[]>() {
@Override
public void run(String[] permissions) {
Flog.info("Submitting permission changes.");
FlooHandler flooHandler = context.getFlooHandler();
if (flooHandler == null) {
return;
}
flooHandler.editorEventHandler.changePerms(userId, permissions);
}
},
permissions.contains("get_buf"),
permissions.contains("request_perms"),
permissions.contains("patch"),
permissions.contains("kick")
);
setPermissionsDialog.setUsername(client.username);
setPermissionsDialog.createCenterPanel();
setPermissionsDialog.show();
}
});
popupMenu.add(adminMenuItem);
popupMenu.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
FlooHandler floohandler = context.getFlooHandler();
if (floohandler == null) {
return;
}
kickMenuItem.setEnabled(floohandler.state.can("kick"));
adminMenuItem.setEnabled(floohandler.state.can("kick"));