<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Next Door Hacker &#187; scripting</title>
	<atom:link href="http://www.nextdoorhacker.com/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nextdoorhacker.com</link>
	<description>I&#039;m just your friendly neighborhood hacker</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>EclipseMonkey hacking</title>
		<link>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/</link>
		<comments>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/#comments</comments>
		<pubDate>Sun, 03 May 2009 07:10:40 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[eclipsemonkey]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=95</guid>
		<description><![CDATA[I&#8217;d been wanting to do some programming with eclipse itself. However, writing a full blown plugin for something rather simple is not exactly fun. Then I discovered Eclipse Monkey a few days back. I decided to give it a run when I came across a simple problem of commenting a specific method in my code. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d been wanting to do some programming with eclipse itself. However, writing a full blown plugin for something rather simple is not exactly fun. Then I discovered Eclipse Monkey a few days back. I decided to give it a run when I came across a simple problem of commenting a specific method in my code. Yes, this is very useless but a good start IMO. <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So, here&#8217;s my first experience with Eclipse Monkey:<br />
This example just comments lines with stall function. Yeah kinda lame, but okay for a first shot IMO<br />
In the meantime, checkout <a href="https://github.com/prasincs/eclipsemonkey-scripts/tree ">https://github.com/prasincs/eclipsemonkey-scripts/tree </a></p>
<p>where I&#8217;ll be posting more of these eclipsemonkey scripts</p>
<pre class="brush: js;">
/*
* Menu: Editors &gt; Comment Stalls
* Kudos: Prasanna Gautam
* License: EPL 1.0
* DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript
* OnLoad: main()
*/
var comment = &quot;//&quot;;
function main(){
var sourceEditor = editors.activeEditor;

var valid = true;

// make sure we have an editor
if (sourceEditor === undefined) {
valid = false;
showError(&quot;No active editor&quot;);
}

if (valid){
var newSource = &quot;&quot;;
var source = sourceEditor.source;
var parts = source.split('\n');
for (var i = 0; i&lt; parts.length; i++){
if(match=parts[i].match(/^((?:\s+)?stall.+)/)){
newSource +=&quot;// &quot;;
}
newSource += parts[i] +&quot;\n&quot;;
}
sourceEditor.applyEdit(0,source.length, newSource);
}
}
</pre>
<p>For more info on Eclipse Monkey, visit:<br />
http://aptana.com/monkey/</p>
<p><strong>Update:</strong></p>
<p>Sorry for posting code from wrong file (one of the example ones)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2009/05/eclipsemonkey-hacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
