Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Icon of Wrapping Label
Icon of Wrapping Label [message #1068100] Fri, 12 July 2013 07:47
Pierre Cressant is currently offline Pierre Cressant
Messages: 6
Registered: July 2013
Junior Member
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.
Previous Topic:GMF/TENEO/Common Navigator Framework
Next Topic:Popup Bar Type
Goto Forum:
  


Current Time: Thu Sep 18 23:59:01 GMT 2014

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

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