if (track.getNumber() != null) {
trackNumberTextInput.setText(track.getNumber().toString());
}
recordingNameTextInput.setText(track.getRecording().getName()!=null?track.getRecording().getName():"");
Work work = null;
if (track.getRecording().getWorks() != null && track.getRecording().getWorks().size()>0) {
work = track.getRecording().getWorks().iterator().next();
}
if (work != null) {
workNameTextInput.setText(work.getName());
}
if (track.getRecording().getDate() != null) {
recordingYearTextInput.setText(DATE_FORMAT_DATE.format(this.track.getRecording().getDate()));
}
Set<Contributor> contributors = new HashSet<Contributor>(track.getRecording().getContributors());
if (work != null) {
contributors.addAll(work.getContributors());
}
updateContributors(contributors);
// Add a suggestion popup on the work name field
workNameTextInput.getTextInputContentListeners().add(new TextInputContentListener.Adapter() {