Custom Task (icon not being replaced) [message #1420178] |
Tue, 09 September 2014 16:20 |
Rui Domingues Messages: 194 Registered: October 2010 |
Senior Member |
|
|
Hi.
I've developed a Custom Task and the icon was not being placed on ServiceTask(which is the type that I'm extending).
I looked into the source:https://eclipse.googlesource.com/bpmn2-modeler/org.eclipse.bpmn2-modeler/+/kepler/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/features/activity/task/CustomShapeFeatureContainer.java
and I noticed that the addImage flag is always false, because an Image Graphiti element is always found. Is this a bug, or am I doing something wrong?
Thanks a lot.
rui
if (icon!=null && pe instanceof ContainerShape) {
boolean addImage = true;
ContainerShape containerShape = (ContainerShape)pe;
GraphicsAlgorithm ga = (GraphicsAlgorithm)AbstractBpmn2AddFeature.getGraphicsAlgorithm(containerShape);
for (PictogramElement child : containerShape.getChildren()) {
if (child.getGraphicsAlgorithm() instanceof Image) {
addImage = false;
break;
}
}
if (ga!=null) {
for (GraphicsAlgorithm g : ga.getGraphicsAlgorithmChildren()) {
if (g instanceof Image) {
addImage = false;
break;
}
}
}
else
addImage = false;
if (addImage) {
Image img = CustomTaskImageProvider.createImage(customTaskDescriptor, ga, icon, 24, 24);
Graphiti.getGaService().setLocationAndSize(img, 2, 2, 24, 24);
}
}
[Updated on: Tue, 09 September 2014 16:20] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03839 seconds