Hello Everybody,
I've got a problem in GMF. I have a node with several labels. In one of them, I want to display a specific icon.
So, I've tried various things. I tried to instantiate my wrappinglabel with an image as parameters
fFigureTaskIconExecutorFigure = new WrappingLabel(this.loadImageExecutor());
public Image loadImageExecutor() {
Task task = (Task) ((View) TaskEditPart.this.getModel())
.getElement();
String stringPath = "icons/custom/" + task.getExecutor().getName()
+ ".gif";
System.out.println(stringPath);
Bundle bundle = Platform.getBundle("KMADeRCP.diagram");
IPath path = new Path(stringPath);
URL url = FileLocator.find(bundle, path, null);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
return desc.createImage();
It doesn't work. The icon displayed at the node's creation is the default one.
I've also tried to set the icon after the instantiation of the label :
fFigureTaskIconExecutorFigure.setIcon(this.loadImageExecutor());
Well, it returned me this : !MESSAGE MapModeUtil#getMapMode(IFigure fig) fig parameter must be attached to a parent - using default MapMode
If someone have an idea about it...
Thank you and sorry for my bad english.