public void launchAssignContentDialog(Content content) { Set<String> assignedServerGroupNames = Sets.newHashSet(Lists.transform(content.getAssignments(), Assignment::getServerGroup)); Set<String> serverGroupNames = Sets.newHashSet( Lists.transform(serverGroupStore.getServerGroups(), ServerGroupRecord::getName)); serverGroupNames.removeAll(assignedServerGroupNames); if (serverGroupNames.isEmpty()) { Console.warning(content.getName() + " is already assigned to all server groups."); } else { assignContentDialog.open(content, Ordering.natural().immutableSortedCopy(serverGroupNames)); } }
public void loadServerGroups() { getView().updateServerGroups(serverGroupStore.getServerGroups()); }