/**
* {@inheritDoc}
*/
public Panel render(final PersonModelView item)
{
PersonPanel panel = new PersonPanel(item, false, false, false);
boolean currentUserIsAdmin = Session.getInstance().getCurrentPersonRoles().contains(Role.SYSTEM_ADMIN);
boolean currentUserIsGroupCoordinator = isGroupCoordinator(Session.getInstance().getCurrentPerson());
// conditions by which a person should show up as 'Remove'-able:
// cannot delete himself AND private group AND (current user is ADMIN or GROUP COORD)
if ((Session.getInstance().getCurrentPerson().getId() != item.getEntityId())
&& (currentUserIsAdmin || currentUserIsGroupCoordinator) && (!group.isPublic()))
{
boolean toBeRemovedFollowerIsGroupCoordinator = isGroupCoordinator(item);
int numberOfGroupCoordinators = group.getCoordinators().size();
// Cannot remove Group Coordinator if he/she is the last Group Coordinator.
if (toBeRemovedFollowerIsGroupCoordinator && (numberOfGroupCoordinators == 1))
{
// short-circuit as this Person is non-removable
return panel;
}
panel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().removablePerson());
Label deleteLink = new Label("Remove");
deleteLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().linkedLabel());
deleteLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().delete());
panel.add(deleteLink);
deleteLink.addClickHandler(new ClickHandler()
{
public void onClick(final ClickEvent inArg0)
{