Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Move Java Resource API eclipse refactoring(MoveResourcesDescriptor)
Move Java Resource API eclipse refactoring [message #830561] Tue, 27 March 2012 20:02 Go to next message
Michele Tufano is currently offline Michele TufanoFriend
Messages: 4
Registered: March 2012
Junior Member
I'm developing an eclipse plug-in.

I have to move a class from its package to another package, I would like to use the "move class" functionality built-in eclipse.

I use MoveResourceDescriptor in this way:

MoveResourcesDescriptor descriptor = new MoveResourcesDescriptor();
descriptor.setUpdateReferences(true);
descriptor.setDestination(container);
descriptor.setResourcesToMove(resources);
descriptor.setResourcePathsToMove(pathResource);
descriptor.setDestinationPath(pathDestination);

Refactoring refactoring = descriptor.createRefactoring(new RefactoringStatus());
refactoring.checkAllConditions(pm);
Change change = refactoring.createChange(pm);
change.perform(pm);


This code move resource, but not update references!! Why? I set true in setUpdateReferences()
Re: Move Java Resource API eclipse refactoring [message #831118 is a reply to message #830561] Wed, 28 March 2012 13:46 Go to previous message
Michele Tufano is currently offline Michele TufanoFriend
Messages: 4
Registered: March 2012
Junior Member
I can also use other classes instead of MoveResourceDescriptor!

Can someone help me to inoke eclipse's move class into the code?
Previous Topic:Eclipse's rename refactoring in code
Next Topic:How to improve the performance of code generation using JDT
Goto Forum:
  


Current Time: Sat Dec 20 17:29:31 GMT 2014

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

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