use of org.eclipse.emf.ecore.util.FeatureMapUtil.FeatureEList in project mylyn.docs by eclipse.
the class PublicationProxy method getSubject.
@SuppressWarnings("rawtypes")
public String getSubject() {
EList<Subject> subjects = publication.getPackage().getMetadata().getSubjects();
if (subjects.size() > 0) {
FeatureMap fm = subjects.get(0).getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
}
return EMPTY_STRING;
}
use of org.eclipse.emf.ecore.util.FeatureMapUtil.FeatureEList in project mylyn.docs by eclipse.
the class PublicationProxy method getLanguage.
@SuppressWarnings("rawtypes")
public String getLanguage() {
EList<Language> languages = publication.getPackage().getMetadata().getLanguages();
if (languages.size() > 0) {
FeatureMap fm = languages.get(0).getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
String iso639 = ((FeatureEList) o).get(0).toString();
Locale l = new Locale(iso639);
return l.getDisplayLanguage();
}
}
}
return EMPTY_STRING;
}
use of org.eclipse.emf.ecore.util.FeatureMapUtil.FeatureEList in project mylyn.docs by eclipse.
the class PublicationProxy method getPublicationDate.
@SuppressWarnings("rawtypes")
public String getPublicationDate() {
EList<Date> dates = publication.getPackage().getMetadata().getDates();
if (dates.size() > 0) {
for (Date date : dates) {
if (date.getEvent().equals("publication")) {
// $NON-NLS-1$
FeatureMap fm = date.getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
}
}
}
return EMPTY_STRING;
}
use of org.eclipse.emf.ecore.util.FeatureMapUtil.FeatureEList in project mylyn.docs by eclipse.
the class PublicationProxy method getTitle.
@SuppressWarnings("rawtypes")
public String getTitle() {
EList<Title> titles = publication.getPackage().getMetadata().getTitles();
if (titles.size() > 0) {
FeatureMap fm = titles.get(0).getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
}
return EMPTY_STRING;
}
use of org.eclipse.emf.ecore.util.FeatureMapUtil.FeatureEList in project mylyn.docs by eclipse.
the class AbstractTest method getText.
@SuppressWarnings("rawtypes")
public String getText(DCType identifier) {
FeatureMap fm = identifier.getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
return null;
}
Aggregations