Skip to content
Snippets Groups Projects
Commit 973c43a8 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

RED

refs 1180
parent 17e9d904
No related branches found
No related tags found
No related merge requests found
......@@ -61,14 +61,19 @@ public class ModelUtils {
* if the context is not contained in a persisted model.
*/
public static void prepareUniqueID(EObject element, EObject context) {
// FIXME: why not use org.fortiss.tooling.kernel.utils.UniqueIDUtils.prepareIDs(EObject,
// EObject, int)
if(element instanceof IIdLabeled) {
ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(context);
if(top == null) {
EObject root = context;
while(root.eContainer() != null)
while(root.eContainer() != null) {
root = root.eContainer();
}
// FIXME: why not start with 0
// see also org.fortiss.tooling.kernel.internal.storage.eclipse.ModelContext:129
int id = Integer.MIN_VALUE;
for(TreeIterator<EObject> iter = root.eAllContents(); iter.hasNext();) {
EObject o = iter.next();
......
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