Extending refactoring menu [message #1529156] |
Fri, 26 December 2014 05:03 |
Matan Shukry Messages: 1 Registered: December 2014 |
Junior Member |
|
|
I would like to extend the refactoring menu, to add an action of 'extract constructor', which will take a block of code like the following:
int value = 4;
MyClass cls = new MyClass();
cls.prop = "bla";
cls.prop2 = "hello";
cls.prop3 = value;
cls.prop4 = value;
and will be able to create a constructor from with the corresponding arguments and create the following constructor:
public MyClass(String prop, String prop2, int prop3) {
this.prop = prop;
this.prop2 = prop2;
this.prop3 = prop3;
this.prop4 = prop3;
}
I am new to developing a plugin, and extension points in general, but as far as I understand they are the way to go, since I want to extend an existing plugin (the java editor plugin? menu plugin? not sure really ..).
After the basic command (I hope), I'll also attempt to create a UI so one can change the extraction properties (access modifiers, parameter type/names, etc).
I did notice the following extension points:
org.eclipse.ltk.core.refactoring.copyParticipants
org.eclipse.ltk.core.refactoring.createParticipants
org.eclipse.ltk.core.refactoring.deleteParticipants
org.eclipse.ltk.core.refactoring.moveParticipants
org.eclipse.ltk.core.refactoring.refactoringContributions
org.eclipse.ltk.core.refactoring.renameParticipants
and even read their description, but I have no idea what it means. I was hoping one could clarify if that is the right direction to do so, and where should I go on from where to learn such a thing.
Yours,
Matan.
|
|
|
Powered by
FUDForum. Page generated in 0.02969 seconds