Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » refactor ----CopyParticipant failed problem
refactor ----CopyParticipant failed problem [message #510755] Thu, 28 January 2010 09:45 Go to next message
Eclipse UserFriend
I have a class extends org.eclipse.ltk.core.refactoring.participants.CopyParticipan t class.
so there will be three method in my class. they are :
protected boolean initialize(Object element) {}
public RefactoringStatus checkConditions(IProgressMonitor pm,CheckConditionsContext context){}
public Change createChange(IProgressMonitor pm){}

Everything seems Ok if I copy a file to another folder, that means my own code in three methods above can be executed.

the problem is that my code can't be executed if I want to copy and paste a file to the same folder. in this case, there will be a Name conflict dialog which we need to input a new file name, then the paste action will finish without entering my CopyParticipant, even the initialize method in my class is skipping, this is very confused.

the eclipse version is 3.2.2.
Any one can give me some comment about this?

thanks,
ping
Re: refactor ----CopyParticipant failed problem [message #510973 is a reply to message #510755] Fri, 29 January 2010 07:04 Go to previous messageGo to next message
Eclipse UserFriend
is it a eclipse bug? any other methods I need to implement?
I need your help, thanks.
Re: refactor ----CopyParticipant failed problem [message #511419 is a reply to message #510973] Mon, 01 February 2010 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Ping Luo wrote:
> is it a eclipse bug? any other methods I need to implement? I need
> your help, thanks.
Hard to say. There's just too little information in your post. The best
thing you can do is to file a bug report against JDT UI with your full code.

Dani
icon10.gif  Re: refactor ----CopyParticipant failed problem [message #630611 is a reply to message #510755] Mon, 04 October 2010 07:45 Go to previous message
Eclipse UserFriend
The Problem is, that you have to create a Change in your createChange() Method and not using the method for the refactoring itself. You also have to check all possible failures in your checkConditions() method.

When you return the Change Eclipse will then do the refactoring with its own code and then call your changes perform() method.

What I didn't find out was that when the filename changes, how you get the new filename from the dialog......
Previous Topic:Help please: attaching javadoc html address working in Windows but not Linux
Next Topic:Using the Search Engine to find an anonymous class
Goto Forum:
  


Current Time: Sat Jul 05 08:57:58 EDT 2025

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

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

Back to the top