Tag Archives: Eclipse

My Eclipse code-folding plugin

I will probably have to start with some apologies for letting you guys wait so long for the plugin I have announced in a couple of previous posts, but (as you probably already know the excuse) I’ve been very busy lately.
However in order to keep things short: here is the download link. It is not a real release, but the version I’ve been tweaking for a while and I am currently using. There are still problems with it, but most of the time it works (or at least using another programmer excuse: it works for me [smile/]). Please give it a try and let me know.

4 Comments

Filed under Uncategorized

Eclipse code-folding plugin: Coffee-Bytes

In a previous post I was talking about some small changes I have applied to one of the first OSS projects I was a core developer and committer: Coffee-Bytes. After that post, I have received quite a few messages expressing their interest in this plugin and the changes I have done to make it work with Eclipse 3.2.

Lately I have been very busy (speaking at JavaZone and JAOO) and I haven’t been able to do much about it. Still, on this project we were two developers, so before doing anything I will have to discuss these details and see what are the options. However, I promise I will keep everybody interested posted.

category:

5 Comments

Filed under Uncategorized

Eclipse API and Code Folding

One of the my first open source projects I have worked on was Coffee-Bytes code folding plugin. It happened a long time ago and at some point the development has been discontinued.

However, tonight, working on some very long sources I have remembered it and I said I should give it a new try. Unfortunately, once I enabled it no editors could been displayed. Checking the .log file I have found the reason: the folding code was broken with a NoSuchMethod exception.

I have found in my archives the last version of the plugin and I thought I should check the API. To my surprise the API was still available (or at least reachable), but what made me post this entry is a feature added in Eclise 3.1: Access Restrictions, according to which when you create a plugin you can restrict others plugin access to its code. While I find the idea quite good (as it makes the API more clear), I have found out that almost everything related to java source code editors is restricted, and I am wondering why? I thought some other plugins would benefit from a clear API (for example AJDT), and now finding this makes me wonder about the reasons (I am quite sure there are good reasons).

However, getting back to the points of this entry, you can read more about Access restrictions: here.

Following the last advise specified at the above link:

But what if you really, really, really, really need to use the class? In that case, you can use it, but you need to be aware of what it means (four really’s usually does it for me).

I have done some small changes to readapt the code and now I have again Coffee-Bytes code folding working on Eclipse 3.2. Just look at the picture to see how reach it is compaired with the default code folding offered by Eclipse:

Reach Eclipse Code Folding

It offers you folding for:

  • top level types
  • normal methods
  • constructors
  • getters and setters
  • main methods
  • inner types
  • static initializers
  • import statements
  • source headers
  • comment blocks
  • javadocs

and even User defined code folding:

User defined code folding

category:

14 Comments

Filed under Uncategorized

Code reviews and tools (plugins) that may help

After reading Cedric‘s post on Code reviews I remembered that I have used an Eclipse plugin that helped me doing code reviews: Jupiter (I have even submitted at that time some patches [blink/]). As far as I know the plugin is continuously improved so if you are in need for something like this go and get it a try.
Another nice Eclipse plugin that might help with code reviews is Mylar even if its intention is not exactly this one.

3 Comments

Filed under Uncategorized

Sharing IDEA project definition files

In a previous post I have tried to figure out how Idea project and modules definition files can be shared between team members considering etherogenous environments.
While I could find a few references in the Help, none of them is really describing how things should be done. I have mentioned how this can be achieved while working with Eclipse by using path variables. This same notion exists in Idea too, but I couldn’t figure out how can one can use it from the UI. But, the good news is that you can define variables to be used with modules, and also you can use variables while defining classpaths. I have figured out that by editting the .ipr file (project definition) and adding:

<UsedPathMacros>
<macro name=”MAVEN_REPO” />
</UsedPathMacros>

you will force your project to define this variable and than you can use it in both module paths and different classpaths just by specifying $MAVEN_REPO$/rest_of_path. The only thing left is to find out how you can do this without having to manually edit the .ipr and .iml files. Does anybody know the answer to this?

Disclaimer: this is the 3rd post in row about Idea and considering what may happen if Hani is picking you, I will just let everybody know that I am not associated and nor do I work for Eclipse or Idea.

category: , ,

1 Comment

Filed under Uncategorized

An Eclipse user in IDEA-land meets paths

If you haven’t followed the first part of this series, I will briefly restate here that the goal of these posts is not to start the long discussion about which IDE is better, but rather to raise some questions about things that remained unclear while playing with Idea.

Today the Eclipse user (n.b.: me) had to play with paths. And I am including here: source paths, output paths and classpaths.
First: source paths. In Eclipse I have to define the source folders under the current project directory. The only possibility to include in a project external source dirs is through linked directories. Idea allows providing more Content Roots for each module, and so you can include multiple source directories from different locations on the file system.
Output paths: Idea allows you to set only 2 output directories per module: the source output directory and the test output directory. Even if at the first glance this looks a little bit restrictive, things are not so bad cause for real big projects requiring multiple output folders you will however have to define a build system (Ant, Maven based) to really manage the project.
So far, everything went as expected. Unfortunately, the things weren’t as clear while trying to set the classpath. In a multi-module project, Idea introduces 3 types of classpaths: Global libraries, Project libraries and Module libraries. While at the first glance these look really good, I finally haven’t been able to achieve what I wanted.

And I think this is the moment for the first question: considering a project that is shared by a team of developers, and the project is built using jars from a MAVEN local repository (each developer may have the repository on a different location), how should I define the classpath so that the project/module definition can be shared? Or, what is the correct approach for achieving this with Idea. In Eclipse I am doing this using a variable pointing to MAVEN_REPO and than defining the classpath in terms of this variable (the classpath will look something like: MAVEN_REPO/log4j/jars/log4j-1.2.8.jar;MAVEN_REPO/lucene/jars/lucene-1.4.3.jar. Considering that each developer can define this variable to point to his repository than the team will be able to share the project definition file). Can this be achieved with Idea?

In Eclipse I can include a jar in my project classpath using one of the following solutions:

  • contained in the current project (the most usual way)
  • anywhere on the filesystem (not very usefully in a shared project)
  • extended variable (as shown above)
  • relative to another project (very usefully in a shared project: the classpath description is persisted in relative terms ignoring the real locations of the projects)

My final question for the 2nd day in the Idea-land would be: how can I achieve the 3rd and 4th scenarios in the above list, and also be assured that the project/module definition can be shared. I really hope to have some answers from expert Idea users, so that I will have a 3rd day in Idea-land. Thanks.

category: , ,

2 Comments

Filed under Uncategorized

An Eclipse user in IDEA-land

I am an Eclipse user for more than 3 years, but I find it interesting to have a look at the other approaches in the world of Java IDEs. This post is not meant to start once again the long and so useless discussion about which one is the best, but rather to ask questions about how to achieve some goals (and hopefully have some advanced users answer ’em [smile/]).

Since back in the days of Netbeans 3, I got used to define in my workspace projects that are related to my current work. For example, if my current work project is using WebWork than usually I will create a WebWork project. This will allow me to navigate through its sourcecode and also help me when debugging.

IntelliJ IDEA allows you to work with a project at a time. But it allows you to define more modules inside a project and as I found out groups of modules. And here is my first question:

Can I use modules to refere the external projects my current project is based on? Or in case this is a wrong approach from the perspective of IDEA than what is the way to define my project so that I can navigate the source code of the projects it depends on?

I will be very happy to hear how I can do this in the IDEA-way. Thanks in advance to everyone giving me hints.

Disclaimer: I have spent some time reading the IDEA help, but I haven’t found references to this question. The approach I am describing above it’s coming mainly from using the Eclipse workspace export plugin provided with IDEA.

Update: Scott posted the hint to succesfully see the dependency projects while debugging.

category: , ,

4 Comments

Filed under Uncategorized

IDE advantage (or Ruby experiences)

Listening to my friend Cedric advice and considering all the talks about RoR, a few months ago I have decided to start looking and reading about Ruby.
I haven’t done much scripting before and discovering this OO scripting language is an interesting experience. However, coming from the Java world, my expectations are different; and I am not speaking at the language level, but at the tools level.
Right from the beginning I was asking on Ruby mailing list which editors/IDEs are they using? How are they organizing/managing the sources? How is the maintainance gonna work?

Well, the first question has generated a lot of traffic, with the conclusion that you don’t need a specialized editor/IDE, just some coloring and folding and some tricks to fire irb it’s just enough. I have gonne further and asked what about big projects with thousand of sources? This almost started another flame which concluded with the fact that Ruby source code is much more less than Java code and again you don’t need an IDE for it. I tended to distrust these reasons, as I was remembering my early days with Java when doing small projects with vim was fun, but comming back after a few months was a killer, and I bought a license of Arachno Ruby. I did some research in advance and finally I have concluded that this is the kind of editor that is gonna help me out with Ruby going to the directions I liked.
Making the story short and coming back to nowadays, today I have installed a desktop wiki in Ruby: Socks. It is a very nice and small wiki offering a lot of features. However I have disliked one or two of its offerings and one that I was looking for (page tagging) was missing, so I decided it is the right moment to dig for the first time in Ruby.
The project is indeed small compaired with a Java project: 36 sources. The first bad sign for my playtime were the files with more than 1000 lines. Than immediately a question raised in my head: how am I suppose to find the source of a class/module definition? In my Eclipse IDE I have been pressing F3 for a couple of times and the navigation was done. But here? I have to use find and sed and grep, forgetting that I am on an Win machine (hint! hint! Lothar).
I will not make this entry any longer, but I finished by asking myself how can you really be more productive in Ruby? Maybe if you write all your code by your own and maintain it permanently. Otherwise I cannot see how using such a diversity of tools just to accomplish an easy task can make you more productive.

Disclaimer: I definitely don’t have the Ruby mindset yet. Hope to find it soon.

Update: a small update about Arachno Ruby: it has a Lookup Selection function that may help you while doing navigation. Thanks a lot Lothar.

4 Comments

Filed under Tools

TestNG and IDE support

During the last months, while developing TestNG, I have read and also received lots of comments about the lack of support for TestNG in the most used IDEs (Eclipse, IntelliJ IDEA and NetBeans). I have put some of my spare time into developing a plugin for Eclipse (by the way it is working great, and the features are quite nice [blink/]). I’ve had intentions to do the same for Idea, but I cannot see how I can develop a plugin with the Plugin Development Package.
Why? That 14Megs download contains 45Megs javadocs, which are mostly empty. I don’t have any document describing which way to go. And those 6 examples are little toys. While the Eclipse API is really huge, I was able to find valid javadoc comments, lots of examples and even some good books (not to mention the fact that developing with Eclipse means learning SWT/JFace). I also know about the support site, but I usually go to this kind of places to ask important/specific questions, and not <<Please help…>> ones.
I keep my interest open to support TestNG in Idea, but for the moment this seems to me quite impossible.

Disclaimer: this post is by no means meant to upset IntelliJ IDEA‘s developers. It is only my short experience while trying to develop a plugin.

2 Comments

Filed under Uncategorized

Eclipse TestNG plugin public availability

A few days ago we have announced on the TestNG MLs the release candidate of the TestNG-Eclipse plugin.
Today, Cedric and myself are very pleased to announce the general public availability of the TestNG Eclipse plugin (in fact this post was meant for yesterday but I was not able to publish it).
It can be downloaded from:

Now the official announcement:

Hi all!
The TestNG team is pleased to announce (and distribute also ;-)) the first version of TestNG Eclipse plugin.

Features
========
1/ TestNG View (Window -> Show View -> Other -> Java -> TestNG) featuring
– the Red-Green Bar
– test results statistics
– hierarchical test results presentation
– failures stack traces presentation.

2/ TestNG Launcher (Run … -> TestNG) featuring
– browse and run a TestNG enabled test class
– browse and run groups defined in the project tests
– browse and run suites

3/ Contextual TestNG Launcher (Right Click -> Run) featuring:
– run class as TestNG test
– run type as TestNG test
– run method as TestNG test
– run suite as TestNG test

The current version is working with Eclipse 3.1M5 (and probably 3.1M4).

Your feedback is welcome (and needed). Enjoy!


TestNG Team

You can see a set of nice snapshots on Cedric’s announcement.

We hope that this release will bring more pleasure on your experience with TestNG.

Leave a comment

Filed under Uncategorized