Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Compatibility with other versions
Compatibility with other versions [message #152564] Sat, 02 October 2004 10:05 Go to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
Hi guys,

I really don't know how to upgrade my GEF plug-in in order to make it work
with Eclipse 3.0.1. The problem is:

1. My plug-in is based on the Logic Example, which works well on 2.1.3 and
on 3.0M9, but does not work on 3.0.0 or higher. I mean, the plug-in itself
does work well, but when I try to re-make the plug-in from the source code
provided, it gives me a java.lang.NoClassDefFoundError as soon as I press
"Finish" on the wizard dialog, and doesn't open any editor. My plug-in has
exactly the same behaviour.

2. The difference between 3.0M9 and 3.0.x is that in the LogicEditor the
method initializeGraphicalViewer() has a line which says

getGraphicalViewer().addDropTargetListener(...)

This line appears deprecated in the new version.

3. I don't know how, maybe because of some little differences in the code,
my editor starts peacefully on 3.0.1, but it so happens that I can't drag
my templates on the canvas, operation provided by the line quoted at point
2.

4. This is what happens on Windows. On Linux and MacOS systems the editor
starts only the first time, then when I make the run-time workbench run
again it gives me the same error as at point 1.

I looked for a solution on Google, on the Eclipse 3.0 Migration Guide, on
the examples' source code and on the API documentation, but I didn't find
anything.

Do you have any idea about how to solve this problem?
Re: Compatibility with other versions [message #152593 is a reply to message #152564] Sat, 02 October 2004 13:42 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
I think I found the problem but (as usual) I can't manage to solve it:

The method addDropTargetListener(TransferDropTargetListener listener) is
deprecated if the listener comes from org.eclipse.gef.dnd. The
non-deprecated method to use is
addDropTargetListener(TransferDropTargetListener listener) in which the
listener has the same name of the one above, but comes from a different
package: org.eclipse.jface.util. I couldn't find the difference, since
both methods and objects have the same name! <=)

So I thought that using an explicit cast would solve everything:

getGraphicalViewer().addDropTargetListener(
(org.eclipse.jface.util.TransferDropTargetListener)new ...);

In fact, the deprecation sign disappeared. But it didn't solve anything!
The symptoms are the same as before!

I'm sure the problem is here, because I tried to put under comment the
line categories.add(createTemplateComponentsDrawer()) in my plugin class
(exactly the same as the Logic Example) and to use instead
categories.add(createComponentsDrawer()), and as I expected the templates
get pasted perfectly (but of course without drag and drop). Besides, in
Eclipse 3.0M9 everything works fine with both methods, in Eclipse 3.0.1
neither of them
is useful.

Any suggestion? Thank you,

Antony
Re: Compatibility with other versions [message #152639 is a reply to message #152593] Sun, 03 October 2004 10:04 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
I apologize, maybe I didn't explain very well what I need. After all, I'm
not American, and I don't speak English very well. I will put it very
simple and general.

I'm looking for the source code of a Logic Example upgraded for Eclipse
3.0.x (which is not provided by the plug-in itself) or, if I'm asking too
much, just the reason why the actual source code doesn't work.

Or, an answer in which you say that I'm a loser, that you're not going to
do all the work for me, that my question is not pertinent in this context,
etc. Just answer me. Thanks.

Antony
Re: Compatibility with other versions [message #152740 is a reply to message #152593] Mon, 04 October 2004 19:40 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
I tried a debug: the listener is created and added to the viewer, but the
method getFactory in TransferDropTargetListener will never be invoked. I
can't really find what's going wrong...

As for the GEF Examples, they make an ExceptionInInitializerError and then
a ClassDefNotFoundError when the WizardPage1 invokes createFile. Did
someone else try to compile their source code except me?

Many thanks for have read this post, at least.
Re: Compatibility with other versions [message #152801 is a reply to message #152740] Tue, 05 October 2004 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Antony" <antonymist@hotmail.com> wrote in message
news:cjs8v4$qhu$1@eclipse.org...
> I tried a debug: the listener is created and added to the viewer, but the
> method getFactory in TransferDropTargetListener will never be invoked. I
> can't really find what's going wrong...

Are you certain a native drag has started? SWT requires the drag source and
drop target to have the same transfers in use.

> As for the GEF Examples, they make an ExceptionInInitializerError and then
> a ClassDefNotFoundError when the WizardPage1 invokes createFile. Did
> someone else try to compile their source code except me?

GEF compiles normally. I suggest you download the released versions of GEF
and the Eclipse platform: 3.0.1
Re: Compatibility with other versions [message #152859 is a reply to message #152801] Tue, 05 October 2004 19:40 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
Thank you very much for answering.

> I suggest you download the released versions of GEF
> and the Eclipse platform: 3.0.1

I'm sure I downloaded Eclipse 3.0.1 and the GEF libraries with the same
version. GEF is perfect, it's the GEF-Examples that are strange: they seem
to have lots of deprecated methods and constants (e.g. GEFConstants.UNDO,
that should be replaced with ActionFactory.UNDO.getId()), and when I try
to create a new GEF-Example file, the pression of the "finish" button
doesn't end the creation because of an ExceptionInInitializerError on the
first press, and a ClassDefNotFoundException on the subsequent ones. As I
said before, the debugger finds a NullPointerException in method
createFile().
On Eclipse 3.0M9 everything works just fine.

> Are you certain a native drag has started? SWT requires the drag source and
> drop target to have the same transfers in use.

I can't answer to your question yet, but I'll find out as soon as
possible. But, again, my plug-in is very similar to the Logic Example and
consequently it works very well on Eclipse 3.0M9 while in 3.0.1, with the
exact same code, it doesn't call any getFactory(). Is it possible that
native drags vary from one version to another?

Thanks again for helping me, next time I hope to give more details.

Antony
Re: Compatibility with other versions [message #152889 is a reply to message #152859] Tue, 05 October 2004 20:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You'll have to post the stacktrace or look up the name of what is not found.
Are you compiling the logic example? If you run the example as binary do
you see the same problem?

"Antony" <antonymist@hotmail.com> wrote in message
news:cjutc1$k66$1@eclipse.org...
> Thank you very much for answering.
>
> > I suggest you download the released versions of GEF
> > and the Eclipse platform: 3.0.1
>
> I'm sure I downloaded Eclipse 3.0.1 and the GEF libraries with the same
> version. GEF is perfect, it's the GEF-Examples that are strange: they seem
> to have lots of deprecated methods and constants (e.g. GEFConstants.UNDO,
> that should be replaced with ActionFactory.UNDO.getId()), and when I try
> to create a new GEF-Example file, the pression of the "finish" button
> doesn't end the creation because of an ExceptionInInitializerError on the
> first press, and a ClassDefNotFoundException on the subsequent ones. As I
> said before, the debugger finds a NullPointerException in method
> createFile().
> On Eclipse 3.0M9 everything works just fine.
>
> > Are you certain a native drag has started? SWT requires the drag source
and
> > drop target to have the same transfers in use.
>
> I can't answer to your question yet, but I'll find out as soon as
> possible. But, again, my plug-in is very similar to the Logic Example and
> consequently it works very well on Eclipse 3.0M9 while in 3.0.1, with the
> exact same code, it doesn't call any getFactory(). Is it possible that
> native drags vary from one version to another?
>
> Thanks again for helping me, next time I hope to give more details.
>
> Antony
>
Re: Compatibility with other versions [message #153056 is a reply to message #152889] Wed, 06 October 2004 15:25 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
> You'll have to post the stacktrace or look up the name of what is not found.
> Are you compiling the logic example? If you run the example as binary do
> you see the same problem?

The binaries work perfectly. The problem I find with the source code
doesn't have any stack trace: the Unhandled loop exception shows up inside
the console.

Anyway I'll post soon the path followed by the debugger. Thanks again.

Antony
Re: Compatibility with other versions [message #153064 is a reply to message #152889] Wed, 06 October 2004 15:25 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
> You'll have to post the stacktrace or look up the name of what is not found.
> Are you compiling the logic example? If you run the example as binary do
> you see the same problem?

The binaries work perfectly. The problem I find with the source code
doesn't have any stack trace: the Unhandled loop exception shows up inside
the console.

Anyway I'll post soon the path followed by the debugger. Thanks again.

Antony
Re: Compatibility with other versions [message #153323 is a reply to message #153056] Thu, 07 October 2004 16:55 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
The stack trace is most likely logged in the log file. You can also see it
via the Error Log view (from PDE Runtime).

Anyway, I have no idea what you're talking about here. The 3.0.1 logic
example works fine with Eclipse/GEF 3.0.1. I doubt that invoking deprecated
API is causing any problems. Also, I believe those deprecated calls were in
3.0M9 as well. Plus, quite a few things were changed between GEF 3.0M9 and
3.0.1 (you should look at the bugzillas for the complete list of changes),
most notably the flyout palette stuff. Are you using that?

"Antony" <antonymist@hotmail.com> wrote in message
news:ck12pr$e6k$1@eclipse.org...
> > You'll have to post the stacktrace or look up the name of what is not
found.
> > Are you compiling the logic example? If you run the example as binary
do
> > you see the same problem?
>
> The binaries work perfectly. The problem I find with the source code
> doesn't have any stack trace: the Unhandled loop exception shows up inside
> the console.
>
> Anyway I'll post soon the path followed by the debugger. Thanks again.
>
> Antony
>
Re: Compatibility with other versions [message #153370 is a reply to message #153323] Fri, 08 October 2004 20:10 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
First of all I want to thank you for helping me and treating me right,
really. I was really discouraged.

> Plus, quite a few things were changed between GEF 3.0M9 and
> 3.0.1 (you should look at the bugzillas for the complete list of changes),
> most notably the flyout palette stuff. Are you using that?

Oups, sorry, I didn't notice this wasn't clear! Yes, I'm using the
FlyoutPalette as in the Logic Example. If you say that the bugzilla will
solve my problems, I thank you with all my heart.

Anyway, I'll tell you the steps I followed to state that the Logic Example
doesn't work on my computer:

- Install Eclipse 3.0.1 and GEF 3.0.1.
- Install GEF-Examples 3.0.1.
- Create a new plug-in project called 'org.eclipse.gef.examples.logic'.
- Delete all sources created automatically from the 'src' folder.
- With Import -> Filesystem, copy all the files you find in the Logic
Example plug-in folder (plugin.xml etc.) and paste them inside the project
folder.
- Again with Import -> Filesystem, copy all sources found zipped in the
plug-in GEF-Examples-sources and paste them inside the 'src' folder.
- Now the plug-in is set. Run the run-time workbench and create a new
simple project.
- Create a new Logic diagram: the well known error occurs while pressing
the 'Finish' button in the wizard.

The same thing comes up with the Flow Example. Following the same steps
under Eclipse and GEF 3.0M9 instead doesn't give any problems.

Thank you again,

Antony
Re: Compatibility with other versions [message #153436 is a reply to message #153323] Sat, 09 October 2004 15:48 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
First of all I want to thank you for helping me and treating me right,
really. I was really discouraged.

> Plus, quite a few things were changed between GEF 3.0M9 and
> 3.0.1 (you should look at the bugzillas for the complete list of changes),
> most notably the flyout palette stuff. Are you using that?

Oups, sorry, I didn't notice this wasn't clear! Yes, I'm using the
FlyoutPalette as in the Logic Example. If you say that the bugzilla will
solve my problems, I thank you with all my heart.

Anyway, I'll tell you the steps I followed to state that the Logic Example
doesn't work on my computer:

- Install Eclipse 3.0.1 and GEF 3.0.1.
- Install GEF-Examples 3.0.1.
- Create a new plug-in project called 'org.eclipse.gef.examples.logic'.
- Delete all sources created automatically from the 'src' folder.
- With Import -> Filesystem, copy all the files you find in the Logic
Example plug-in folder (plugin.xml etc.) and paste them inside the project
folder.
- Again with Import -> Filesystem, copy all sources found zipped in the
plug-in GEF-Examples-sources and paste them inside the 'src' folder.
- Now the plug-in is set. Run the run-time workbench and create a new
simple project.
- Create a new Logic diagram: the well known error occurs while pressing
the 'Finish' button in the wizard.

The same thing comes up with the Flow Example. Following the same steps
under Eclipse and GEF 3.0M9 instead doesn't give any problems.

Thank you again,

Antony
Re: Compatibility with other versions [message #153445 is a reply to message #153436] Sat, 09 October 2004 16:30 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
I've read tha Bugzilla #22997.

Eric Bordeau wrote:
>org.eclipse.gef.dnd.TemplateTransferDragSourceListener should be used in the
>palette to initiate the TemplateTransfers (which cache the template during
>the DND process). Add this listener to the palette via
>initializePaletteViewer()

This seems to be the new stuff: if I understood well, I shall create my
own TemplateTransferDragSourceListener, because the one provided
implicitly doesn't work anymore. Am I right?
Re: Compatibility with other versions [message #153629 is a reply to message #153370] Mon, 11 October 2004 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> - With Import -> Filesystem, copy all the files you find in the Logic
> Example plug-in folder (plugin.xml etc.) and paste them inside the project
> folder.
> - Again with Import -> Filesystem, copy all sources found zipped in the
> plug-in GEF-Examples-sources and paste them inside the 'src' folder.

This is the wrong way to import the Logic example. Please learn how to use
the Plugin Development Environment (PDE).
Re: Compatibility with other versions [message #154334 is a reply to message #153629] Sat, 16 October 2004 18:36 Go to previous messageGo to next message
Antony is currently offline AntonyFriend
Messages: 34
Registered: July 2009
Member
> This is the wrong way to import the Logic example. Please learn how to use
> the Plugin Development Environment (PDE).

I'm sorry, I don't know how to explain myself better than this. Please try
a further effort to understand my bad English.

Of course the steps I wrote are NOT the right way to import a plug-in. I
know how to use PDE, I've already exported my own working plug-in with it,
and I'm satisfied on 3.0M9. I am talking about something else: it seems
that, while the GEF Examples' binaries work on both versions (3.0.1 and
3.0M9, and I'm sure I'm using the right Eclipse, the right GEF and the
right Examples), the source code of the GEF Examples 3.0.1 does not work
on their own platform (Eclipse 3.0.1 and GEF 3.0.1, and again I'm sure I'm
using the right ones).

In fact, following the steps I wrote and running the run-time workbench
just to test the source code, the logic example works just fine on 3.0M9
(and so my plug-in) but gives the famous exception in 3.0.1 (my plug-in
doesn't because I implemented a different wizard. I've got different
problems with it, as you know). But it's not over, yet: the source code of
the GEF Examples 3.0.1 is exactly the same of the 3.0M9 Examples, I looked
at every single class. And, by chance, it works just fine on Eclipse and
GEF 3.0M9 but not on 3.0.1.

So it seems that the binaries (which work) and the source code (which do
not)of the GEF Examples 3.0.1 do not match. I can't find any other cause
for this strange behaviour. Or else, after 7 months of plug-in developing
with Eclipse, I didn't understand anything yet.
Re: Compatibility with other versions [message #154429 is a reply to message #154334] Mon, 18 October 2004 17:06 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

When you switch between 3.0M9 and 3.0.1, are you switching the IDE you are
using, or are you changing the PDE runtime target platform? You need to the
second one.

Please delete 3.0M9 completely from your system and try get GEF to work
before asking more questions. There is absolutely no reason to have 3.0M9
installed at this point.
Previous Topic:property sheet and mulitpage editor.
Next Topic:Creating Eclipse projects from the example sources
Goto Forum:
  


Current Time: Sat Apr 20 01:48:15 GMT 2024

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

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

Back to the top