EventBus.getInstance().addObserver(SwitchedToGroupStreamEvent.getEvent(),
new Observer<SwitchedToGroupStreamEvent>()
{
public void update(final SwitchedToGroupStreamEvent arg1)
{
GroupStreamDTO group = arg1.getView();
// If the group has disabled posting, make "my activity stream" the default destination. The
// one case where this would be the incorrect thing to do is if the user is a group or org
// coordinator. But it is better for coordinators to have to explicitly choose the group
// than the alternative: a non-postable group pre-selected for regular users and their posts
// just going nowhere.
if (!group.isPostable())
{
selectMyActivityStream();
}
else
{
other.setChecked(true);
autoComplete.setVisible(false);
autoComplete.setDefaultText(OTHER_TEXT);
removeScopePanel(thisBuffered);
typedInScope = new StreamScope(ScopeType.GROUP, group.getShortName());
typedInScope.setDisplayName(group.getName());
scopePanel = new StreamScopePanel(typedInScope);
thisBuffered.add(scopePanel);
}
}