Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » my nature methods are never executed
my nature methods are never executed [message #604562] Tue, 09 February 2010 23:17 Go to next message
NH  is currently offline NH Friend
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 #604571 is a reply to message #604562] Wed, 10 February 2010 11:43 Go to previous messageGo to next message
Rem Collier is currently offline Rem CollierFriend
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 #604575 is a reply to message #604571] Wed, 10 February 2010 12:04 Go to previous message
NH  is currently offline NH Friend
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:my nature methods are never executed
Next Topic:Programmatically add an extension to a plug-in
Goto Forum:
  


Current Time: Thu Mar 28 16:58:09 GMT 2024

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

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

Back to the top