Skip to content
Snippets Groups Projects
Commit 6cc12200 authored by Klaus Becker's avatar Klaus Becker
Browse files

refs 216
parent eee31af8
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.model.IIdLabeled;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 8A4299022B07F32CEED5A061DC03FBD2
* @ConQAT.Rating YELLOW Hash: 20798F4B379821E393B1CC36691662EA
*/
public class UniqueIDUtils {
......@@ -58,6 +58,23 @@ public class UniqueIDUtils {
return currentMaxId;
}
/**
* Generates all IDs of the given model. Already existing IDs are
* overwritten.
*
* @param existingModel
* the model to be updated
*/
public static void generateAllIDs(EObject existingModel) {
int currentId = 0;
for (Iterator<EObject> i = existingModel.eAllContents(); i.hasNext();) {
EObject eo = i.next();
if (eo instanceof IIdLabeled) {
((IIdLabeled) eo).setId((++currentId));
}
}
}
/**
* Assigns unique IDs to the given object and its content.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment