Skip to content
Snippets Groups Projects
Commit c8a6061e authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

do not take layout changes into account when outdating some contracts

refs 2409
parent 6f0cb86e
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,10 @@ import static org.fortiss.tooling.base.utils.PointUtils.setPoint;
import static org.fortiss.tooling.base.utils.RectangleLayoutUtils.layoutNodeInRoot;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.dnd.ElementDropContext;
import org.fortiss.tooling.base.layout.LayoutKeyConstants;
......@@ -57,7 +61,7 @@ import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
* @author hummel
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: D0471E64A1CE82CAAD2E58A6D30FD5A5
* @ConQAT.Rating YELLOW Hash: 88A392D0ACFEDEA4B6D4B85919A5CEDB
*/
public class LayoutDataUtils {
......@@ -156,4 +160,26 @@ public class LayoutDataUtils {
}
}
}
/**
* @param obj
* Removes all the layout-related data (including for descendants) in
* <code>obj</code>.
*/
public static void filterAllLayoutData(EObject obj) {
if(obj instanceof ILayoutedModelElement) {
((ILayoutedModelElement)obj).getLayoutData().clear();
}
TreeIterator<EObject> contents = obj.eAllContents();
List<ILayoutedModelElement> toClears = new ArrayList<ILayoutedModelElement>();
while(contents.hasNext()) {
EObject elt = contents.next();
if(elt instanceof ILayoutedModelElement) {
toClears.add((ILayoutedModelElement)elt);
}
}
for(ILayoutedModelElement toClear : toClears) {
toClear.getLayoutData().clear();
}
}
}
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