Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Access Eclipsse Refactoring API
Access Eclipsse Refactoring API [message #1818267] Wed, 11 December 2019 08:26 Go to next message
Daniel Manresa is currently offline Daniel ManresaFriend
Messages: 1
Registered: December 2019
Junior Member
Hi.

I am a newbie programmer on the Eclipse Universe.

I am doing some tests with the JDT and the ASTNodes manipulation on a Eclipse Plugin, and I need some help.

I want to call the Eclipse Refactor plugin API from my plugin, but I cannot find any suitable documentation about this plugin or his API,


private ICompilationUnit compUnit;

@Override
public boolean visit(MethodDeclaration node) {
	RefactoringContribution contribution = RefactoringCore.getRefactoringContribution(IJavaRefactorings.CHANGE_METHOD_SIGNATURE);
	
	ChangeMethodSignatureDescriptor descriptor = (ChangeMethodSignatureDescriptor)contribution.createDescriptor();
	descriptor.setProject(this.compUnit.getResource().getProject().getName());
	
	Map<String, String> argumentsMap = contribution.retrieveArgumentMap(descriptor);
}


I have the above code, but I have no Idea of how I can continue. I want to delete one of the parameters of the MethodDeclaration variable, and apply the change to my entire project, just like the Eclipse Refactoring Plugin do.

Can anyone help me or give me some tips?
Re: Access Eclipsse Refactoring API [message #1818357 is a reply to message #1818267] Fri, 13 December 2019 10:16 Go to previous message
Kalyan Prasad Tatavarthi is currently offline Kalyan Prasad TatavarthiFriend
Messages: 2
Registered: December 2019
Junior Member
Please look at code https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.core.manipulation/core%20extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFixCore.java removeUnusedName method

Based on this, using ASTRewrite, you can build your code to delete a parameter.
Previous Topic:Font text on iMac
Next Topic:how to configure access rules for ecj when run by maven?
Goto Forum:
  


Current Time: Sat Oct 31 08:18:34 GMT 2020

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

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

Back to the top