Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Code manipulation
Code manipulation [message #911572] Tue, 11 September 2012 22:10 Go to next message
Zvonimir Pavlinovic is currently offline Zvonimir Pavlinovic
Messages: 10
Registered: June 2012
Junior Member
Hi,

I am an absolute newbie to Eclipse Plug-in development, so I would just like to ask for guidance. There are a lot of tutorials, but they all seem to contain a lot of information in which I get lost quite easily. My task is to make a plugin that will manipulate user's Java code; add it, change it, give him suggestions, etc.

So,
1) What type of plugin do I need to implement?
2) How do I get users editor and code inside it?
3) Is it possible to hook up to ctrl+space shortcut and add some entries to the menu that pops up?

Is all of this possible?

I am just asking for directions, so I hope you'll have understanding. Smile
Re: Code manipulation [message #912532 is a reply to message #911572] Thu, 13 September 2012 18:12 Go to previous messageGo to next message
Curtis Windatt is currently offline Curtis Windatt
Messages: 166
Registered: July 2009
Senior Member
1) What type of plugin do I need to implement?

You would be developing an Eclipse plug-in. Eclipse plug-ins are OSGi bundles (information stored in the manifest.mf) with additional Eclipse specific settings added (specifically extensions which are stored inside plugin.xml). The PDE tool makes it easy to get started here, you can follow a tutorial, a cheatsheet or just try it out yourself (File > New > Plug-in Project.

2) How do I get users editor and code inside it?

Java Development Tools (JDT) provides APIs to interact with java classes and source. There are also many APIs to extend the editor. Try exploring their APIs, as they are well documented.

3) Is it possible to hook up to ctrl+space shortcut and add some entries to the menu that pops up?

I believe JDT has APIs to add additional options for code assist. You can also add code templates (ex. syso > System.out). For non-JDT editors you will have to write a builder that inspects the resources and creates problem markers.

Good luck,
Re: Code manipulation [message #913199 is a reply to message #912532] Sat, 15 September 2012 00:44 Go to previous message
Zvonimir Pavlinovic is currently offline Zvonimir Pavlinovic
Messages: 10
Registered: June 2012
Junior Member
Thank you Curtis.

I've managed to make it work. Smile

Basically, I needed a plugin with a view for my results and with additional JavaComletionProposalComputer extension point handler.
Previous Topic:Headless PDE vs non-headless differs
Next Topic:projectNatureImages and project refresh
Goto Forum:
  


Current Time: Sat Oct 25 12:16:49 GMT 2014

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

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