}
unfollowLink.addClickHandler(new ClickHandler()
{
public void onClick(final ClickEvent event)
{
SetFollowingStatusRequest request = new SetFollowingStatusRequest(Session.getInstance()
.getCurrentPerson().getAccountId(), inFollowable.getUniqueId(), inFollowable.getEntityType(),
false, Follower.FollowerStatus.NOTFOLLOWING);
if (inFollowable.getEntityType() == EntityType.PERSON)
{
PersonFollowersModel.getInstance().insert(request);
}
else if (inFollowable.getEntityType() == EntityType.GROUP)
{
GroupMembersModel.getInstance().insert(request);
}
else
{
Window.alert("Unsupported");
}
unfollowLink.setVisible(false);
followLink.setVisible(true);
}
});
this.add(unfollowLink);
if (followStyle != null)
{
followLink.addStyleName(followStyle);
}
if (commonStyle != null)
{
followLink.addStyleName(commonStyle);
}
followLink.addClickHandler(new ClickHandler()
{
public void onClick(final ClickEvent event)
{
SetFollowingStatusRequest request = new SetFollowingStatusRequest(Session.getInstance()
.getCurrentPerson().getAccountId(), inFollowable.getUniqueId(), inFollowable.getEntityType(),
false, Follower.FollowerStatus.FOLLOWING);
if (inFollowable.getEntityType() == EntityType.PERSON)
{