Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » A conflict between AbstractConnectionEditPart and Adapter
A conflict between AbstractConnectionEditPart and Adapter [message #556215] Tue, 31 August 2010 11:39 Go to next message
Eclipse UserFriend
Originally posted by: htran.infosys.tuwien.ac.at

Hello everyone,

On my effort to develop a graphical GEF editor based on EMF models, I
confronted with a conflict issue for my connection edit part. Following
the recommendation from the RedBook and the GEF Tutorial presentation
(2005), my connection editpart implemented the interface
org.eclipse.emf.common.notify.Adapter (for listening to changes in the
EMF model) while extending the abstract class
org.eclipse.gef.editparts.AbstractConnectionEditPart (for handling the
connection itself and its anchors).

public class LinkPart extends AbstractConnectionEditPart implements
Adapter {
....
}

The issue raises because the class AbstractConnectionEditPart and the
interface Adapter comprise the same method, that is getTarget().

Notifier Adapter#getTarget();

EditPart AbstractConnectionEditPart#getTarget() {

There is a compile error saying "The return types are incompatible for
the inherited methods Adapter.getTarget(),
AbstractConnectionEditPart.getTarget()"

Could you please provide some hints for solving this issue (possibly
without using additional helper classes)? Many thanks in advance.

Greetings,
Huy
Re: A conflict between AbstractConnectionEditPart and Adapter [message #556242 is a reply to message #556215] Tue, 31 August 2010 12:29 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 31/08/2010 12:39, Huy Tran wrote:
> Hello everyone,
>
> On my effort to develop a graphical GEF editor based on EMF models, I
> confronted with a conflict issue for my connection edit part. Following
> the recommendation from the RedBook and the GEF Tutorial presentation
> (2005), my connection editpart implemented the interface
> org.eclipse.emf.common.notify.Adapter (for listening to changes in the
> EMF model) while extending the abstract class
> org.eclipse.gef.editparts.AbstractConnectionEditPart (for handling the
> connection itself and its anchors).
>
> public class LinkPart extends AbstractConnectionEditPart implements
> Adapter {
> ...
> }
>
> The issue raises because the class AbstractConnectionEditPart and the
> interface Adapter comprise the same method, that is getTarget().
>
> Notifier Adapter#getTarget();
>
> EditPart AbstractConnectionEditPart#getTarget() {
>
> There is a compile error saying "The return types are incompatible for
> the inherited methods Adapter.getTarget(),
> AbstractConnectionEditPart.getTarget()"
>
> Could you please provide some hints for solving this issue (possibly
> without using additional helper classes)? Many thanks in advance.
>
> Greetings,
> Huy

Don't allow LinkPart to implement Adapter. Use an internal listener
class instead.
Re: A conflict between AbstractConnectionEditPart and Adapter [message #556255 is a reply to message #556242] Tue, 31 August 2010 13:24 Go to previous message
Eclipse UserFriend
Originally posted by: htran.infosys.tuwien.ac.at

Thanks a lot, Phillipus.
Huy

On 08/31/2010 02:29 PM, Phillipus wrote:
> On 31/08/2010 12:39, Huy Tran wrote:
>> Hello everyone,
>>
>> On my effort to develop a graphical GEF editor based on EMF models, I
>> confronted with a conflict issue for my connection edit part. Following
>> the recommendation from the RedBook and the GEF Tutorial presentation
>> (2005), my connection editpart implemented the interface
>> org.eclipse.emf.common.notify.Adapter (for listening to changes in the
>> EMF model) while extending the abstract class
>> org.eclipse.gef.editparts.AbstractConnectionEditPart (for handling the
>> connection itself and its anchors).
>>
>> public class LinkPart extends AbstractConnectionEditPart implements
>> Adapter {
>> ...
>> }
>>
>> The issue raises because the class AbstractConnectionEditPart and the
>> interface Adapter comprise the same method, that is getTarget().
>>
>> Notifier Adapter#getTarget();
>>
>> EditPart AbstractConnectionEditPart#getTarget() {
>>
>> There is a compile error saying "The return types are incompatible for
>> the inherited methods Adapter.getTarget(),
>> AbstractConnectionEditPart.getTarget()"
>>
>> Could you please provide some hints for solving this issue (possibly
>> without using additional helper classes)? Many thanks in advance.
>>
>> Greetings,
>> Huy
>
> Don't allow LinkPart to implement Adapter. Use an internal listener
> class instead.
>
Previous Topic:Rendering HTML text in Label...
Next Topic:Create view for semantic element
Goto Forum:
  


Current Time: Tue Apr 23 06:36:01 GMT 2024

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

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

Back to the top