public void setField(TagField field) { FieldKey genericKey = FieldKey.valueOf(field.getId()); if (genericKey == FieldKey.TRACK) { setTrack(field.toString()); } else { super.setField(field); } }
/** * Returns all selected qualifications. * * @return All qualifications */ public List<Qualification> getQualifications() { List<Qualification> quals = new ArrayList<Qualification>(); Set<?> set = (Set<?>) tags.getValue(); if (set == null) return null; for (Object obj : set) quals.add(container.getItem(obj).getBean()); return quals; }
/** * Add Field * * <p> * * <p>Overidden because there can only be one vendor set * * @param field */ public void addField(TagField field) { if (field.getId().equals(VorbisCommentFieldKey.VENDOR.getFieldName())) { super.setField(field); } else { super.addField(field); } }
public void setField(TagField field) { FieldKey genericKey = FieldKey.valueOf(field.getId()); switch (genericKey) { case ARTIST: setArtist(field.toString()); break; case ALBUM: setAlbum(field.toString()); break; case TITLE: setTitle(field.toString()); break; case GENRE: setGenre(field.toString()); break; case YEAR: setYear(field.toString()); break; case COMMENT: setComment(field.toString()); break; } }
/** * Creates the field with the given container. * * @param container The container */ public QualificationField(QualificationContainer container) { HorizontalLayout horLayout = new HorizontalLayout(); horLayout.setWidth("100%"); setCompositionRoot(horLayout); this.container = container; tags = new QualificationTagField(); tags.setContainerDataSource(container); tags.setNewTokensAllowed(true); tags.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS); horLayout.addComponent(tags); horLayout.setExpandRatio(tags, 1.0f); btnEdit = new Button(); btnEdit.setDescription("Qualifikationen bearbeiten"); btnEdit.addListener((ClickListener) this); horLayout.addComponent(btnEdit); }
/** * Sets the qualifications. * * @param quals The new qualifications */ public void setQualifications(List<Qualification> quals) { for (Qualification qual : quals) tags.addToken(qual.getName()); }