}
return app;
}
public DataField createXPDLObject(DataFields dfs, String type, boolean addToCollection) {
DataField df = (DataField) dfs.generateNewElement();
adjustType(df, type);
JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
boolean hasTemplate = jts.hasTemplateId(type);
if (hasTemplate) {
jts.fillFromTemplate(df, type);
}
String id = df.getId();
if (!hasTemplate || id.equals("") || dfs.getDataField(id) != null) {
if (id.equals("")) {
id = JaWEManager.getInstance().getIdFactory().generateUniqueId(dfs);
} else {
id = JaWEManager.getInstance().getIdFactory().generateSimilarOrIdenticalUniqueId(dfs, new HashSet(), id);
}
int i = 0;
while (dfs.getDataField(id) != null) {
id = id + String.valueOf(++i);
}
df.setId(id);
}
adjustXPDLObject(df, type);
if (addToCollection) {