Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Odd error
Odd error [message #240234] Mon, 10 December 2007 16:17 Go to next message
Eclipse UserFriend
Originally posted by: Jim.Cooper.sas.com

Using Eclipse 3.1.2, with the latest GEF that was available for that.

This line out of the org.eclipse.gef.examples.flow FlowEditor.java:

getGraphicalViewer().addDropTargetListener(new
TemplateTransferDropTargetListener(getGraphicalViewer()));

Is giving me this error:

Cannot instantiate the type TemplateTransferDropTargetListener

Any clues on where to start looking for the problem?
Re: Odd error [message #240260 is a reply to message #240234] Tue, 11 December 2007 22:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sebukoleth.gmail.com

Jim Cooper wrote:
> Using Eclipse 3.1.2, with the latest GEF that was available for that.
>
> This line out of the org.eclipse.gef.examples.flow FlowEditor.java:
>
> getGraphicalViewer().addDropTargetListener(new
> TemplateTransferDropTargetListener(getGraphicalViewer()));
>
> Is giving me this error:
>
> Cannot instantiate the type TemplateTransferDropTargetListener
>
> Any clues on where to start looking for the problem?

It is an abstract class. Look at its Java doc. "This class is abstract.
Subclasses are responsible for providing the appropriate Factory object
based on the template that is being dragged."

cheers,
Sebu
Re: Odd error [message #240270 is a reply to message #240260] Wed, 12 December 2007 19:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Jim.Cooper.sas.com

Sebu T. Koleth wrote:
> Jim Cooper wrote:
>> Using Eclipse 3.1.2, with the latest GEF that was available for that.
>>
>> This line out of the org.eclipse.gef.examples.flow FlowEditor.java:
>>
>> getGraphicalViewer().addDropTargetListener(new
>> TemplateTransferDropTargetListener(getGraphicalViewer()));
>>
>> Is giving me this error:
>>
>> Cannot instantiate the type TemplateTransferDropTargetListener
>>
>> Any clues on where to start looking for the problem?
>
> It is an abstract class. Look at its Java doc. "This class is abstract.
> Subclasses are responsible for providing the appropriate Factory object
> based on the template that is being dragged."
>
> cheers,
> Sebu

So that's why nearly every example "out there" has this exact line of
code, INCLUDING the official org.eclipse.gef.examples.flow code?

Believe it or not, I actually did look at the fact that it's an abstract
class.

Why is it that everyone else in the world seems to be able to use the
code as-is, but I get a compile error?
Re: Odd error [message #240292 is a reply to message #240270] Sat, 15 December 2007 16:32 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Though JavaDocs say so, TemplateTransferDropTargetListener is not an abstract class and you can create instances of it (At least in the 3.2.1 version, which I have) May be initially its an Abstract class and then later it was changed to a concrete class. The examples you have may be from a newer version and your GEF plugin might be an older version.

- Prakash
Re: Odd error [message #240311 is a reply to message #240292] Mon, 17 December 2007 22:12 Go to previous message
Eclipse UserFriend
Originally posted by: Jim.Cooper.sas.com

That's actually the conclusion I've come to. Some sort of mis-match
between what I'm trying to work with, and what's out on the web.

I need to track down an earlier version of the examples, and see how it
was handled there.

Prakash wrote:
> Though JavaDocs say so, TemplateTransferDropTargetListener is not an abstract class and you can create instances of it (At least in the 3.2.1 version, which I have) May be initially its an Abstract class and then later it was changed to a concrete class. The examples you have may be from a newer version and your GEF plugin might be an older version.
>
> - Prakash
Previous Topic:I have error after importing package org.eclipse.draw2D
Next Topic:GEF Junit Testing
Goto Forum:
  


Current Time: Fri Apr 26 13:25:19 GMT 2024

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

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

Back to the top