Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

Java, the OLPC, and community responsibility

The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
Replies: 3 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

OpenProject Launcher for Eclipse?

URL: The YouTube of Java Sample Code

At 5:42 PM on Jun 1, 2007, Daniel Spiewak Javalobby Junkies wrote:

I saw a very interesting link on DZone today. Well, to be more precise I the post directly out of the blog's RSS feed and tried to add it to DZone myself, shortly thereafter noticing that bloid got there first. http://www.dzone.com/links/the_youtube_of_java_sample_code.html

Basically, Geertjan is talking about a brand new service NetBeans.org is offering, which allows bloggers and others of their ilk to zip up their code samples as NetBeans projects and easily distribute them through a one-click URL. Clicking on the URL launches a Java Web Start application which locates and launches your copy of NetBeans (5.5.1 and up). Now here's the clever bit: it downloads and imports the specified zipped project into your local NetBeans. The way NetBeans handles the import could be a bit better (for example, I'd like to see the Projects pane opened and the project highlighted automatically), but the fact remains that this is an incredibly clever use of JWS technology.

I'm sure I'm not the only one who's felt frustration regarding the distribution of sample code in articles or blogs and how difficult it is to actually get the code somewhere you can take a look at it in detail. Actually, that's part of the reason I finally gave in and installed JEdit (and spent 6 hours hacking the core to make it usable). Now, with this new functionality (hosted at NetBeans.org), it's really easy for anyone to push out source code to their readers in a convenient way. So the question is, when do we get to see something like this for Eclipse?

Unfortunately for us (in this case), Eclipse is a bit more abstracted than the NetBeans platform. To actually launch Eclipse, import a project and (preferably) select it in the package explorer would require some sort of hook in JDT itself. As far as I know, there's no way for us to simply pass "--import SampleCode.zip" to the eclipse executable and expect it to do something useful. Quite unfortunately, for this functionality we would need a third-party plugin to be present in the user's Eclipse installation; and this defeats the whole idea.

So, for the moment NetBeans has an edge over Eclipse in this emerging field of "blog friendliness". How long before Eclipse catches up?
  Click to reply to this thread Reply
1. At 5:47 PM on Jun 1, 2007, Alex Blewitt DeveloperZone Top 100 wrote:

Re: OpenProject Launcher for Eclipse?

Yeah, but you can cut'n'paste examples:

--- 8< ---
package test;
public class Main {
  public static void main(String[] args) {
    System.out.println(new Message().getMessage());
  }
}
 
package test;
public class Message {
  public String getMessage() {
    return "Hello World";
  }
}
--- >8 ---


That only works for smaller samples, though. Frankly, sometimes it's easier to be given a link to a public SVN repository than have to download/unzip, though...

Alex.
  Click to reply to this thread Reply
2. At 8:20 AM on Jun 2, 2007, Andrei Loskutov Javalobby Newcomers wrote:

Re: OpenProject Launcher for Eclipse?

Honestly, how difficult it is to import the project from SVN or CVS or the zip file or unpack it manually???
  Click to reply to this thread Reply
3. At 12:13 AM on Jun 5, 2007, Daniel Spiewak Javalobby Junkies wrote:

Re: OpenProject Launcher for Eclipse?

> Honestly, how difficult it is to import the project
> from SVN or CVS or the zip file or unpack it
> manually???

Not hard at all. I think the point is more that the openproject launcher makes it that much easier. There have been times that I've wanted to look at a sample really quickly, and I didn't want to take the time to download, unpack, import, assign WS; I just wanted it to work. The openproject launcher lets you do this pretty slickly.
Daniel Spiewak
ActiveObjects: an Easier Java ORM; Fuse: Resource Injection for Java

thread.rss_message