Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Extending refactoring menu(Extract Constructor)
Extending refactoring menu [message #1529156] Fri, 26 December 2014 05:03
Matan Shukry is currently offline Matan ShukryFriend
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.
Previous Topic:Linking folders/files to LISP Project in Dandelion LISP
Next Topic:Redirect ProcessBuilder output to Eclipse Console
Goto Forum:
  


Current Time: Fri Mar 29 02:13:36 GMT 2024

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

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

Back to the top