<commit_before>package org.sagebionetworks.web.client.widget.entity.editor;

import org.sagebionetworks.web.client.DisplayUtils;
import org.sagebionetworks.web.client.SynapseJSNIUtils;
import org.sagebionetworks.web.client.UrlCache;
import org.sagebionetworks.web.client.widget.search.UserGroupSuggestBox;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class UserTeamConfigViewImpl extends SimplePanel implements UserTeamConfigView {

	private Presenter presenter;
	UrlCache urlCache;
	SynapseJSNIUtils synapseJSNIUtils;
	UserGroupSuggestBox suggestBox;
	
	@Inject
	public UserTeamConfigViewImpl(UrlCache urlCache, SynapseJSNIUtils synapseJSNIUtils, UserGroupSuggestBox suggestBox) {
		this.urlCache = urlCache;
		this.synapseJSNIUtils = synapseJSNIUtils;
		this.suggestBox = suggestBox;
	}
	
	@Override
	public void initView() {
		clear();
		suggestBox.configureURLs(synapseJSNIUtils.getBaseFileHandleUrl(), synapseJSNIUtils.getBaseProfileAttachmentUrl());
		suggestBox.setPlaceholderText("Enter name...");
		suggestBox.setWidth(330 + "px");
		SimplePanel panel = new SimplePanel();
		panel.setWidget(suggestBox.asWidget());
		panel.addStyleName("margin-10");
		setWidget(panel);
	}
	@Override
	public void checkParams() throws IllegalArgumentException {
		if (suggestBox.getSelectedSuggestion() == null)	// TODO: was peopleCombo.isValid(). Does this work?
			throw new IllegalArgumentException("No user or team was selected.");
	}
	@Override
	public String getId() {
		return suggestBox.getSelectedSuggestion().getHeader().getOwnerId();
	}
	
	@Override
	public void setId(String id) {
		//TODO: to allow editing existing badge
	}
	
	@Override
	public String isIndividual() {
		return suggestBox.getSelectedSuggestion().getHeader().getIsIndividual().toString();<commit_msg>Got rid of a TODO that I verified.<commit_after>package org.sagebionetworks.web.client.widget.entity.editor;

import org.sagebionetworks.web.client.DisplayUtils;
import org.sagebionetworks.web.client.SynapseJSNIUtils;
import org.sagebionetworks.web.client.UrlCache;
import org.sagebionetworks.web.client.widget.search.UserGroupSuggestBox;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class UserTeamConfigViewImpl extends SimplePanel implements UserTeamConfigView {

	private Presenter presenter;
	UrlCache urlCache;
	SynapseJSNIUtils synapseJSNIUtils;
	UserGroupSuggestBox suggestBox;
	
	@Inject
	public UserTeamConfigViewImpl(UrlCache urlCache, SynapseJSNIUtils synapseJSNIUtils, UserGroupSuggestBox suggestBox) {
		this.urlCache = urlCache;
		this.synapseJSNIUtils = synapseJSNIUtils;
		this.suggestBox = suggestBox;
	}
	
	@Override
	public void initView() {
		clear();
		suggestBox.configureURLs(synapseJSNIUtils.getBaseFileHandleUrl(), synapseJSNIUtils.getBaseProfileAttachmentUrl());
		suggestBox.setPlaceholderText("Enter name...");
		suggestBox.setWidth(330 + "px");
		SimplePanel panel = new SimplePanel();
		panel.setWidget(suggestBox.asWidget());
		panel.addStyleName("margin-10");
		setWidget(panel);
	}
	@Override
	public void checkParams() throws IllegalArgumentException {
		if (suggestBox.getSelectedSuggestion() == null)
			throw new IllegalArgumentException("No user or team was selected.");
	}
	@Override
	public String getId() {
		return suggestBox.getSelectedSuggestion().getHeader().getOwnerId();
	}
	
	@Override
	public void setId(String id) {
		//TODO: to allow editing existing badge
	}
	
	@Override
	public String isIndividual() {
		return suggestBox.getSelectedSuggestion().getHeader().getIsIndividual().toString();
{'fraction_non_alphanumeric': 0.10887185104052574, 'fraction_numerical': 0.002190580503833516, 'mean_word_length': 5.939209726443769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1895955', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1443, 'n_words': 252}