<commit_before>package scrum.client.release;

import ilarkesto.gwt.client.AMultiSelectionViewEditWidget;
import ilarkesto.gwt.client.AOutputViewEditWidget;
import ilarkesto.gwt.client.TableBuilder;
import scrum.client.ScrumGwt;
import scrum.client.common.AScrumWidget;
import scrum.client.issues.RequestReleaseIssuesServiceCall;
import scrum.client.journal.ChangeHistoryWidget;
import scrum.client.sprint.Sprint;

import com.google.gwt.user.client.ui.Widget;

public class ReleaseWidget extends AScrumWidget {

	private Release release;

	public ReleaseWidget(Release release) {
		super();
		this.release = release;
	}

	@Override
	protected Widget onInitialization() {
		new RequestReleaseIssuesServiceCall(release.getId()).execute();

		TableBuilder tb = ScrumGwt.createFieldTable();

		tb.addFieldRow("Label", release.getLabelModel());
		tb.addFieldRow("Release Date", release.getReleaseDateModel());
		tb.addFieldRow("Development Notes", release.getNoteModel());
		tb.addFieldRow("Release Notes", release.getReleaseNotesModel());
		tb.addFieldRow("SCM Tag", release.getScmTagModel());
		if (release.isMajor()) {
			tb.addFieldRow("Sprints", new AMultiSelectionViewEditWidget<Sprint>() {

				@Override
				protected void onViewerUpdate() {
					setViewerItems(release.getSprints());
				}

				@Override
				protected void onEditorUpdate() {
					setEditorItems(release.getProject().getSprints());
					setEditorSelectedItems(release.getSprints());
				}

				@Override
				protected void onEditorSubmit() {
					release.setSprints(getEditorSelectedItems());
				}

				@Override
				public boolean isEditable() {
					return release.getProject().isProductOwnerOrScrumMaster(getCurrentUser());
				}

				@Override
				public String getTooltip() {
					return getLocalizer().fields().releaseSprints();
				}
			});
<commit_msg>sprint order on release widget<commit_after>package scrum.client.release;

import ilarkesto.gwt.client.AMultiSelectionViewEditWidget;
import ilarkesto.gwt.client.AOutputViewEditWidget;
import ilarkesto.gwt.client.TableBuilder;

import java.util.Collections;
import java.util.List;

import scrum.client.ScrumGwt;
import scrum.client.common.AScrumWidget;
import scrum.client.issues.RequestReleaseIssuesServiceCall;
import scrum.client.journal.ChangeHistoryWidget;
import scrum.client.sprint.Sprint;

import com.google.gwt.user.client.ui.Widget;

public class ReleaseWidget extends AScrumWidget {

	private Release release;

	public ReleaseWidget(Release release) {
		super();
		this.release = release;
	}

	@Override
	protected Widget onInitialization() {
		new RequestReleaseIssuesServiceCall(release.getId()).execute();

		TableBuilder tb = ScrumGwt.createFieldTable();

		tb.addFieldRow("Label", release.getLabelModel());
		tb.addFieldRow("Release Date", release.getReleaseDateModel());
		tb.addFieldRow("Development Notes", release.getNoteModel());
		tb.addFieldRow("Release Notes", release.getReleaseNotesModel());
		tb.addFieldRow("SCM Tag", release.getScmTagModel());
		if (release.isMajor()) {
			tb.addFieldRow("Sprints", new AMultiSelectionViewEditWidget<Sprint>() {

				@Override
				protected void onViewerUpdate() {
					setViewerItems(release.getSprints());
				}

				@Override
				protected void onEditorUpdate() {
					List<Sprint> sprints = release.getProject().getSprints();
					Collections.sort(sprints, Sprint.END_DATE_COMPARATOR);
					setEditorItems(sprints);
					setEditorSelectedItems(release.getSprints());
				}

				@Override
				protected void onEditorSubmit() {
					release.setSprints(getEditorSelectedItems());
				}

				@Override
				public boolean isEditable() {
					return release.getProject().isProductOwnerOrScrumMaster(getCurrentUser());
				}

				@Override
				public String getTooltip() {
					return getLocalizer().fields().releaseSprints();
				}
			});

{'fraction_non_alphanumeric': 0.11537457582876534, 'fraction_numerical': 0.0, 'mean_word_length': 5.072900158478605, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '251350', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1129, 'n_words': 193}