Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » refactor ----CopyParticipant failed problem
refactor ----CopyParticipant failed problem [message #510755] Thu, 28 January 2010 14:45 Go to next message
Ping Luo is currently offline Ping LuoFriend
Messages: 8
Registered: January 2010
Location: Beijing
Junior Member
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 12:04 Go to previous messageGo to next message
Ping Luo is currently offline Ping LuoFriend
Messages: 8
Registered: January 2010
Location: Beijing
Junior Member
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 15:04 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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 11:45 Go to previous message
No real name is currently offline No real nameFriend
Messages: 3
Registered: August 2010
Junior Member
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: Fri Apr 26 12:21:25 GMT 2024

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

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

Back to the top