ToolStrip tools = new ToolStrip();
addButton = new ToolButton(add, new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
StandardRole role = treeModel.getRoleSelectionModel().getSelectedObject();
RoleAssignment roleAssignment = treeModel.getRoleAssignmentSelectionModel().getSelectedObject();
if (role != null && roleAssignment != null) {
presenter.launchAddDialg(role, roleAssignment, principalType);
} else {
// TODO Change this to a console message?
Log.warn("No role or no includes/excludes selected");
}
}
});
addButton.setEnabled(false);
tools.addToolButtonRight(addButton);
deleteButton = new ToolButton(delete, new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final StandardRole role = treeModel.getRoleSelectionModel().getSelectedObject();
final RoleAssignment roleAssignment = treeModel.getRoleAssignmentSelectionModel().getSelectedObject();
final Principal principal = treeModel.getPrincipalSelectionModel().getSelectedObject();
if (role != null && roleAssignment != null && principal != null) {
String principalTypeName = principalType == Principal.Type.USER ? Console.CONSTANTS
.common_label_user() : Console.CONSTANTS.common_label_group();