<?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>P0L0&#039;s Blog &#187; perl</title>
	<atom:link href="http://p0l0.binware.org/index.php/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://p0l0.binware.org</link>
	<description>Opensource Projects and IT experiences</description>
	<lastBuildDate>Sun, 30 Oct 2011 08:39:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Eclipse Configuration for Web Development</title>
		<link>http://p0l0.binware.org/index.php/2009/07/28/eclipse-configuration-for-web-development/</link>
		<comments>http://p0l0.binware.org/index.php/2009/07/28/eclipse-configuration-for-web-development/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 19:11:17 +0000</pubDate>
		<dc:creator>P0L0</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[aptana]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[epic]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[subversive]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnkit]]></category>

		<guid isPermaLink="false">http://p0l0.binware.org/?p=326</guid>
		<description><![CDATA[After trying very different IDE and many Eclipse IDE flawors, this is the best configuration I have found, and all the components are free. First of all we need to download Eclipse Classic from the Eclipse website. One of the first things we need to do is to change eclipse.ini, we will make it start [...]]]></description>
			<content:encoded><![CDATA[<p>After trying very different IDE and many Eclipse IDE flawors, this is the best configuration I have found, and all the components are free.</p>
<p>First of all we need to download <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse Classic</a> from the Eclipse website.</p>
<p>One of the first things we need to do is to change eclipse.ini, we will make it start faster and increase the memory limit</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">--launcher.XXMaxPermSize
256m
-vm
/usr/bin/java
-vmargs
-Xms40m
-Xmx1024m</pre></td></tr></table></div>

<p>The path to Java VM depends on your installation and system, in windows you must search for &#8220;javaw.exe&#8221;. Setting the path to Java VM makes that Eclipse stops searching for the Java VM every start, which makes the start faster.</p>
<p>Now we can start installing the required Plugins. In &#8220;Help->Install New Software&#8230;&#8221; we will add the following Update Sites.</p>
<ul>
<li>Aptana &#8211; http://update15.aptana.org/studio/25914/
<p style="text-align: center"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-install-300x94.png" alt="Aptana Install" title="Aptana Install" width="300" height="94" class="alignnone size-medium wp-image-339" /></a></p>
</li>
<li>Mylyn &#8211; http://download.eclipse.org/tools/mylyn/update/e3.4
<p style="text-align: center"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-mylyn-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-mylyn-install-300x161.png" alt="Mylyn Install" title="Mylyn Install" width="300" height="161" class="alignnone size-medium wp-image-366" /></a></p>
</li>
<li>Mylyn Extras &#8211; http://download.eclipse.org/tools/mylyn/update/extras
<p style="text-align: center"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-mylyn_extras-install1.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-mylyn_extras-install1-300x95.png" alt="Mylyn Extra Install" title="Mylyn Extra Install" width="300" height="95" class="alignnone size-medium wp-image-368" /></a></p>
</li>
<li>SVNKit &#8211; http://community.polarion.com/projects/subversive/download/eclipse/2.0/galileo-site/
<p style="text-align:center"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-svnkit-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-svnkit-install-300x131.png" alt="SVNKit Install" title="SVNKit Install" width="300" height="131" class="alignnone size-medium wp-image-370" /></a></p>
</li>
<li>EPIC (Perl) &#8211; http://e-p-i-c.sourceforge.net/updates/testing <em>optional, only if you need Perl</em>
<p style="text-align:center;"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-epic-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-epic-install-300x78.png" alt="EPIC Install" title="EPIC Install" width="300" height="78" class="alignnone size-medium wp-image-372" /></a></p>
</li>
</ul>
<p>You have noticed that at each start a Window Asking for Installing Addiontal Features. Now that we can start installing this features. For me the most important are:</p>
<ul>
<li>Aptana PHP
<p style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-php-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-php-install-300x153.png" alt="Aptana PHP Install" title="Aptana PHP Install" width="300" height="153" class="alignnone size-medium wp-image-373" /></a></p>
</li>
<li>Aptana PyDev <em>optional, only if you need Python</em>
<p style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-pydev-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-pydev-install-300x192.png" alt="Aptana PyDev Install" title="Aptana PyDev Install" width="300" height="192" class="alignnone size-medium wp-image-374" /></a></p>
</li>
<li>Ajax Libraries <em>You can select all or just the one you need</em>
<p style="text-align: center;"><a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-ajax-libraries-install.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-aptana-ajax-libraries-install-300x296.png" alt="Aptana Ajax Libraries Install" title="Aptana Ajax Libraries Install" width="300" height="296" class="alignnone size-medium wp-image-375" /></a></p>
</li>
</ul>
<p>After installing all needed plugins we can start with the configuration.</p>
<ol>
<li>General\Workspace
<ul>
<li>Text file encoding -> UTF-8</li>
<li>New text file line delimiter -> Unix</li>
</ul>
</li>
<li>General\Editors\Text Editors
<ul>
<li>Displayed tab width -> 4</li>
<li>Insert spaces for tabs -> True</li>
<li>Show line number -> True</li>
<li>Show print margin -> True</li>
<li>Print margin column -> 80</li>
</ul>
</li>
<li>General\Keys
<ul>
<li>Show Whitespace Characters (Text Editing) -> Binding: Ctrl+Alt+Space -> When: Editing Text</li>
</ul>
</li>
<li>
Aptana\Editors</p>
<ul>
<li>Formattings -> Insert selected proposal with &#8216;Tab&#8217; key as well as &#8216;Enter&#8217; key -> True</li>
<li>Tab Insertion -> Use spaces (current width is 4)</li>
</ul>
</li>
<li>Aptana\Editors\PHP
<ul>
<li>Create project file in new PHP project -> False</li>
</ul>
</li>
<li>Aptana\Editors\PHP\Formatting
<ul>
<li>Edit&#8230; -></p>
<ul>
<li>Profile Name -> ZendStandards</li>
<li>Control Statemets ->
<ul>
<li>Insert new line before &#8216;else&#8217; in an &#8216;if&#8217; statement -> False</li>
<li>Insert new line before &#8216;catch&#8217; in an &#8216;try&#8217; statement -> False</li>
<li>Insert new line before &#8216;while&#8217; in an &#8216;do&#8217; statement -> False</li>
<li>&#8216;if else&#8217; &#8211; Keep &#8216;then&#8217; statement on same line -> False</li>
</ul>
</li>
<li>Braces ->
<ul>
<li>Method declaration -> Next line</li>
<li>Blocks -> Same line</li>
<li>Blocks in case statement -> Same line</li>
<li>&#8216;switch&#8217; statement -> Same line</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>Install/Update\Automatic Updates
<ul>
<li>Automatically find new updates and notify me -> True</li>
</ul>
</li>
<li>Team\SVN &#8211; SVN Client
<ul>
<li>SVN Client -> SVN Kit</li>
<li>SVN Client -> Use SVN Merge View -> True</li>
</ul>
</li>
<li>Team\SVN\Automatic Properties
<ul>
<li>Add: * -> svn:keywords=Id</li>
</ul>
</li>
</ol>
<p>I use the Aptana Perspective with this views:</p>
<ul>
<li>Right Top
<ul>
<li>Aptana Standard Views\Project</li>
</ul>
</li>
<li>Right Bottom
<ul>
<li>General\Outline</li>
<li>Aptana Standard Views\PHP Elements Views</li>
<li>Aptana Standard Views\References</li>
</ul>
</li>
<li>Bottom
<ul>
<li>General\Tasks</li>
<li>Aptana Standard Views\Validation</li>
<li>General\Console</li>
<li>Team\History</li>
<li>Team\SVN Properties</li>
<li>EPIC\RegExp <em>only if you installed EPIC</em></li>
</ul>
</li>
<li>Left
<ul>
<li>Tasks\Task List</li>
</ul>
</li>
</ul>
<p>I like that the Oultine is automatically expanded, so that I have an overview of the file at every moment, but Aptana does not autoexpand the Outline. I use the following workaround:</p>
<ul>
<li>Create a new <em>General Project</em> called &#8220;_Monkey&#8221;</li>
<li>Create a folder called <em>scripts</em></li>
<li>Create a javascript file called <em>autoExpandOutline.js</em> with the following content

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* 
 * 
 * Menu: EHU &amp;gt; HandlerService (Auto expand outline)
 * Kudos: Ingo Muschenetz &amp;amp; Kevin Lindsey &amp;amp; Steve Daniels
 * License: EPL 1.0
 * Listener: getPartService().addPartListener(this);
 * DOM: http://localhost/com.aptana.ide.scripting
 * DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript
 * 
 * 
*/</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getPartService<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> workbench <span style="color: #339933;">=</span> Packages.<span style="color: #660066;">org</span>.<span style="color: #660066;">eclipse</span>.<span style="color: #660066;">ui</span>.<span style="color: #660066;">PlatformUI</span>.<span style="color: #660066;">getWorkbench</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> result <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>workbench<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> window <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
        runOnUIThread<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            window <span style="color: #339933;">=</span> workbench.<span style="color: #660066;">getActiveWorkbenchWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                result <span style="color: #339933;">=</span> window.<span style="color: #660066;">getPartService</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//out.println(&quot;result set to &quot; + result);</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">else</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">//out.println(&quot;window is not defined&quot;);</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//out.println(&quot;workbench is not defined&quot;);</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">//out.println(&quot;getPartService() is returning &quot; + result);</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> result<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partBroughtToTop<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partClosed<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partDeactivated<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partOpened<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partActivated<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>part.<span style="color: #660066;">getEditorInput</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    expandOutline<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partVisible<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> partHidden<span style="color: #009900;">&#40;</span>part<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;part*()\n&quot;);</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> expandOutline<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">//out.println(&quot;expandOutline()\n&quot;);</span>
  <span style="color: #000066; font-weight: bold;">try</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//out.println(&quot;try\n&quot;);</span>
    <span style="color: #003366; font-weight: bold;">var</span> editor <span style="color: #339933;">=</span> editors.<span style="color: #660066;">activeEditor</span>.<span style="color: #660066;">textEditor</span><span style="color: #339933;">;</span>
&nbsp;
    editor.<span style="color: #660066;">getOutlinePage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getTreeViewer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">expandAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//out.println(&quot;catch\n&quot;);</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ul>
<p>Each new project that you create must use this project as reference, and now every time you open a file the Outline will be expanded automatically when you enter into the Editor</p>
<p style="text-align:center;">
<a href="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-layout.png" rel="lightbox[326]"><img src="http://p0l0.binware.org/wp-content/uploads/2009/07/eclipse-layout-300x230.png" alt="Eclipse Layout" title="Eclipse Layout" width="300" height="230" class="alignnone size-medium wp-image-378" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://p0l0.binware.org/index.php/2009/07/28/eclipse-configuration-for-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

