use of org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind in project webtools.sourceediting by eclipse.
the class DTDModelBuilder method createDTDEnumeration.
private DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, AttNode attdef, int enumKind) {
DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
enumeration.setKind(groupKind);
dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
// Enumeration values
Enumeration tokenIter = attdef.elements();
if (tokenIter != null) {
while (tokenIter.hasMoreElements()) {
String val = (String) tokenIter.nextElement();
EEnumLiteral enumLiteral = createEEnumLiteral();
// enumLiteral.setXMIDocument(dtdattr.getXMIDocument());
// MOF2EMF Port
// enumLiteral.refSetLiteral(val);
enumLiteral.setName(val);
// enumLiteral.setNumber(i++);
enumeration.getEnumLiterals().add(enumLiteral);
}
}
return enumeration;
}
use of org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind in project webtools.sourceediting by eclipse.
the class DTDEnumerationTypeImpl method setKind.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setKind(DTDEnumGroupKind newKind) {
DTDEnumGroupKind oldKind = kind;
kind = newKind == null ? KIND_EDEFAULT : newKind;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ENUMERATION_TYPE__KIND, oldKind, kind));
}
use of org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind in project webtools.sourceediting by eclipse.
the class DTDAttributeImpl method createDTDEnumeration.
public DTDEnumerationType createDTDEnumeration(String[] enumValues, int enumKind) {
DTDEnumerationType enumeration = DTDFactoryImpl.instance().createDTDEnumerationType();
// enum.setID("Enum_" + ((DTDElement)getMOFDomain()).getName() + "_" +
// getName());
DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
enumeration.setKind(groupKind);
// Enumeration values
if (enumValues != null) {
for (int i = 0; i < enumValues.length; i++) {
EcorePackage ePackage = (EcorePackage) EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
EEnumLiteral enumLiteral = ((EcoreFactory) ePackage.getEFactoryInstance()).createEEnumLiteral();
// MOF2EMF Port
// enumLiteral.refSetLiteral(enumValues[i]);
enumLiteral.setName(enumValues[i]);
// MOF2EMF Port
// enumLiteral.refSetLiteral(i);
enumLiteral.setValue(i);
enumeration.getEnumLiterals().add(enumLiteral);
}
}
getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
return enumeration;
}
use of org.eclipse.wst.dtd.core.internal.emf.DTDEnumGroupKind in project webtools.sourceediting by eclipse.
the class DTDModelBuilder method createDTDEnumeration.
public DTDEnumerationType createDTDEnumeration(DTDAttribute dtdattr, String[] enumValues, int enumKind) {
DTDEnumerationType enumeration = getFactory().createDTDEnumerationType();
DTDEnumGroupKind groupKind = DTDEnumGroupKind.get(enumKind);
enumeration.setKind(groupKind);
// Enumeration values
if (enumValues != null) {
for (int i = 0; i < enumValues.length; i++) {
EEnumLiteral enumLiteral = createEEnumLiteral();
// enumVal.setXMIDocument(dtdattr.getXMIDocument());
// MOF2EMF Port
// enumLiteral.refSetLiteral(enumValues[i]);
enumLiteral.setName(enumValues[i]);
// enumLiteral.setNumber(i);
enumeration.getEnumLiterals().add(enumLiteral);
}
}
dtdattr.getDTDElement().getDTDFile().getDTDEnumerationType().add(enumeration);
return enumeration;
}
Aggregations