A conflict between AbstractConnectionEditPart and Adapter [message #556215] |
Tue, 31 August 2010 11:39 |
Eclipse User |
|
|
|
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 #556255 is a reply to message #556242] |
Tue, 31 August 2010 13:24 |
Eclipse User |
|
|
|
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03001 seconds