Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » my nature methods are never executed(nature methods never executed!!? Descriptor = null)
my nature methods are never executed [message #513390] Tue, 09 February 2010 18:17 Go to next message
NH  is currently offline NH
Messages: 14
Registered: December 2009
Junior Member
My package is in scope because I assign the variable
private variable PoitinNature.NATURE_ID , so the package is in scope, but I can't get any of the PoitinNature methods to be executed. I'm just print to the console. Any help would be appreciated. I can't find anything on it.

I have a project nature define as below

IStatus status = workspace.validateNatureSet(natures);
IProjectNatureDescriptor descriptor = workspace.getNatureDescriptor(PoitinNature.NATURE_ID);

System.out.println("--> " + descriptor); // print null???



project.create(description, monitor);
project.open(monitor);
project.setDescription(description,monitor);

section 1 - extension defined
_______________________

<extension
id="PoitinNature"
name="Poitin Nature"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="com.eclipse.poitin.nature.PoitinNature">
</run>
</runtime>
</extension>

_______________________________________
I can create a new project and assign a nature

descriptor = workspace.getNatureDescriptor(PoitinNature.NATURE_ID);

System.out.println("2--> " + descriptor);







#section 2
____________________________________________


public class PoitinNature implements IProjectNature {

public static final String NATURE_ID = "com.eclipse.poitin.nature.PoitinNature";
//private IProject project;

@Override
public void configure() throws CoreException {

}

@Override
public void deconfigure() throws CoreException {
System.out.println("we are in the deconfigure part");
}

@Override
public IProject getProject() {
System.out.println("nature: get project called");
return null;
}
@Override
public void setProject(IProject project) {
System.out.println("setproject called");
}

}
________________________


section 3
____________________

The project file created look like this..

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ccccc</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>com.eclipse.poitin.nature.PoitinNature</nature>
</natures>
</projectDescription>




Re: my nature methods are never executed [message #513488 is a reply to message #513390] Wed, 10 February 2010 06:43 Go to previous messageGo to next message
Rem Collier is currently offline Rem Collier
Messages: 6
Registered: February 2010
Junior Member
Did you follow the example solution?

It includes a menu item that is added to the context menu of a Project Node. This menu item is typically called "Toggle XXX Nature" where XXX is the name of the nature that you provided.

If you have this, try clicking on it and see if this makes your nature work
Re: my nature methods are never executed [message #513496 is a reply to message #513488] Wed, 10 February 2010 07:04 Go to previous message
NH  is currently offline NH
Messages: 14
Registered: December 2009
Junior Member
Why would this work though,, does it initialise register the nature in the workspace..

I taught adding it to org.eclipse.core.resources.natures would have registered the nature..

(Thanks for response) This is melting my head!
Previous Topic:Using JARs in Projects
Next Topic:my nature methods are never executed
Goto Forum:
  


Current Time: Thu Aug 21 18:00:52 EDT 2014

Powered by FUDForum. Page generated in 0.01560 seconds