Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Custom Task (icon not being replaced)
Custom Task (icon not being replaced) [message #1420178] Tue, 09 September 2014 16:20 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
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

Re: Custom Task (icon not being replaced) [message #1427023 is a reply to message #1420178] Fri, 19 September 2014 15:26 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Yep, looks like a bug because there doesn't seem to be any way to provide your own image if the task type being extended already has one.
Please open a bugzilla report for this.
Previous Topic:Deletion of namespaces with getXMLNSPrefixMap()
Next Topic:Custom Task (change name on creation)
Goto Forum:
  


Current Time: Thu Apr 25 01:10:31 GMT 2024

Powered by FUDForum. Page generated in 0.03061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top