Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » CopyParticipant how to get new filename(CopyParticipant how to get new filename)
CopyParticipant how to get new filename [message #630821] Tue, 05 October 2010 07:53 Go to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: August 2010
Junior Member
Hi there

I'm trying to implement a CopyParticipant to do some refactoring in the file after the file has been copied. If I copy it into the same folder a dialog is appearing telling me there is a naming conflict and I should choose a new filename.

After that eclipse does the copy into the new file and calls my Change. But in the arguments i still have the old name of the file.
I tried also to get the new filename with a resourceChangeListener but the event is fired after my change has been executed.

Does anyone know how to get the new filename entered in the dialog ?

regards
Michael
Re: CopyParticipant how to get new filename [message #1376545 is a reply to message #630821] Fri, 23 May 2014 13:10 Go to previous message
Dennis Stampfer is currently offline Dennis StampferFriend
Messages: 23
Registered: April 2013
Junior Member
old post, but came accros this just today in a renameparticipant. hope that helps anyone.

	public RefactoringStatus checkConditions(IProgressMonitor pm,
			CheckConditionsContext context) throws OperationCanceledException {
		ResourceChangeChecker checker = (ResourceChangeChecker) context
				.getChecker(ResourceChangeChecker.class);
		IResourceChangeDescriptionFactory deltaFactory = checker
				.getDeltaFactory();
		IResourceDelta[] affectedChildren = deltaFactory.getDelta()
				.getAffectedChildren();
		
		for (IResourceDelta resourceDelta : affectedChildren) {
			if(resourceDelta.getMovedFromPath() != null)
				System.out.println("from: " + resourceDelta.getResource().getProject().getName());
			
			if(resourceDelta.getMovedToPath() != null)
				System.out.println("to: " + resourceDelta.getResource().getProject().getName());
			
		}
		
		return new RefactoringStatus(); // ok
	}
Previous Topic:Eclipse (ADT) issues with Capabilities.canWatchField*
Next Topic:Android Plug In for Helios
Goto Forum:
  


Current Time: Wed Dec 11 16:57:57 GMT 2024

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

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

Back to the top