package org.simantics.g2d.canvas.impl;\r
\r
import java.lang.reflect.Field;\r
+import java.util.HashSet;\r
+import java.util.Set;\r
\r
import org.simantics.g2d.canvas.ICanvasContext;\r
import org.simantics.g2d.canvas.ICanvasParticipant;\r
AbstractCanvasParticipant.this.depsSatisfied = depsSatisfied;\r
}\r
};\r
+\r
+ Set<Field> missingDependencies = new HashSet<>();\r
+ \r
@SuppressWarnings("unchecked")\r
private void _itemAdded(IContext<ICanvasParticipant> sender, ICanvasParticipant item)\r
{\r
continue;\r
Field f = rd.field;\r
Object o = f.get(this);\r
- if (o == null)\r
+ if (o == null) {\r
+ missingDependencies.add(f);\r
return false;\r
+ } else {\r
+ missingDependencies.remove(f);\r
+ }\r
}\r
} catch (Exception e) {\r
throw new RuntimeException(e);\r
if (ctx instanceof AbstractCanvasParticipant) {\r
AbstractCanvasParticipant acp = (AbstractCanvasParticipant) ctx;\r
if (!acp.depsSatisfied) {\r
- throw new AssertionError("Participant "+acp+" dependies unsatisfied");\r
+ throw new AssertionError("Participant "+acp+" dependencies unsatisfied : " + acp.missingDependencies);\r
}\r
}\r
}\r