Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » project nature
project nature [message #28750] Thu, 08 May 2003 04:23 Go to next message
Eclipse UserFriend
Originally posted by: bhavnad.noida.hcltech.com

hi,
i've created a plugin with a builder extension & a nature to associate
that builder to a project. when a run it as workbench, the plugin registry
shows my plugin but the error log shows the following error:


Error Thu May 08 13:51:21 IST 2003 Plug-in
"org.eclipse.examples.helloworld" was unable to instantiate class
"org.eclipse.examples.helloworld.MyNature".
java.lang.NoSuchMethodException
at java.lang.Class.getConstructor0(Class.java:1755)
at java.lang.Class.getConstructor(Class.java:990)
at
org.eclipse.core.internal.plugins.PluginDescriptor.internalD oPluginActivation(PluginDescriptor.java:701)
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:188)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:301)
at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1325 )
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:889)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1334 )
at java.lang.Thread.run(Thread.java:536)


Is any specific constructor requirde for the class implementing
IProjectNature?
Re: project nature [message #28795 is a reply to message #28750] Thu, 08 May 2003 10:26 Go to previous messageGo to next message
Eclipse UserFriend
exquisitus wrote:
> hi,
> i've created a plugin with a builder extension & a nature to associate
> that builder to a project. when a run it as workbench, the plugin registry
> shows my plugin but the error log shows the following error:
>
>
> Error Thu May 08 13:51:21 IST 2003 Plug-in
> "org.eclipse.examples.helloworld" was unable to instantiate class
> "org.eclipse.examples.helloworld.MyNature".
> java.lang.NoSuchMethodException
> at java.lang.Class.getConstructor0(Class.java:1755)
> at java.lang.Class.getConstructor(Class.java:990)
> at
> org.eclipse.core.internal.plugins.PluginDescriptor.internalD oPluginActivation(PluginDescriptor.java:701)
> at
> org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:188)
> at
> org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:301)
> at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1325 )
> at
> org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:889)
> at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1334 )
> at java.lang.Thread.run(Thread.java:536)
>
>
> Is any specific constructor requirde for the class implementing
> IProjectNature?
>
>
>
At this line it is trying to instantiate your PluginClass, not your
PluginNature. So you specified your nature in the wrong place.

--
Thanks, Rich Kulp

Re: project nature [message #29629 is a reply to message #28795] Fri, 09 May 2003 05:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhavnad.noida.hcltech.com

Richard L. Kulp wrote:

> exquisitus wrote:
> > hi,
> > i've created a plugin with a builder extension & a nature to associate
> > that builder to a project. when a run it as workbench, the plugin registry
> > shows my plugin but the error log shows the following error:
> >
> >
> > Error Thu May 08 13:51:21 IST 2003 Plug-in
> > "org.eclipse.examples.helloworld" was unable to instantiate class
> > "org.eclipse.examples.helloworld.MyNature".
> > java.lang.NoSuchMethodException
> > at java.lang.Class.getConstructor0(Class.java:1755)
> > at java.lang.Class.getConstructor(Class.java:990)
> > at
> >
org.eclipse.core.internal.plugins.PluginDescriptor.internalD oPluginActivation(PluginDescriptor.java:701)
> > at
> >
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:188)
> > at
> >
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:301)
> > at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1325 )
> > at
> >
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:889)
> > at org.eclipse.core.runtime.Platform.run(Platform.java:413)
> > at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1334 )
> > at java.lang.Thread.run(Thread.java:536)
> >
> >
> > Is any specific constructor requirde for the class implementing
> > IProjectNature?
> >
> >
> >
> At this line it is trying to instantiate your PluginClass, not your
> PluginNature. So you specified your nature in the wrong place.

> --
> Thanks, Rich Kulp
> 


Thanks, u were rite. i wrote another class which extends
org.eclipse.ui.plugin.AbstractUIPlugin to instantiate the plugin but now
the error message i get is: java.lang.ClassCastException.

if i dont write my own plugin class & let the workbench create a default
plugin then also the same exception occurs on the DefaultPlugin.
what cld be the problem?
Re: project nature [message #29654 is a reply to message #29629] Fri, 09 May 2003 10:12 Go to previous messageGo to next message
Eclipse UserFriend
In your plugin.xml, in the following section, for which this is an example:

<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="com.ibm.etools.beaninfo"
name="IBM Beaninfo (Introspection) Support"
version="5.1.0"
class="com.ibm.etools.beaninfo.adapters.BeaninfoPlugin">

Did you remove the class="..."? If you did, then it should be
instantiating default Plugin class (not AbstractUIPlugin, but just plain
Plugin). Please post the ClassCastException trace.
Re: project nature [message #29877 is a reply to message #29654] Tue, 13 May 2003 02:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhavnad.noida.hcltech.com

thanx, finally got the plugin working.
is there any way to access the member files/folders of a resource(project)?

Richard L. Kulp wrote:

> In your plugin.xml, in the following section, for which this is an example:

> <?xml version="1.0" encoding="UTF-8"?>
> <plugin
> id="com.ibm.etools.beaninfo"
> name="IBM Beaninfo (Introspection) Support"
> version="5.1.0"
> class="com.ibm.etools.beaninfo.adapters.BeaninfoPlugin">

> Did you remove the class="..."? If you did, then it should be
> instantiating default Plugin class (not AbstractUIPlugin, but just plain
> Plugin). Please post the ClassCastException trace.
Re: project nature [message #29937 is a reply to message #29877] Tue, 13 May 2003 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Opps, I was thinking IJavaElement.

For IProject and IFolder, it is members().

Rich
Re: project nature [message #31009 is a reply to message #29937] Wed, 14 May 2003 07:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhavnad.noida.hcltech.com

thanx it worked.
now i want to create my own kind of project by implementing the IProject
interface but the eclipse documentation suggests that it is not meant to
be implemented by users. is it possible to implement it or is there any
other way to create my own project class.


Richard L. Kulp wrote:

> Opps, I was thinking IJavaElement.

> For IProject and IFolder, it is members().

> Rich
Re: project nature [message #31344 is a reply to message #31009] Wed, 14 May 2003 10:44 Go to previous messageGo to next message
Eclipse UserFriend
It is not intended to be done. If you want extended behavior for a
project, you use project natures to provide that behavior, among other
extensions that are also available for projects. Maybe some of those
other extension points can be used to provide what you want.

Rich Kulp
Re: project nature [message #33007 is a reply to message #31344] Thu, 15 May 2003 03:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhavnad.noida.hcltech.com

I want to add a nature to any project that is created that is, presently
in my plugin, i'm adding a nature to the project description of a
particular project(project name is hard coded in teh code) but i want to
take this project name at the time the nature is being added from my
wizard. is it possible to obtain the name of the selected project?



Richard L. Kulp wrote:

> It is not intended to be done. If you want extended behavior for a
> project, you use project natures to provide that behavior, among other
> extensions that are also available for projects. Maybe some of those
> other extension points can be used to provide what you want.

> Rich Kulp
Re: project nature [message #33543 is a reply to message #33007] Thu, 15 May 2003 12:49 Go to previous message
Eclipse UserFriend
If it is a standard new wizard, i.e. defined in:
<extension
point="org.eclipse.ui.newWizards">

Then the init method is sent an IStructuredSelection which
has what was selected (if the active part had a valid selection in it,
as determined by the <selection> element of your extention in your
plugin.xml.

Typically your <selection> should be for

<selection
class="org.eclipse.core.resources.IResource">
</selection>


Then the IStructuredSelection will contain the resources that were
selected. You can ask an IResource for the project that the resource
belongs too.

Remember more than one resource from more than one project may be
selected at the same time, so you need to decide how you handle that
condition.

Then again, nothing compatible may be selected, and you need to handle
that case too.

Rich
Previous Topic:IAdaptable / IResource
Next Topic:Custom projects
Goto Forum:
  


Current Time: Fri Oct 10 16:15:41 EDT 2025

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

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

Back to the top