Skip to main content



      Home
Home » Eclipse Projects » GEF » Zest Label Provider problem
Zest Label Provider problem [message #646893] Sun, 02 January 2011 12:29 Go to next message
Eclipse UserFriend
Hi,

I did the Eclipse Zest Tutorial by Lars Vogel and tried everything, but I can never see the Labels Text.
I think it's a bug.

http://www.vogella.de/articles/EclipseZest/article.html

The problem is the following:
Actually the class ZestLabelProvider should check if there exists an instance of MyConnection:

if (element instanceof MyConnection){
            MyConnection myConnection = (MyConnection) element;
            return myConnection.getLabel();
}


This is the connection:

MyConnection connect = new MyConnection("1", "Name der Verbindung", nodes.get(0),
                nodes.get(1));


But there is never an instance od MyConnection. Only an instance of EntityConnection.
So, there is never a label for a connection.

The label provider is never called for connections with the IGraphEntityContentProvider.

Is there a solution for this?

Re: Zest Label Provider problem [message #646898 is a reply to message #646893] Sun, 02 January 2011 15:20 Go to previous messageGo to next message
Eclipse UserFriend
It seems to be a bug in the tutorial. I'm sure Lars would be happy if you reported it at his Google group.

The main conceptual problem seems to be the fact that in View.java the GraphViewer's input is set to the nodes, which don't contain references to connections. One possible approach would be to set the connections as the viewer's input, and get the nodes from the connections in an IGraphContentProvider, similar to the way it's done in this snippet.
Re: Zest Label Provider problem [message #648315 is a reply to message #646898] Wed, 12 January 2011 06:48 Go to previous message
Eclipse UserFriend
There is a solution, you have to implement the ISelfStyleProvider interface in your LabelProvider implementation.
This interface has two methods, one for styling nodes and one for connections.

With this interface you should be able to style what you want.

Regards
Johan
Previous Topic:Need optimized way to display tree items
Next Topic:Changing the size of a EditPart without affecting the Figure
Goto Forum:
  


Current Time: Sat Apr 19 15:13:47 EDT 2025

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

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

Back to the top