Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zest Label Provider problem
Zest Label Provider problem [message #646893] Sun, 02 January 2011 17:29 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: January 2011
Junior Member

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.

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),

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 20:20 Go to previous messageGo to next message
Fabian Steeg is currently offline Fabian SteegFriend
Messages: 76
Registered: July 2009
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 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 11:48 Go to previous message
Johan Schulz is currently offline Johan SchulzFriend
Messages: 20
Registered: November 2010
Junior Member
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.

Previous Topic:Need Help to apply Search Filter in GEF palette
Next Topic:Label Provider position
Goto Forum:

Current Time: Tue Jun 19 12:55:51 GMT 2018

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

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

Back to the top