Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » CreateParticipant not called
CreateParticipant not called [message #1804796] Mon, 01 April 2019 12:19 Go to next message
Daniel Gis is currently offline Daniel GisFriend
Messages: 2
Registered: April 2019
Junior Member
Hi,

I created a CreateParticipant in my eclipse plugin using the "org.eclipse.ltk.core.refactoring.createParticipants" extention point.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.ltk.core.refactoring.createParticipants">
      <createParticipant
            class="createparticipanttest.CreateParticipant1"
            id="createParticipantTest.createParticipant1"
            name="name">
	         <enablement>
	      		<with variable="affectedNatures">
	        		<iterate operator="or">
	          		<equals value="org.eclipse.jdt.core.javanature"/>
	        		</iterate>
	      		</with>
	      		<with variable="element">
	        		<instanceof value="org.eclipse.core.resources.IFolder"/>
	      		</with>
	    	</enablement>
      </createParticipant>
   </extension>
   <extension
         point="org.eclipse.ltk.core.refactoring.deleteParticipants">
      <deleteParticipant
            class="createparticipanttest.DeleteParticipant1"
            id="createParticipantTest.deleteParticipant1"
            name="name">
	         <enablement>
	      		<with variable="affectedNatures">
	        		<iterate operator="or">
	          		<equals value="org.eclipse.jdt.core.javanature"/>
	        		</iterate>
	      		</with>
	      		<with variable="element">
	        		<instanceof value="org.eclipse.core.resources.IFolder"/>
	      		</with>
	    	</enablement>
      </deleteParticipant>
   </extension>
</plugin>


The corresponding CreateParticipant Class looks like:
package createparticipanttest;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.CreateParticipant;

public class CreateParticipant1 extends CreateParticipant {

	public CreateParticipant1() {
		// TODO Auto-generated constructor stub
	}
	
	@Override
	protected boolean initialize(Object element) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
			throws OperationCanceledException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
		// TODO Auto-generated method stub
		return null;
	}

}


If I start an eclipse debugging session with my plugin and create an Folder in an java test project, my createParticipant is not called.

If I delete the folder, the deleteParticipant is called and works as expected.

So is something wrong with my code or is the createParticipant extention point not working at all?

Regards,
Daniel


Re: CreateParticipant not called [message #1804907 is a reply to message #1804796] Wed, 03 April 2019 07:19 Go to previous message
Daniel Gis is currently offline Daniel GisFriend
Messages: 2
Registered: April 2019
Junior Member
Hi,

I attached an eclipse pde example plugin project. Maybe it will help to reproduce the problem I am facing here.

Regards,
Daniel
Previous Topic:Add reference Eclipse acute??eclipse 2018-03
Next Topic:Problem when i start
Goto Forum:
  


Current Time: Sun May 19 14:22:54 GMT 2019

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

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

Back to the top