Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Linking classes across projects
Linking classes across projects [message #132991] Thu, 09 November 2006 03:16 Go to next message
Eclipse UserFriend
Originally posted by: elucify.gmail.com

According to the eclipse Web site, this forum is a good place to ask
questions both about ve and about plugin development. Please excuse me if
I'm posting in the wrong place.

I'm going nuts trying to get a plug-in to run.
My plugin ("ModulePlugin") uses a package that exists in another Java
project ("ModuleCore") that is not itself a plugin.

My plugin code has an import that looks something like:

import com.foo.modulecore.FileReader;

Eclipse marks that import as an error: "com.foo.modulecore is not visible".
The QuickFix is to add ModuleCore (the project) to the plugin's build path.
I select that fix and the problem disappears.

But when I run the plugin, the plugin code that uses FileReader can't find
it. I can only see the ClassNotFoundException if I run the platform in debug
mode; otherwise, I just get a console message:

Unhandled event loop exception
Reason:
com/foo/modulecore/FileReader
So supposedly, the quick fix fixes the build path, but when I run it, the
plugin can't find the code.

Also, if I use PDE Tools->Build classpath... before trying to run the
platform, the original error ("com.foo.modulecore is not visible")
reappears.

I've tried restarting Eclipse--same problem.

What am I missing here? All I want to do is share code between projects. Is
that so wrong? :{)

I'll mention that the FileReader class accesses the filesystem. I'm not sure
if I'm breaking any rules by accessing the filesystem directly. I've noticed
an IFile interface in Eclipse, and I'm wondering what it's for. Whether that
is my problem I have no idea.

Thanks to anyone who can help me with this. I'm new at developing plugins,
and it's a bit overwhelming.

--Mark Johnson

Silver Spring, MD
Re: Linking classes across projects [message #133017 is a reply to message #132991] Fri, 10 November 2006 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Your plugin needs to have its manifest require the plugin that contains
com.ff.modulecore.FileReader.

When working with plugins you almost never ever touch the actual
classpath. Instead you work through the plugins manifest. Open the
manifest editor on the MANFIEST/MANIFEST.mf file.

Also, PDE-UpdateClasspath only makes the classpath in sync with what the
manifest says. If the manifest is not correct then it won't be able to
update the classpath correctly.

The quick fix didn't realize that this was a plugin project, so it
applied a quick fix for a standard project.

As for accessing the file system directly, you would do that for files
that are not workspace files (i.e. files in a project). For files in a
project you would use IFile.

See

http://www.eclipse.org/articles/Article-Plug-in-architecture /plugin_architecture.html

what plugins are:

and see

http://www.eclipse.org/articles/Article-PDE-does-plugins/PDE -intro.html

for how to do plugin development. They are dated but the concepts are
still the same.

Also, this forum is for VE questions only. General questions like plugin
development should be asked on the eclipse.platform newsgroup
--
Thanks,
Rich Kulp
Re: Linking classes across projects [message #133030 is a reply to message #133017] Fri, 10 November 2006 17:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: elucify.gmail.com

Thanks, Rich! I'll try your suggestions. Thanks for the links, too.

The eclipse.org website lists this group as for both plugin development
and ve questions, which I thought was a little odd. I assumed .platform
was about people extending the eclipse core. But I'll post plugin
questions there from now on.

I'll probably be back as soon as I start using ve!

Thanks again

--Mark
Re: Linking classes across projects [message #133042 is a reply to message #133017] Fri, 10 November 2006 17:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: elucify.gmail.com

By the way, Rich, you said:

> Your plugin needs to have its manifest require the plugin that contains
> com.ff.modulecore.FileReader.
...

> The quick fix didn't realize that this was a plugin project, so it
> applied a quick fix for a standard project.

Does it matter that the ModuleCore project isn't a plugin project, but
just a regular Java project? Should it be a plugin project if I want other
plugins to depend on it?

Should I move this thread to .platform?

Thanks again.

-Mark
Re: Linking classes across projects [message #133055 is a reply to message #133042] Fri, 10 November 2006 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Plugins can only talk plugins and application projects can only talk to
application projects. They shouldn't be intermixed.

Mark Johnson wrote:
>
>
> By the way, Rich, you said:
>
>> Your plugin needs to have its manifest require the plugin that
>> contains com.ff.modulecore.FileReader.
> ...
>
>> The quick fix didn't realize that this was a plugin project, so it
>> applied a quick fix for a standard project.
>
> Does it matter that the ModuleCore project isn't a plugin project, but
> just a regular Java project? Should it be a plugin project if I want
> other plugins to depend on it?
>
> Should I move this thread to .platform?
>
> Thanks again.
>
> -Mark
>
>

--
Thanks,
Rich Kulp
Re: Linking classes across projects [message #133068 is a reply to message #133055] Sat, 11 November 2006 03:43 Go to previous message
Eclipse UserFriend
Originally posted by: elucify.gmail.com

Thanks, Rich--problem solved!
Re: Linking classes across projects [message #614771 is a reply to message #132991] Fri, 10 November 2006 14:56 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Your plugin needs to have its manifest require the plugin that contains
com.ff.modulecore.FileReader.

When working with plugins you almost never ever touch the actual
classpath. Instead you work through the plugins manifest. Open the
manifest editor on the MANFIEST/MANIFEST.mf file.

Also, PDE-UpdateClasspath only makes the classpath in sync with what the
manifest says. If the manifest is not correct then it won't be able to
update the classpath correctly.

The quick fix didn't realize that this was a plugin project, so it
applied a quick fix for a standard project.

As for accessing the file system directly, you would do that for files
that are not workspace files (i.e. files in a project). For files in a
project you would use IFile.

See

http://www.eclipse.org/articles/Article-Plug-in-architecture /plugin_architecture.html

what plugins are:

and see

http://www.eclipse.org/articles/Article-PDE-does-plugins/PDE -intro.html

for how to do plugin development. They are dated but the concepts are
still the same.

Also, this forum is for VE questions only. General questions like plugin
development should be asked on the eclipse.platform newsgroup
--
Thanks,
Rich Kulp
Re: Linking classes across projects [message #614772 is a reply to message #133017] Fri, 10 November 2006 17:24 Go to previous message
Mark Johnson is currently offline Mark JohnsonFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks, Rich! I'll try your suggestions. Thanks for the links, too.

The eclipse.org website lists this group as for both plugin development
and ve questions, which I thought was a little odd. I assumed .platform
was about people extending the eclipse core. But I'll post plugin
questions there from now on.

I'll probably be back as soon as I start using ve!

Thanks again

--Mark
Re: Linking classes across projects [message #614773 is a reply to message #133017] Fri, 10 November 2006 17:33 Go to previous message
Mark Johnson is currently offline Mark JohnsonFriend
Messages: 10
Registered: July 2009
Junior Member
By the way, Rich, you said:

> Your plugin needs to have its manifest require the plugin that contains
> com.ff.modulecore.FileReader.
...

> The quick fix didn't realize that this was a plugin project, so it
> applied a quick fix for a standard project.

Does it matter that the ModuleCore project isn't a plugin project, but
just a regular Java project? Should it be a plugin project if I want other
plugins to depend on it?

Should I move this thread to .platform?

Thanks again.

-Mark
Re: Linking classes across projects [message #614774 is a reply to message #133042] Fri, 10 November 2006 18:38 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Plugins can only talk plugins and application projects can only talk to
application projects. They shouldn't be intermixed.

Mark Johnson wrote:
>
>
> By the way, Rich, you said:
>
>> Your plugin needs to have its manifest require the plugin that
>> contains com.ff.modulecore.FileReader.
> ...
>
>> The quick fix didn't realize that this was a plugin project, so it
>> applied a quick fix for a standard project.
>
> Does it matter that the ModuleCore project isn't a plugin project, but
> just a regular Java project? Should it be a plugin project if I want
> other plugins to depend on it?
>
> Should I move this thread to .platform?
>
> Thanks again.
>
> -Mark
>
>

--
Thanks,
Rich Kulp
Re: Linking classes across projects [message #614775 is a reply to message #133055] Sat, 11 November 2006 03:43 Go to previous message
Mark Johnson is currently offline Mark JohnsonFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks, Rich--problem solved!
Previous Topic:getter and setter methods are private?
Next Topic:Cannot Install VE
Goto Forum:
  


Current Time: Wed Apr 24 16:15:26 GMT 2024

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

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

Back to the top