Eclipse Monkey: extend Aptana and Eclipse functionalities using JavaScript
I’ve been using Eclipse for almost all my coding using Aptana (PHP/JS/CSS/HTML) and FDT (AS3) plugins and one feature that it’s being really useful for me is the ability to code my own scripts to do specific tasks and to be able to extend Eclipse native features when I need using JavaScript! It’s all possible because of the Eclipse Monkey plugin.
Demo
added 02/18/2010
How to install Eclipse Monkey
Eclipse Monkey comes pre-installed with Aptana, but in case you don’t have it just follow these steps:
- Go to the Eclipse plugin manager (Help -> Install New Software…)
- Type the address http://download.eclipse.org/technology/dash/update/.
- Select Eclipse Monkey from the list.
- Press “next” and “ok” until the installation ends.
- Restart Eclipse.
Using the Scripts Panel
After installing Eclipse Monkey you should see a new item called “Scripts” on the Eclipse menu and also have a new view called “Scripts” (Window -> Show View -> Other… -> Scripts) and you are ready to start scripting.
Downloading my custom scripts
I’ve created a repository with all my custom scripts on GitHub: http://github.com/millermedeiros/eclipse_monkey_scripts, fell free to fork it and share your own scripts.
Installing the scripts (added 2010/09/08)
There are two methods to install Eclipse Monkey scripts into Eclipse, my favorite one is to create an empty project and create a new folder named scripts or monkey and place all the eclipse monkey scripts inside that folder, as long as the project is opened you will be able to use the scripts. The other option is to paste scripts from the clipboard but that usually takes some extra steps and I don’t recommend using it.
If the script doesn’t show up automatically open the scripts panel and press the refresh icon, if it doesn’t work make sure you open the project explorer panel and refresh it too.
Learn more about it
- About Eclipse Monkey
- Creating a new Eclipse Monkey script
- Adding metadata to an Eclipse Monkey script
- Eclipse Monkey API Reference
Eclipse Monkey is currently archived due to lack of project commiters so it’s not easy to find more information about it, I’ve already added all good resources about it that I know, editing my scripts and the sample scripts that comes with Aptana is a good start point.
I hope it’s useful for someone, it’s saving me a lot of time (specially when I’m updating content on XML/HTML files), I will keep publishing my Eclipse Monkey scripts to github, so watch it!
That’s it!