Welcome to Planet Eclipse

February 10, 2012

Benjamin Cabe
Benjamin Cabe

Lua Development Tools now available as a standalone product

The IDE for the Lua programming language that is being developed within the Koneki project is getting more and more adoption these days. There are two main segments where Lua is intensively used: embedded platforms (the Lua VM has a very small footprint and is written in pure ANSI C, making it easy to embed), and video game industry (Lua is easy to learn, making it a language of choice for game scripting).

In order to facilitate the installation of Koneki Lua Development Tools for people not very familiar with the Eclipse SDK (nobody’s perfect, eh?), we are delivering an all-in-one package, that is ready to use.
It is already configured to download updates from the Koneki update site, so you should always benefit from latest features and bug fixes.

If you are interested in Lua development, go check it out now (and enjoy the nice splash screen)! :)

Ian Skerrett
Ian Skerrett

What is the Best New Eclipse Product in 2011?

Each year companies and open source communities release some amazing new products/projects based on Eclipse.   It really is amazing the innovation and creativity that happens in the Eclipse ecosystem.   Last year we recognized many of these new product at the New Product Showcase at EclipseCon 2011.   The winner of the Hot New Product award was the Chronon Debugger.

We are pleased to announce the New Product Showcase for EclipseCon 2012.   If your open source project or your company has released a brand new Eclipse-based product or project in 2011 then you should consider participating.     New doesn’t mean a new version, new means something first released to the community in 2011.   It can be a new Eclipse project, a non-Eclipse open source project or a commercial product.   The attendees of EclipseCon and Agile ALM Connect will be voting during the showcase to decide the Hot New Product for 2011.

We have limited space so if you want to participate then sign-up soon.


Peter Kriens
Peter Kriens

Cloud Workshop During OSGi DevCon/EclipseCon

The OSGi Alliance is organizing a second Cloud workshop during OSGi Devcon! Thursday March 29. The workshop will run from 9am to 1pm. Attendance is free but requires registration. RFP 133, our document describing the areas we could look into, has matured over the past year. It is clear from this work that OSGi and the cloud are a natural fit. The next stage is working on actual specifications

Ed Merks
Ed Merks

Xcore on Training Wheels

I've quietly been making excellent progress with Xcore. After getting IP approval, the first step was to migrate the code base to be hosted at Eclipse. I decided this was also an appropriate time to migrate EMF and XSD to use Git to preserve the github history of Xcore. All the cool kids are doing it. Being cool is very important. No one wants to be left out in the cold.

Unfortunately, learning Eclipse's Git tools has been a bit of a nightmare. Its poor support for proper line feed handling continues to be frustrating. I compare learning Git to being given an advanced new hammer, one without a handle, that if you just instruct it nicely to do what you want, will do the job ten times better than ever before. Only the instructional language is Gitinese. It's very hard to pronounce, with lots of German "ch"s (think hissing snake), "st"s, and "sp"s (think "sht" and "shp" where the "h" is implied), plenty of Dutch "g"s (think clearing your throat), and no end of "th"s (think "s" but with your tongue hanging way too far out; it is a very unusual sound if English is not your native language). Anyway, enough bashing Gitinese and the Germanic languages. Once you learn them, they all sound as if they were simply meant to be that way. Oh well, back to Xcore.
Of course we needed a logo, so I whipped one up. Maybe someone will contribute a nicer one. On a more substantial front, with the help of Dennis Hübner, we have our first builds of Xcore available. It's been contributed to the Juno repository. (Note that he's working on making EMF and XSD 2.8 build with Eclipse 3.5 so that we'll have more permissive version ranges that are properly tested.) I also finally found time to write a wiki tutorial for how to get started with Xcore. Lots of cool things are working rather nicely. We even have support for organizing imports. So have a look if you have the time.

February 09, 2012

Ian Skerrett
Ian Skerrett

Adventures in Developer Advertising

During the month of January I have been doing some advertising for EclipseCon 2012 and Agile ALM Connect.   This year we are in a new location (Reston, VA) and Agile ALM Connect is a new conference, so we wanted to make sure the word got out.  I am a big believer in sharing data and marketing experiences, so I thought it might be interested to share the experience we had with the different advertising outlets.

We setup  (or at least attempted to setup) advertising campaigns with Facebook, LinkedIn, Twitter and Stack Overflow.   Stack Overflow is one of the top sources of referrals to the eclipse.org web site, so I thought it would be interesting to see if we could drive traffic to the eclipsecon.org site.

First off, Twitter was quickly disregarded since you needed a budget of at least a $5000/month.   My budget across all media outlets was less than the minimum required by Twitter.   It is obvious Twitter is for the big-time advertisers, not the long-tail.

LinkedIn allowed for small budgets but the results were very disappointing.  I setup campaigns for each EclipseCon and Agile ALM Connect.   After 1 week, I had a total of 5 clicks, at a cost of $3/click.   [As an aside, advertising is often measured in click-thru rate (CTR) and cost/click.]  LinkedIn kept recommending for me to increase the cost per click but frankly paying $5 for someone to click on a URL is hard to justify, so I ended the campaign.

Stack Overflow required a minimum of $2500/month but considering their importance in the Eclipse community I decided to give them a try.   The results were disappointing.  We had a 0.07% CTR and that results in an average $5 cost/click.  Not really the best results.  Half way through the month we updated the ad and started to get closer to a 0.1% CLR but still not great.

Facebook drove the best results for the money.   The Facebook CTR was a dismal 0.02% but they charge by the click, not by impression, so the campaign averaged $1/click.  From an advertiser point of view, the nice thing about Facebook is that I was able target the ads to specific countries, states, cities, companies, keywords etc. etc.  Facebook’s ability to target ads is definitely impressive from an advertiser perspective.

In summary, Facebook was definitely the best value.   There also seems to be a lot of Eclipse community using Facebook, we have 20K people following the eclipse.org fan page, so something definitely worth pursuing in the future.

FWIW, we also advertise EclipseCon and Agile ALM Connect on the eclipse.org home page.  In fact, we also sell advertising space to Eclipse Foundation member companies that want to reach the Eclipse community.  Based on past experiences, the click-thru rates for ads on eclipse.org typically range from .1% to .3% and a cost/click at $1.37-$2.00.   We also have Promoted Downloads where the CTR ranges from .4% to 1.4% and a cost/click at $0.53-$1.80.

What are other people finding from your advertising experiences?   Any suggestions for other sites or other experiences?


Birt World
Birt World

Spring Framework and BIRT Integration

Many BIRT users also use the Spring Framework, and while we have blogged about different integration scenarios before, many of the newer features of both projects have not been discussed. In the last couple of weeks the BIRT and Spring teams have worked together to create some examples and an article (Spring Framework & BIRT) that describes the following integration options:

• Integrating the BIRT engines in Spring MVC
• Accessing Spring beans from the BIRT Viewer
• Using Spring Remoting to access Spring Beans from a BIRT report

These examples were built using the latest versions or BIRT( 3.7.1) and the Spring Framework(3.1.0).

Thanks to Josh Long, Spring Developer Advocate and the Spring team for working with us to put this content together.

February 08, 2012

Alex Blewitt
Alex Blewitt

Migrating to self-hosted Octopress

This blog will shortly be moving off of its long-time home at Blogger onto a new, self-hosted Octopress solution. Although I hope to keep feeds and URLs in place via alblue.bandlem.com, feeds will be regenerated and this is likely to cause the post's ID to change.

As a result, you may notice up to 5 of my old posts being redisplayed (originally posted in 2011). If so, you have my apologies in advance.

Blogger was the home of this blog for a long time, before Google got their googley tentatcles all over it, back when it was called alblue.blogspot.com. Custom domain names followed, and it turned into the current alblue.bandlem.com. The blog's URL will remain the same, and the main feed remains http://alblue.bandlem.com/atom.xml.

If you have feeds beginning with either alblue.bandlem.com or www.bandlem.com then these feeds should continue to work after the transition. However, if you are using an older alblue.blogspot.com address, or a third-party service like Feedburner which may be pointing there, it may go to the wrong place.

After the migration, I'll post a few reminders on the old blog location (so that if you are subscribed to the wrong place they will show up) before finally shutting this down by valentine's day (14th Feb). After all, I 💔 Google, so it seems appropriate.

Here is a list of the new feeds for my blog. Instead of having to listen to everything I have to say, perhaps you're more a fan of specific categories, such as Eclipse or OSGi focussed topics; or maybe even Git or Mac. I categorise each post and (other than administrative announcements such as this) ensure that appropriately delivered content is put in each bucket. In addition, every Tag page has its own feed, so if you want to just listen to a chosen subset, you can.

New post and feed URLs for http://alblue.bandlem.com
Description Posts (HTML) Feed
Everything I write / /atom.xml
Eclipse specific posts /Tag/eclipse/ /Tag/eclipse/atom.xml
Mac and Apple/iPhone related posts /Tag/mac/ /Tag/mac/atom.xml
Git posts /Tag/git/ /Tag/git/atom.xml
Java posts /Tag/java/ /Tag/java/atom.xml
OSGi and modular Java related posts /Tag/osgi/ /Tag/osgi/atom.xml

Thankyou for subscribing to my blog, and see you on the other side.

Wayne Beaton
Wayne Beaton

How I Learned to Stop Worrying and Love the Build

I decided to spend some time reviewing the talks at EclipseCon 2012 and came across this gem:

How I Learned to Stop Worrying and Love the Build

With Hudson driving builds from the top; Git, Gerrit, Maven, and Tycho in the middle; and Mylyn controlling the pieces from the developer’s desktop, The Eclipse Foundation provides an impressive stack of technologies for building software. All this great technology combined with governance, intellectual property management, architectural guidance, and coordination via the simultaneous release, combine to deliver an Application Lifecycle Management (ALM) solution that is the envy of other open source projects and IT departments around the globe. In this session, we’ll present all the pieces and show how they work together; we’ll talk about evolution of the our processes and infrastructure, and muse about how they’ll grow in the future.

It really should amaze me that we’ve evolved a powerful common build infrastructure at Eclipse. But it doesn’t. The Eclipse community working in conjunction with our world-class IT team regularly does amazing things. It’s easy to get lost in it all and take it for granted.

The Eclipse Common Build Infrastructure is something that we’ve collectively been evolving for years. In this talk, you’ll learn about the current state of the technology and the processes that drive it. You can use what you learn to plan your own ALM stack and strategy, or implement your eclipse.org project build.

I hear the speakers are pretty good. That Beaton guy’s a little funny looking, though.
EclipseCon 2012


Lars Vogel
Lars Vogel

Eclipse gets sexy again – new Splashscreen

In case you missed it, Eclipse 4.2 has a new Spashscreen.

I really like it (maybe the Eclipse graphic could be a little lower to feel more centered but otherwise it is great).

The details are in the Bug report:

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=341645

You can download the latest integration build of Eclipse 4.2 and get this new Splashscreen. See Eclipse 4 Tutorial for the details of installing Eclipse 4.

These are good times for Eclipse 4; the Splash Screen is what every IDE user will see, almost every day. Its great that it looks modern and attractive.

flattr this!

Jae Gangemi
Jae Gangemi

now where was i...

it's interesting to go back and look at code one hasn't touched in 2+ years - i definitely had quite a few "uh, how does this work again" and "wtf was i thinking here" moments. good times! :)

now, where was i...

i've gone through and synced with the current head of dltk, which appears to be working on the 4.0 release. i did some quick testing (i wish i had better unit tests, but i don't fully understand how to break eclipse down into smaller pieces) and everything appears to be working as it should, or as much as has been implemented, which brings me right back to the parser issue.

perlipse is never truly going to be useful unless an AST of a perl source can be produced. i can make it the best debugger in the world, but without some of the features the editor provides (outline, hyperlinks, etc), well - there are other alternative (some not free) solutions available.

so…in order to deal with this problem, i have decided (well, actually i decided and started on..) to try and port PPI to java, and i'm happy to report that after getting past some bumps in the road, things are progressing quite well and when all is said and done, this should put perlipse well on it's way to becoming a useful editor as well. that's the good news…the bad news is it's a lot of work and i only have so many hours in my day that i am able to devote.

but hey, you've waited this long already, so what's a little longer, right? :)

Max Rydahl Andersen
Max Rydahl Andersen

m2e(clipse)-wtp 0.15.0 : New and Noteworthy

Maven Integration for Eclipse WTP 0.15.0, a.k.a m2eclipse-wtp, a.k.a m2e-wtp is available.

This release contains mostly bug fixes, but a few improvements managed to slip in. The complete release notes are available here.

 

Update 08/02/2012 : m2e-wtp 0.15.1 has been released to fix a build related issue, but is strictly identical to 0.15.0 in terms of code/features

 

m2e-wtp 0.15.0 is compatible with the JavaEE distributions of Eclipse Helios and Indigo, requires at least m2e 1.0 (works with 1.1) and mavenarchiver plugin >= 0.14.0 (0.15.0 should be automatically installed).

As usual, m2e-wtp can be installed from :


 

So let's see what are the highlights of this new release :

 

Packaging inclusion/exclusion support improvements

For war project, previous m2e-wtp versions used to use <packagingIncludes> and <packagingExcludes> attributes from the maven-war-plugin config to enable (or not) the deployment of project dependencies to WTP servers. In 0.15.0, the same level of support has been added to EAR projects using maven-ear-plugin 2.7+. However, the problem with this approach is, other resources (web pages, classes ...) are not properly excluded (using the <*SourceInclude> and <*SourceExclude> attributes).

 

In order to address this problem, Rob Stryker, committer on WTP and lead of JBoss AS tooling in JBoss Tools, provided an implementation for JBoss AS servers that might be generalized to other WTP server adapters (if they decide to do so). Basically, some new metadata is added to the project's .settings/org.eclipse.wst.common.component like :

 

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="webOrEar">
         ...
        <property name="component.inclusion.patterns" value="pattern1,pattern2"/>
        <property name="component.exclusion.patterns" value="pattern3,pattern4"/>
    </wb-module>
</project-modules>

 

The patterns are separated with a comma and exclusions take precedence over inclusions : resources matching one of the exclusion patterns are not deployed, even if they match one of the inclusion patterns. That solution is not maven-bound so any other kind of project can benefit from it.

Now all m2e-wtp 0.15.0 does is map the maven patterns to their equivalent component metadata. This gives :

component_patterns.png

In the example above, a warning is displayed as both <warSourceIncludes> and <packagingIncludes> are defined. Since both patterns could overlap, it might lead to some weird behavior where WTP would actually deploy more files than a maven CLI build. In order to minimize (we can not totally solve) that potential discrepancy we only keep the packaging patterns in the component files and recommend using <packagingIncludes> only.

 

Currently, this feature only works in combination with the JBoss AS Tools from JBoss Tools 3.3.0.Beta1 (nightly builds available from http://download.jboss.org/jbosstools/updates/nightly/trunk/), but we'll try to make other WTP Server adapter vendors support it in the future (as part of WTP core API).

 

Warnings added when unsupported dependency types are detected

As of today, if a project depends on another workspace project of type ejb-client or test-jar,  that specific dependency will not be packaged properly by WTP, as Maven would do in command line. Moreover, you'll experience some class leakage on the compilation and test classpaths in Eclipse (ex: non client classes being visible). The only known workarounds to this issue are to disable workspace resolution, or close the dependent project and rely on the dependencies from the local maven repository.

Ideally, in order to make the deployment part work, we would need to introduce new WTP components, but the current WTP API doesn't support it, yet. So, until this is fixed, warning markers are added whenever a project depends on such "unsupported" types. That should hopefully give users an idea of the problem and how to circumvent it.

unsupported-dependency-type.png

Better handling of dependencies in war projects

Previous m2e-wtp versions had, in some use cases, some outstanding issues with regard to dependency management of war projects. In particular,

  • when 2 dependencies of the same artifact, but having a different classifier were added to a web project, only one would show up on the classpath. This has been properly fixed.
  • in some cases, the timestamped version of a SNAPSHOT dependencies from the local repository, would be copied under the target/ folder, causing some jar locking issues in windows. The rationale behind this behavior is, maven-war-plugin packages snapshot dependencies using the timestamp identifier. Since the name of file in the maven classpath library needs to match the one deployed by WTP, a copy was performed. To fix this problem, the default file pattern matching used for dependency deployment has been changed to @{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@. This means that, by default in m2e-wtp, SNAPSHOT dependencies are now deployed using the SNAPSHOT suffix instead of the timestamp. If you need to force the use of timestamped artifacts, then you need to explicitely decalre the following in your pom.xml :

 

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.2</version>
  <configuration>
    <outputFileNameMapping>@{artifactId}@-@{version}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
  </configuration>
</plugin>

 

Removal of conflicting facets on packaging change

If you had a java utility project, that you wanted to upgrade to an EJB project for example, a constraint violation would be raised upon project configuration update (EJB and Utility facets can't be both installed).

This has been fixed by removing all conflicting facets when you change the packaging of a Java EE project, making that conversion completely transparent.

 

What's next?

m2e 1.1 introduces a new Eclipse to Maven project conversion API. It means that, in m2e-wtp.next, we will be able to automatically convert existing WTP project configuration to maven's. Dependencies will still need to be set/translated manually but that's a pretty good start IMHO.


Finally ...

I would like to thank the m2e-wtp community at large for their support and contributions, that's what make this project move forward and make it one of the most popular projects on the eclipse marketplace.

Contributions can take the form of :

 

Keep it up.

 

 

Fred.

https://twitter.com/#!/fbricon

Max Rydahl Andersen
Max Rydahl Andersen

Debugging and Browsing OpenShift Applications in Eclipse

Latest OpenShift enabled port-forwarding for your OpenShift applications.

 

This enables you to use a debugger for your JBoss application and it allows you to connect to the database directly and use tools like Eclipse Database Browser instead of only using phpsqlmyadmin.

Of course once you have these things setup in your Eclipse you can use things like reverse engineering and even run your local app against the remote database.

 

It all works by setting up an ssh tunnel that exposes the internal remote ports running on OpenShift servers on your local machine - this does require some manual steps which i'm outlining in this blog

together with how to configure the database setup in Eclipse and how to remote debug JBoss running on OpenShift.

 

In future releases of JBoss Tools we'll be looking at simplifying these steps, but for now here are the fully manual steps.

Setting up port forward

The simplest way to do this is to use the rhc command line tools.

 

Make sure you got the latest version - how to install/update these for various platforms is documented here.

 

Once you have those run rhc-port-forward -a <appname>.

 

I have an app called ‘fonk’ of type ‘jboss-as7’ and with ‘mysql’ cartridge enabled. For such a setup you should see something like this:

rhc-port-forward -a fonk 
Password: 
Checking available ports...

Binding httpd -> 127.1.255.130:8080...
Binding java -> 127.1.255.129:8080...
Binding mysqld -> 127.1.255.129:3306...

Use ctl + c to stop

OSX gotcha

In case you get an error print out similar to this:

bind: Can't assign requested address
channel_setup_fwd_listener: cannot listen to port: 3306
bind: Can't assign requested address
channel_setup_fwd_listener: cannot listen to port: 8080
bind: Can't assign requested address
channel_setup_fwd_listener: cannot listen to port: 8080
Could not request local forwarding.

You are most likely running OS X which unfortunately(?) does not automatically allow you to have all 127.x.x.x IP’s setup with a so called loopback alias.

 

To fix this you need to add such alias manually for each IP you want to connect to.

 

In my case that is 127.1.255.130 and 127.1.255.129 as seen in the first attempt of using rhc-port-forward. These IP’s will be different for each of your app, thus for `fonk’ app I enable loopback aliases by running the following:

sudo ifconfig lo0 alias 127.1.255.130
sudo ifconfig lo0 alias 127.1.255.129

Now when you run rhc-port-forward you should not be seeing any bind: Can't assign requested address. error messages.

 

Note: these alias’es does not survive reboots - if anyone know how to setup global loopback alias or make these persistent between reboots then I would love to hear about that in the comments

Use OpenShift database locally

When port forwarding is enabled you can start using these, for example to setup and connect to MySql database via Eclipse DTP Tools.

 

To do this open the Data Source Explorer:

datasourceexplorer.png

Click on the “New Connection Profile” and choose MySql and give it a name.

newconnectionprofile.png

Click Next and if you do not have an existing driver for MySQL configured you will see an empty list:

emptydriver.png

To add a driver click the + icon and setup a driver:

mysqldrivermissingjar.png

For OpenShift MySQL the 5.1 option is best, and it just needs to be told where the driver is under the “Jar List” tab. Here you click the “Edit JAR/Zip” and point it to your downloaded mysql-connectoer-java-5.1.jar.

editedjarlist.png

Once that is done you just need to fill in the right connection details:

connectiondetails.png

The important part for the connection details is that you set URL to match the pattern:

jdbc:mysql://<forwarded-ip>:3306/<appname>

For my fonk application that would be:

jdbc:mysql://127.1.255.129.3306/fonk

And then set “User Name” to admin and type in your MySql password.

You can use the “Test Connection” button to verify you can connect.

When you press Finish you should be able to browse your remote mysql database hosted on OpenShift:

datasourceexplorerconnected.png

From here on out you can now use this Eclipse dataconnection with any plugin that supports such connections. i.e. Hibernate Tools reverse engineering features.

Debug JBoss AS

To enable debug with JBoss we need to add a enable_jpda marker file to .openshift/markers.

This is done by simply executing the following:

cd git/fonk
touch .openshift/markers/enable_jpda
git add .openshit/markers/enable_jpda
git commit -a -m "enable jpda"
[master 6f7197c] enable jpda
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .openshift/markers/enable_jpda
git push
<openshift remote build output>

Note: you can of course also do this all from within Eclipse via EGit integration if you prefer that.

When this have been enabled you need to start/restart port-forwarding to get it to pick up the java jpda port.

rhc-port-forward -a fonk 
Password: 
Checking available ports...

Binding httpd -> 127.1.255.130:8080...
Binding java -> 127.1.255.129:8080...
Binding java -> 127.1.255.129:8787...
Binding mysqld -> 127.1.255.129:3306...

Use ctl + c to stop

Notice the Binding java -> 127.1.255.129:8787.... line, that is the jpda ip and port you are going to use.

Now to set this up in Eclipse JDT debugger you need to create a ‘Remote Java Application’ under “Debug Configurations”

debugconfigurations.png

And here you select ‘Remote Java Application’ and fill in the connection details:

setupremotedebug.png

The important pieces here are to set Host: to the ip number (in my case 127.1.255.129) and the port wich for JBoss AS on OpenShift is 8787 by default.

 

The Project part is optional, but its useful to point it to the matching Eclipse project which will allow it to find the proper source and let you place breakpoints.

 

Once you press “Debug” it should go and connect to the running server. It might take a while, it is after all going into the Cloud

 

And if you now set breakpoints and use a browser to trigger them you get something like this:

debugjsp.png

This showing the remote debugger hitting the breapoint in a jsp page named snoop.jsp.

 

Conclusion

I hope I showed you how powerful OpenShift’s latest release with port-forwarding is and how (fairly) easy it is to setup once you get the port-forwarding working.

 

Being able to connect directly to the remote database and debug you JBoss server makes for a whole new world of possibilities and productivity boost with OpenShift.

 

Hope you like it and continues to have fun exploring OpenShift and JBoss Tools.

 

/max

Chris Daniel
Chris Daniel

Fedora Eclipse Build: far Orbit

Today I will dwell on the issue that hit me when I tried to build a recent Eclipse - something pre-M5. Previous builds of Eclipse using eclipse-build were done for M1, so it is easy to imagine what could go wrong.

It started very innocently - unsatisfied package javax.servlet_2.6 in a number of plugins. This clearly indicated a problem with the build - for some reason the package javax.servlet was missing or not built properly.

And here comes the first surprise - javax.servlet package is not Eclipse package, it is a 3rd party library. A short glimpse at the dependecies.properties (a file that maps non-Eclipse library to Fedora libraries) and here it its mapping:

javax.servlet_3.0.0.v201112011016.jar=/usr/share/java/tomcat/tomcat-servlet-3.0-api.jar

And there... there is package javax.servlet_3.0 exported!

That's interesting. Quick search for 2.6 version... There is no such version of javax.servlet specification. Something is wrong. How is it possible that half of the Eclipse plugins uses a version of the javax.servlet that does not exists?

The answer was finally found here:

The Servlet 3 specification is a breaking change for implementers, but is
binary compatible for client applications. Following the version guidelines
the javax.servlet packages should move from version 2.5 -> 2.6
The workaround for that issue was not simple. I could not patch Eclipse to use 3.0 (too many patches), nor downgrade version in tomcat-servlet-3.0-api - because of too many dependencies.

Thankfully, OSGi allows for exporting the same package more than once:

Export-Package: javax.servlet;version="3.0", javax.servlet;version="2.6",

One patch for Tomcat, and one problem in Eclipse Fedora Build solved :-).

The problem that I am trying to highlight is that Eclipse Foundation maintains its own version of libraries in Orbit, and it may surprise users. I do not want to say that renaming 3.0 to 2.6 was unjustified (because it was), but on the other hand, does Eclipse have to maintain its own copies of libraries, which are unusable for the rest of the world?

Maybe it is a good time to start discussion about Orbit removal, and a true, transparent connection to other libraries, where each local modification should be sent to the upstream?





Hendrik Eeckhaut
Hendrik Eeckhaut

Creating e-books with Eclipse

In November last year, I attended a very interesting session of Torkild Resheim about creating e-books in Eclipse at EclipseCon Europe in Nuremburg. Torkild demonstrated a new plugin he developed that converts wiki markup files into e-books. I intended to try this as soon as I got home from the conference.

read more

February 07, 2012

Eclipse Announcements
Eclipse Announcements

Last Week for EclipseCon Early Registration Prices

There is only one week left for the early EclipseCon registration prices. The prices will go up after February 14, 2012, so take advantage of the lower price and register today.

Lars Vogel
Lars Vogel

Eclipse 4 Platform Services Tutorial / Overview available

I created and re-worked a summary of the most important Eclipse 4 Platform Services, e.g. ECommandHandler, EPartService, ESelectionService and the EModelService:

Eclipse 4 Services Tutorial

I hope this helps. I’m pretty excited about Eclipse 4, developing Eclipse 3.x plug-ins or RCP applications start to feel “outdated”.

flattr this!

Annamalai Chockalingam
Annamalai Chockalingam

Plugin Load Snapshot View - Eclipse Spykit

Hey Guys

I have this new ... i suppose kewl feature that lets me compare the plugin load based on events. I have called this view as Plugin Snapshot View.

Plugin Load information need not be just useful @ Startup but could be analysed to see if we are loading unwanted plugins based on certain System Test Cases or UI events.

After performing every event, you need to collect the Plugin Details and Plugin Snapshot View would display it as a Line Graph.

I did the following steps'

1. As soon as we launch Eclipse Indigo Modelling 3.7 Resource Perspective. There are about 30 Plugins Loaded on Startup.

2. Create a New Plugin Project using with View Template.
Say Yes to Switch to Debug Perspective.
Go back to Resource Perspective.
Collect Plugin Snapshot Now. 129 Plugins

3. Use Search Plugin >
Click on Search in Eclipse Menu Bar > Search
File Search > File Name Pattern > *.java
Search Result View would open
Collect Plugin Snapshot Now. No Change

4. Right Click on the Project > Run Configuration
Create a new Eclipse Application Run Configuration
Press Close.
Collect Plugin Snapshot Now. 136 Plugins

5. Open Debug Perspective and Return back to Resource.
Collect Plugin Snapshot Now. No Change

And obtained the following Plugin Snapshot Graph. I would be committing this into Eclipse Spykit on Saturday after performing all the checks and validations. But would definitely love your comments to improve it further.

Screenshot :


Link : http://code.google.com/a/eclipselabs.org/p/eclipse-spykit/
This feature would be made available soon, but till then play around with the current features of Eclipse spykit.

David Bosschaert
David Bosschaert

OSGi Cloud Workshop at EclipseCon/OSGiDevCon 2012

Many people are seeing how well OSGi fits conceptually with Cloud Computing. Its modularity is frugal on memory, and provides isolation. Additionally it focuses components on a particular task, which makes them better maintainable too. Furthermore, OSGi dynamicity makes it possible to create Cloud components that react to changes in the cloud environment in a natural way. They can be dynamically configured, reconfigured and an OSGi Framework can be dynamically provisioned and re-provisioned as well!

Over the past while the OSGi Cloud Working Group has been looking at how OSGi can be enhanced to provide additional support for Cloud Computing. This has resulted in a requirements document called RFP 133.

At this point in time we need to discuss which of these requirements should be tackled first? Is it Discovery in the Cloud? Or Metadata? Or Management or maybe something else?
At the same time we should embrace any existing standards in this area and certainly not attempt to reinvent the wheel!

This discussion is the topic of the Second OSGi Cloud Workshop which is held this year at the EclipsCon/OSGiDevCon venue on Thursday March 29 at 9am.

It is set to be a morning with some presentations (the lineup currently is: Paremus, JClouds, eBay and RedHat/JBoss), a demo, and a lot of time for discussion. Entrance is free - you don't need an EclipseCon pass, but you do need to register as numbers are limited (see here also for details on the location of the venue): http://osgi-cloudworkshop-2012.eventbrite.co.uk

Oh, and just to be sure: EclipseCon/OSGiDevCon 2012 has moved and is in Washington/Reston this year!

February 06, 2012

Denis Roy
Denis Roy

EclipseCon location change -- poll results

Last week I issued a webmaster "whacky poll", asking you your thoughts on the location change for EclipseCon this year. The results are in!

97 /doesnt-matter-where-it-is-as-long-as-there-is-enough-beer

Earning the #1 spot on the poll, I think it's clear what the priorities are...



93 /doesnt-matter-where-it-is-as-long-as-the-awesome-p2-guys-are-there

That wasn't actually an option on the poll.. However, it seems to have gone viral. Or maybe someone was stuffing the ballot box :)



50 /no-matter-where-eclipsecon-is-webmasters-will-still-buy-us-beer-right?

I think that is one of those "life certainties"...



38 /yay-less-time-on-an-airplane
27 /oh-no-more-time-on-an-airplane

Looks like more people will be spending less time on a plane. In other news, 27 people will be coming from California :)



38 /the-weather-better-be-warm-and-the-beer-cold
29 /if-its-not-in-california-im-not-going

You know, for the last few EclipseCons in California, the weather wasn't all that warm. I hope Washington treats us right.


In the "why-not-do-eclipsecon-in-(insert-tropical-exotic-location-here)" category:

  • Melbourne, Australia
  • Ibisa
  • Fiji
I'm sorry, but Toronto doesn't qualify as either tropical nor exotic...


Others have also improvised their own entries... Such as this go-green one:

1 /yay-less-carbon-dioxide-maybe-we-can-survive-on-this-planet


1 /hi-denis-i-will-ask-my-obeos-colleagues-to-buy-you-some-beers


You can always count on the Obeo guys to give back to the community.



A few people wrote in to say they couldn't attend this year, but this entry stood out:

1 /alblue-cant-make-it-again-will-cover-remotely

That's a shame -- we'll be missing the unique ties again this year.


That wraps up my whacky poll for EclipseCon! I'm looking forward to seeing everyone there.

Blaise Doughan
Blaise Doughan

JAXB and Inheritance - EclipseLink MOXy's @XmlClassExtractor

In a previous post I covered how JAXB's XmlAdapter could be leveraged to use a node unique to the subtype as the inheritance indicator.  In this post I'll demonstrate that if that node is an XML attribute, then EclipseLink JAXB (MOXy)'s @XmlClassExtractor could be leveraged to do the same thing in fewer lines of code.
Read more »

Ian Skerrett
Ian Skerrett

EclipseCon 2012: Most Popular Tutorials, so far

When you register for EclipseCon 2012 and Agile ALM Connect you are asked to pre-select the tutorial you want to attend on Monday.   We do this so we can ensure the more popular tutorials are in the bigger rooms and to make sure people have a place to sit  (three hours can be a long time to stand).  This past week I was looking at the registration data and thought it was interesting to see the most popular tutorials so far.  Here are the top 6 (out of 16):

  1. Creating Rich Clients with Eclipse RCP 4.x
  2. Mastering OSGi with Ease
  3. What every Eclipse Developer should know about EMF
  4. DSLs for Java Developers With Xtext
  5. The Git Tutorial
  6. Dynamic Server Applications with EclipseRT

Interesting that each major conference theme is represented: Eclipse 4, OSGi, Modeling, DSL,Agile ALM and EclipseRT.

If you are going to EclipseCon andAgile ALM Connect there are two incentives to register early: 1) ensure your first pick of tutorials is available and 2) register before February 14 for the early bird price.

See you in Reston!

   


Alex Ruiz
Alex Ruiz

Sneak preview: Navigating from C++ code to Protocol Buffer declaration – in Eclipse

One of the most popular features of protobuf-dt is its integration with protoc, the Protocol Buffer compiler. When this feature is enabled, protobuf-dt invokes protoc to generate Java, C++ or Python code when a .proto file is saved.

A fairly common feature request is navigation from generated code to its declaration in the .proto file. For example, navigating from a generated C++ class that extends ::google::protobuf::Message to the actual declaration of the Message element in a .proto file.

I started working on this feature a week ago and now I’m happy to show off some progress. The following movie demonstrates the following:

  1. How to enable and configure protobuf-dt’s integration with protoc
  2. How C++ code gets generated after saving a .proto file
  3. How to navigate from the generated code to the protocol buffer declaration

Under the covers

To accomplish this code navigation, I created an Eclipse plug-in that acts as a bridge between CDT and protobuf-dt. Navigation from generated C++ code to its declaration in a .proto file is as easy as right-clicking on a C++ element and selecting the menu “Open Declaration in .proto File.”

Under the covers, the bridge plug-in does the following:

  1. Finds the C++ AST node enclosed in the current cursor position in the active CEditor
  2. Derives the qualified name and type of the proto element from the qualified name and type of the C++ element found in the AST
  3. Asks the Xtext index for the URI of the proto element that has an equal qualified name and type
  4. Asks the Xtext index for the closest match, if the previous step failed
  5. Asks Xtext to open and select the element under the found URI

Of course, this a over-simplified explanation. For more details, the source code of the bridge can be found here.

Challenges

Creating this plug-in was not too difficult. I think the biggest challenge is reverse-engineering protoc to figure out how navigation from generated C++ code to .proto files should be done. A good example is nested Protocol Buffer messages. When a nested message is compiled to C++, protoc creates a top-level class using underscores in the name to concatenate the names of its ancestors.

For example:

Both the messages Outer_Message.Inner and Outer.Message.Inner will generate a C++ class with name Outer_Message_Inner. In this case, there is no single path for navigating from C++ to Protocol Buffer. Currently we identify this ambiguity and select the first match only. I’m thinking about displaying a dialog showing all the possible options and let the user chose the Protocol Buffer element to navigate to.

Another thing I haven’t figured out is how to enable this menu only for files with names ending with “.pb.h.” Here is how I define the menu in the plug.xml file:

<extension point="org.eclipse.ui.popupMenus">
  <viewerContribution
      id="com.google.eclipse.protobuf.cdt.cEditorPopup"
      targetID="#CEditorContext">
    <action
        class="com.google.eclipse.protobuf.cdt.ProtobufCdtExecutableExtensionFactory:com.google.eclipse.protobuf.cdt.actions.OpenProtoDeclarationAction"
        icon="icons/pb.gif"
        id="com.google.eclipse.protobuf.cdt.openProtoDeclaration"
        label="Open Declaration in .proto File"
        menubarPath="group.open"
        style="push">
     </action>
   </viewerContribution>
</extension>

Any suggestions or hints are appreciated! :)

Road ahead

I only scratched the surface of what can be done to integrate C++ and Protocol Buffers in Eclipse. There are still a lot of things to do. In the case of C++-to-Protocol-Buffer navigation, I still need to:

  • Figure out how protoc handles letter cases and C++ keywords in Protocol Buffer element names
  • Implement message field matching by both qualified name and type (currently matching is done by qualified name only)
  • Support navigation for the rest of Protocol Buffer elements: enum literals, groups, rpcs, services and streams

There is also other functionality that would be really useful to have:

  • Cross-language refactoring: update all references in generated code when a Protocol Buffer element is renamed.
  • Find usages of Protocol Buffer elements in generated code. This functionality can also have other interesting uses. Eclipse can warn a user, before deleting a .proto file, that there are dependencies on the code generated from that .proto file.

For now I’m concentrating on C++. Java support will come next.

Summary

In this post I have show you some of the upcoming functionality in protobuf-dt. Navigation from generated C++ code to its declaration in .proto files in Eclipse is a handy feature that is finally being implemented. It is not complete yet, but I expect to have a “beta” (or “testing”) release pretty soon.

Feedback is always welcome :)

(Image taken from Calsidyrose’s flickr stream under the creative commons license)

Ken Gilmer
Ken Gilmer

Strategies for Multiple Android Products with Eclipse and Git

Problem: What’s the cleanest, easist way of sharing code between multiple “products” within a given Android app?

Background: An Android application may have free and paid versions.  Both have some common code and other files, but also have specific code and some files must differ between the two versions, such as the Android Manifest.  When bugs or features are added in one version of the product, it would be nice for those changes to be applied to others if appropriate.  This is similar to the “one product multiple versions” workflow, but different in than specific well-known files will always differ, and the requirement of merging between the concurrent branches (at least for me) is far more frequent.

Requirements:

  • Simple to migrate code from one product to another.
  • Easy to isolate code which should be shared and code that belongs to a specific product.
  • Relies on SCM.
  • Unlikely to let unwanted changes to slip between versions.
The Simplest Thing that Could Work:
Create two isolated projects, one for the free, one for the paid.  When code sharing opportunities present themselves, just copy the files or sections of files across.  Do not rely on SCM or build conventions.  This works but as projects grow, it becomes more difficult to keep things straight and not overwrite changes unintentionally.

My Current Approach:

I’m working on my first free/paid application and I’ve decided to represent the two products (free, paid) as branches in a git repository.  In this case, I’m using master for free.  Since the Android market requires unique product IDs for each product, I use a Java package namespace that corresponds to the product ID for code that only belongs to one product, and a general Java package name for common code.  To migrate code from one version to another, I make careful commits of only the shared java namespace and use git-cherry-pick.  For now I’m using the command-line rather than egit.  I find it’s best to first get familiar with a particular git feature via the command-line tools.  Then any troubles encountered when using the GUI provided by egit can be better understood.

This so far is working out acceptably, but it’s not perfect.  It can be hard to remember to specify commits for specific in-common code, as required by cherry-pick.  Also, depending on how modular the code is, there can be a lot of refactoring to keep the code bases in-sync.

Another approach I may take in the future is to move all common code into separate Android library projects, and only have product-specific code live in actual project associated with the product.  This will reduce the amount of cherry-picking required.  On the downside it seems that the ADT Eclipse plugin has a proprietary  way of managing code in Library projects and changes to library code does not automatically propagate to downstream projects, until the entire workspace is rebuilt.  I’m hoping there is something I can do to fix this, because using the ADT Eclipse library feature is not very useful with this restriction.

Google searches didn’t turn up much for me, but I’d love to know what techniques others are using to solve this problem…


February 04, 2012

Stephan Herrmann
Stephan Herrmann

Help the JDT Compiler helping you! - 2: Resource leaks - continued

In my previous post I showed the basics of a new analysis that I originally introduced in the JDT compiler as of 3.8 M3 and improved for M5. This post will give yet more insight into this analysis, which should help you in writing code that the compiler can understand.

Flow analysis - power and limitation

An advantage of implementing leak analysis in the compiler lies in the synergy with the existing flow analysis. We can precisely report whether a resource allocation is definitely followed by a close() or if some execution paths exist, where the close() call is by-passed or an early exit is taken (return or due to an exception). This is pretty cool, because it shows exactly those corner cases in your implementation, that are so easy to miss otherwise.

However, this flow analysis is only precise if each resource is uniquely bound to one local variable. Think of declaring all resource variables as final. If that is possible, our analysis is excellent, if you have multiple assignments to the same variable, if assignments happen only on some path etc, then our analysis can only do a best-effort attempt at keeping track of your resources. As a worst case consider this:

  Reader r = new FileReader(f);
  Reader r2 = null;
  while (goOn()) {
     if(hasMoreContent(r)) {
        readFrom(r);
     } else {
        r.close(); // close is nice, but which resource exactly is being closed??
     }
     if (maybe()) {
        r2 = r;
     }             // at this point: which resource is bound to r2??
     if (hasMoreFiles()) {
        r = new FileReader(getFile()); // wow, we can allocate plenty of resources in a loop
     }
  }
  if (r2 != null)
    r2.close();

This code may even be safe, but there’s no way our analysis can keep track of how many resources have been allocated in the loop, and which of these resources will be closed. Which one is the resource flowing into r2 to be closed at the end? We don’t know. So if you want the compiler to help you, pretty please, avoid writing this kind of code :)

So what rules should you follow to get on terms with the compiler? To understand the mentioned limitation it helps to realize that our analysis is mostly connected to local variables, keeping some status bits for each of them. However, when analyzing variables the analysis has no notion of values, i.e., in the example the compiler can only see one variable r where at runtime an arbitrary number of Reader instances will be allocated, bound and dropped again.

Still, there are three special situations which the analysis can detect:

1
2
3
4
5
6
7
  Reader r = new FileReader("someFile");
  r = new FileReader("otherFile");
  r = new BufferedReader(r);
  Reader r2 = getReader();
  if (r2 != null) {
     r2.close();
  }
  1. In line 2 we’re leaking the instance from line 1, because after the assignment we no longer have a reference to the first reader and thus we cannot close it.
  2. However, line 3 is safe, because the same reader that is being dropped from r is first wrapped into a new BufferedReader and indirectly via that wrapper it is still reachable.
  3. Finally at the end of the example snippet, the analysis can see that r2 is either null or closed, so all is safe.

You see the compiler understands actually a lot of the semantics.

My fundamental advice is:

If the compiler warns about leaking resources and if you think the warning is unnecessary, try to better explain why you think so, first of all by using exactly one local variable per resource.

Resource ownership

Still not every method lacking a close() call signifies a resource leak. For an exact and definite analysis we would need one more piece of information: who owns any given resource?

Consider a group of methods happily passing around some resources among themselves. For them the same happens as for groups of people: diffusion of responsibility:

Well, no, I really thought that you were going to close this thing?!!?”.

If we had a notion of ownership we’d simple require the unique owner of each resource to eventually close that resource. However, such advanced concepts, while thoroughly explored in academia, are lacking from Java. To mitigate this problem, I made the following approximations of an ownership model:

  1. If a method allocates a resource, it owns it - initially.
  2. If a method obtains a resource by calling another method, it may potentially be responsible, since we cannot distinguish ownership from lending
  3. If a method passes a resource as an argument to another method (or constructor), it may or may not transfer ownership by this call.
  4. If a method receives a resource as a parameter, it assumes the caller is probably still responsible
  5. If a method passes a resource as its return value back to the caller, it rejects any responsibility
  6. If a resource is ever stored in a field, no single method feels responsible.
  7. If a resource is wrapped in an array we can no longer track the resource, but maybe the current method is still responsible?

In this list, green means: the compiler is encouraged to report anything fishy as a bug. Blue means, we still do the reporting, but weaken the message by saying “Potential resource leak”. Red means, the compiler is told to shut up because this code could only be checked by whole system analysis (which is not feasible for an incremental compiler).

The advice that follows from this is straight-forward:

Keep the responsibility for any resource local.
Do not pass it around and don’t store it in fields.
Do not talk to any strangers about your valuable resources!

In this regard, unclean code will actually cancel the leak analysis. If ownership of a resource is unclear, the compiler will just be quiet. So, do you think we should add a warning to signal whenever this happens? Notably, a warning when a resource is stored in a field?

The art of being quiet

Contrary to naive thinking, the art of good static analysis is not in reporting many issues. The art is in making yourself heard. If the compiler just rattles on with lots of uninteresting findings, no one will listen, no one will have the capacity to listen to all that.

A significant part of the work on resource leak analysis has gone into making the compiler quieter. And of course this is not just a matter of turning down the volume, but a matter of much smarter judgment of what the user might be interested in hearing.

By way of two recently resolved bugs (358903 and 368546) we managed to reduce the number of resource leak warnings reported against the sources of the Eclipse SDK from almost 100 down to 8. Calling this a great success may sound strange at first, but that it is.

At the level we reached now, I can confidently encourage everybody to enable this analysis (my recommendation: resource leaks = error, potential resource leaks = warning). The “Resource leak” problems indeed deserve a closer look, and also the potential ones could give valuable hints.

For each issue reported by the compiler you have three options:

  1. Agree that this is a bug
  2. Explain to the compiler why you believe the code is safe (unique assignment to locals, less passing around)
  3. Add @SuppressWarnings("resource") to tell the compiler that you know what you are doing.

But remember the nature of responsibility: if you say you don’t want to here any criticism you’d better be really sure. If you say you take the responsibility the compiler will be the humble servant who quietly forgets all worries.

Finally, if you are in the lucky position to use Java 7 for your projects, do the final step: enable “Resource not managed with try-with-resource” analysis. This was actually the start of this long journey: to let the compiler give hints where this new syntax would help to make your code safer and to make better visible why it is safe - with respect to resource leaks.

Final note: one of the bugs mentioned above was only resolved today. So with M5 you will still see some avoidable false positives. The next build from now should be better :)

I’ll be back, soon, with more on our favorite exception: NPE.

Gunnar Wagenknecht
Gunnar Wagenknecht

Eclipse at FOSDOM 2012

It’s my first out of two days at FOSDEM 2012. It took us quite a ride to get from the hotel to the ULB. We tried to order a taxi but the people at the reception told us that it would take at least 1.5 hours till a taxi arrives. Luckily, Mike and Andrew know someone who has been at FOSDEM a couple of times before. He guided us safely to ULB using a combination of walking, metro, tram and more walking.

We quickly setup an Eclipse stand over there and Mike, Andrew and myself are showing demos and talking to people. BTW, thanks to the FOSDEM organizer to have it well prepared so that we just needed to setup our banner and our notebooks for the demos.

So far we have a great mixture of questions from developers using Eclipse for their day-to-day work, programming questions of Eclipse plug-in developers and people interested in Orion. There are also people stepping by that have no questions – they introduce themselves as happy Eclipse users and appreciate what the committers of the various projects have built over time. Thanks for those kind words folks!

2-IMG_1242 4-IMG_1246 1-IMG_1241 3-IMG_1243

 

Stephan Herrmann
Stephan Herrmann

Help the JDT Compiler helping you! - 1: Resource Leaks

During the Juno cycle a lot of work in the JDT has gone into more sophisticated static analysis, and some more is still in the pipe-line. I truly hope that once Juno is shipped this will help all JDT users to find more bugs immediately while still typing. However, early feedback regarding these features shows that users are starting to expect miracles from the analysis :)

On the one hand seeing this is flattering, but on the other hand it makes me think we should perhaps explain what exactly the analysis can see and what is beyond its vision. If you take a few minutes learning about the concepts behind the analysis you’ll not only understand its limitations, but more importantly you will learn how to write code that’s better readable - in this case for reading by the compiler. Saying: with only slightly rephrasing your programs you can help the compiler to better understand what’s going on, to the effect that the compiler can answer with much more useful error and warning messages.

Since there’s a lot of analysis in this JDT compiler I will address just one topic per blog post. This post goes to improvements in the detection of resource leaks.

Resource leaks - the basics

Right when everybody believed that Eclipse Indigo RC 4 was ready for the great release, another blocker bug was detected: a simple resource leak basically prevented Eclipse from launching on a typical Linux box if more than 1000 bundles are installed. Coincidentally, at the same time the JDT team was finishing up work on the new try-with-resources statement introduced in Java 7. So I was thinking: shouldn’t the compiler help users to migrate from notoriously brittle handling of resources to the new construct that was designed specifically to facilitate a safe style of working with resources?

What’s a resource?

So, how can the compiler know about resources? Following the try-with-resources concept, any instance of type java.lang.AutoCloseable is a resource. Simple, huh? In order to extend the analysis also to pre Java 7 code, we also consider java.io.Closeable (available since 1.5).

Resource life cycle

The expected life cycle of any resource is : allocate—use—close. Simple again.

From this we conclude the code pattern we have to look for: where does the code allocate a closeable and no call to close() is seen afterwards. Or perhaps a call is seen but not all execution paths will reach that call, etc.

Basic warnings

With Juno M3 we released a first analysis that could now tell you things like:

  • Resource leak: “input” is never closed
  • Resource leak: “input” is never closed at this location (if a method exit happens before reaching close())

If the problem occurs only on some execution paths the warnings are softened (saying “potential leak” etc.).

Good, but

Signal to noise - part 1

It turned out that the analysis was causing significant noise. How come? The concepts are so clear and all code that wouldn’t exhibit the simple allocate—use—close life cycle should indeed by revised, shouldn’t it?

In fact we found several patterns, where these warnings were indeed useless.

Resource-less resources

We learned that not every subtype of Closeable really represents a resource that needs leak prevention. How many times have you invoked close() on a StringWriter, e.g.? Just have a look at its implementation and you’ll see why this isn’t worth the effort. Are there more classes in this category?

Indeed we found a total of 7 classes in java.io that purely operate on Java objects without allocating any resources from the operating system:

  • StringReader
  • StringWriter
  • ByteArrayInputStream
  • ByteArrayOutputStream
  • CharArrayReader
  • CharArrayWriter
  • StringBufferInputStream

For none of these does it make sense to warn about missing close().

To account for these classes we simply added a white list: if a class is in the list suppress any warnings/errors. This white list consists of exactly those 7 classes listed above. Sub-classes of these classes are not considered.

Wrapper resources

Another group of classes implementing Closeable showed up, that are not strictly resources themselves. Think of BufferedInputStream! Does it need to be closed?

Well? What’s your answer? The correct answer is: it depends. A few examples:

1
2
3
4
5
6
7
8
	void wrappers(String content) throws IOException {
		Reader r1, r2, r3, r4;
		r1 = new BufferedReader(new FileReader("someFile"));
		r2 = new BufferedReader(new StringReader(content));
		r3 = new FileReader("somefile");
		r4 = new BufferedReader(r3);
		r3.close();
	}

How many leaks? With same added smartness the compiler will signal only one resource leak: on r1. All others are safe:

  • r2 is a wrapper for a resource-less closeable: no OS resources are ever allocated here.
  • r3 is explicitly closed
  • r4 is just a wrapper around r3 and since that is properly closed, r4 does not hold onto any OS resources at the end.
  • returning to r1, why is that a leak? It’s a wrapper, too, but now the underlying resource (a FileReader) is not directly closed so it’s the responsibility of the wrapper and can only be triggered by calling close() on the wrapper r1.

EDIT: We are not recommending to close a wrapped resource directly as done with r3, closing the wrapper (r4) is definitely cleaner, and when wrapping a FileOutputStream with a BufferedOutputStream closing the former is actually wrong, because it may lose buffered content that hasn’t been flushed. However, the analysis is strictly focused on resource leaks and for analysing wrappers we narrow that notion to leaks of OS resources. For the given example, reporting a warning against r4 would be pure noise.

Summarizing: wrappers don’t directly hold an OS resource, but delegate to a next closeable. Depending on the nature and state of the nested closeable the wrapper may or may not be responsible for closing. In arbitrary chains of wrappers with a relevant resource at the bottom, closing any closeable in the chain (including the bottom) will suffice to release the single resource. If a wrapper chain is not properly closed the problem will be flagged against the outer-most wrapper, since calling close() at the wrapper will be delegated along all elements of the chain, which is the cleanest way of closing.

Also for wrappers the question arises: how does the compiler know? Again we set up a white list with all wrapper classes we found in the JRE: 20 classes in java.io, 12 in java.util.zip and 5 in other packages (the full lists are in TypeConstants.java, search for “_CLOSEABLES”).

Status and outlook

Yes, a leak can be a stop-ship problem.

Starting with Juno M3 we have basic analysis of resource leaks; starting with Juno M5 the analysis uses the two white lists mentioned above: resource-less closeables and resource wrappers. In real code this significantly reduces the number of false positives, which means: for the remaining warnings the signal-to-noise ratio is significantly better.

M5 will actually bring more improvements in this analysis, but that will be subject of a next post.

Roy Ganor
Roy Ganor

How My Wife Drives the Technology World

ok, maybe a better name would be "My Cloud-based-Social-enabled-Service-oriented Mobile Apps Experience", but that's a long name for a post :)

It started last week as a small-talk between my wife and me about sheattending so many shifts and medical sessions. According to my wife, she usuallytakes 4-5 shifts a month where the actual number is doubled (!). At that momentI had no tools to prove my point and here comes the requirements to build asmall mobile app for her to report shifts and sessions while being able towrite short notes about it (ok, she was asking this a longtime ago). In addition she usually posts some info on Facebook during her shifts so I had to connectthese reports somehow to her Facebook account. By the end of the month she hand a report about her shifts to the managers so this if the app could also print a summary it will be a big value for her.

Before sharing thoughts about my experience with this app development, here is how this app looks like on Android and iOS:


Mobile App
jQueryMobile (version 1.0) is really handy for creating cross-platform mobile interface, it provides easy to use APIs and is really covered well with lots of great examples. I had to use several other libraries like jQueryUrl, Moment.jsMustache, requireJS and jsPDF. With so many "out-of-the-box" libraries it is super easy to build robust solution for client side in minutes(!!!)

Social-enabled:
Facebook JavaScript SDK helped me with giving a more "social look and feel" after creating  a  Facebook application. I also used Facebook's OAth service authentication and Open Graph integration so users notify their friends about their activities with the "My Doctor Shifts" application. That's super important to engage the application users to your application!

Service-oriented (and Data-centric)
Zend Framework provides nice (lightweight) models representation and the MVC was useful to create the HTML view and services.

Cloud-based
Using  phpCloud was easy as always with plenty of slick workflows helping me to easily deploy my application and push updates to staging and testing targets. This way I always kept two versions that represent my Work in Progress and Done apps. I also got packages ready for deployed in case I want to deploy it to another Zend Application Fabric instance.

The application is available on github.

February 03, 2012

Doug Schaefer
Doug Schaefer

Eclipse C/C++ IDE reaches 750,000 downloads for Indigo-SR1

Markus Knauer
Markus Knauer

Eclipse Juno M5 and Indigo SR2 RC2

Two releases of the Eclipse EPP packages today:

The packages for Indigo SR2 RC2 (the second release candidate for the second service release of the Indigo release, based on Eclipse Platform 3.7.2) and the packages for this year’s Simultaneous Release Juno M5 (the 5th milestone based on Eclipse Platform 4.2) are available:

http://www.eclipse.org/downloads/index-developer.php

Please test and report any issues in Bugzilla. Especially the Eclipse 4.x team needs your help! The sooner bugs are found, the sooner they can be fixed!

One of the changes is the addition of Eclipse Code Recommenders to the Eclipse for RCP and RAP Developers package.

February 02, 2012

Denis Roy
Denis Roy

EclipseCon Poll: What do you think of the location change?

I haven't done a whacky poll in a long time, so there's no better time than now.

You all know that this year, our favourite Eclipse gathering is moving to a new location. After so many years in California, what do you think of this move?

Cast your vote by clickety-clicking the links below. I'll post up the results tomorrow.

http://eclipsecon.org/the-weather-better-be-warm-and-the-beer-cold.wbmstr

http://eclipsecon.org/yay-less-time-on-an-airplane.wbmstr

http://eclipsecon.org/oh-no-more-time-on-an-airplane.wbmstr

http://eclipsecon.org/if-its-not-in-california-im-not-going.wbmstr

http://eclipsecon.org/no-matter-where-eclipsecon-is-webmasters-will-still-buy-us-beer-right.wbmstr

http://eclipsecon.org/why-not-do-eclipsecon-in-(insert-tropical-exotic-location-here).wbmstr

Lars Vogel
Lars Vogel

Eclipse Community Awards voting open. Please vote

Just a small reminder, the Eclipse Community Awards is currently open for voting. Please vote: http://eclipse.org/org/press-release/20120130_awardsvote.php

I’m also nominated, as Eclipse Top Newcomer Evangelist :)

flattr this!

Jonas Helming
Jonas Helming

Modeling Symposium Submission Deadline

Hi,
Ed and I are organizing the Modeling Symposium for EclipseCon North America (see here). Thank you for all the interesting submissions so far. To notify people early enough about the acceptance of their submission, we need to set a final deadline to February 8th. Please make sure to send me your submission before this deadline.
Looking forward to your submissions!
Jonas

Blaise Doughan
Blaise Doughan

JAXB and Inheritance - Using XmlAdapter

In previous posts I have covered how to map inheritance relationships in JAXB. This can be done by element name (via @XmlElementRef), by the xsi:type attribute, or in EclipseLink MOXy using another XML attribute (via @XmlDescriminatorNode/@XmlDescriminatorValue).  In this post the type indicator will be an XML attribute/element unique to that type, and we will leverage an XmlAdapter to implement this behaviour.

Read more »

Jordi Böhme López
Jordi Böhme López

Accessing a very large data set with mobile devices

A few months ago my colleague, Ralf Sternberg, wrote an article on “how to access a huge dataset with the web browser“.  Now, if it’s possible to access very large datasets with a browser, wouldn’t it be really cool to access it in the same way with mobile devices?

As you may have heard, we launched RAP mobile two days ago. And, we did just that. With RAP mobile you can access exactly the same dataset with exactly the same code as in Ralf’s post. The dataset contains over 500,000 emails totaling over 2GB of space. Check out the screencast below and the source code on github.

What I find intriguing about this framework is that it is fast. There is no data on the phone. The information displayed in the UI is retrieved asynchronously from the server while the user is scrolling through this enormous set of data. The native iOS client takes care of the proper preloading, caching and memory management.

 

February 01, 2012

Orion
Orion

Orion Features in Firefox 10 and 11

Firefox 10 was released yesterday, and the release announcement highlighted developer tools such as the Orion-based Scratchpad as key features in the release. At the same time, Firefox 11 moved into their Beta channel. The Mozilla developer tools team released a cool video last week showing upcoming features in Firefox 11, such as a 3D Page Inspector, and a new Orion-based Style Editor. Scratchpad and Style Editor are the result of many months of close collaboration between the Mozilla dev tools team and the Orion Editor team. Congrats to Mihai, Kevin, and the rest of the Firefox team on another great release!

Jens von Pilgrim
Jens von Pilgrim

Dreaming of an Eclipse Plugin-Store...

or how to sell little tools for little money...

A while ago, I wrote a little tool for exporting UML-like diagrams for Java classes and packages to OmniGraffle. I blogged about that tool and, from my statistics, it got downloaded over 100 times. I also announced that the tool will stop working in 2012, which it actually did. As I wrote in the announcement of the tool, based on the feedback I wanted to decide whether to continue developing the tool or not.

So, what is the feedback after almost six months? There were a few comments, and about 150 downloads according to my logs. Although I installed a donate and Flatter button on my blog, I received no money at all. The natural consequence would be to stop developing (and providing) the tool.

Today, someone posted a comment as the tool has stopped working (just as announced). The commenter also wrote that he needs the tool to create some diagrams for him. Hmm... As I'm trying to be a good guy, I published an update of the tool working until June 2012.

I won't complain about people not giving any feedback or money voluntary. Instead I'm wondering how to make the tool available for a small amount of money. Actually, I don't know about any Eclipse tools to be sold for a couple of dollars/euros, except Log4E. Most tools are either freely available, or they are really expensive. Log4E comes in two versions: A free community edition and a so called "Pro" version for only €7,50. I have purchased that tool a long time ago, rather to support the author than urgently needing the additional features of the Pro version. However, due to the lack of Eclipse supporting this kind of "business model", it is rather complicated to install the license key (and keep it up to date with new Eclipse installations), and I figure managing licenses and payments to be time-consuming for the author as well.

Apple, and also Google, have successfully created systems enabling authors of software to make (little) money by selling there products very easily. Although I don't like the Apple way of approving software, I'm wondering if some kind of "Eclipse PluginStore" would be a good idea. People spend a lot of money on "apps", including a lot of small games. If buying a commercial Eclipse plugin would be as simple as purchasing an iPhone/Android app, would people do that? And how many programmers would publish their tools then? Maybe combining that kind of store with a BugStore (see "Should We Pay for Eclipse Bug Fixes?" for a summary of a discussion taken place in April 2010) would be a good idea as well...

As long as there is no Eclipse PluginStore available: How do you sell your tools?

January 31, 2012

Andrew Overholt
Andrew Overholt

Eclipse at FOSDEM

This coming weekend is FOSDEM in Brussels, Belgium. It will be my first FOSDEM and I’m really looking forward to it. Lots of my fellow Red Hat, JBoss, and Fedora colleagues will be there, too (list of talks by Red Hatters as a PDF and as HTML). Eclipse content this year includes:

“FOSDEM is the biggest free and non-commercial event organized by and for the community.” There’s no registration required, so if you’re in the area, swing by! There are a lot of people that I’m looking forward to seeing and having a beer with this weekend but I’m especially looking forward to seeing the ever-awesome Alex Kurtakov again and to meeting my new teammate Krzysztof Daniel in person for the first time.

Safe travels and see you in Brussels!

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

Update: Gregoire de Hemptinne pointed out his talk on an EMF-based declaritive UI system, Wazaabi.

Tom Schindl
Tom Schindl

e(fx)clipse 0.0.12 released

A little bit later than scheduled here’s the next release. This time the number of new features is smaller than in previous releases but there still some small nice additions. Let’s look into it.

Update to latest upstream modules

The new release comes with Eclipse 4.2M5. I also looked into up-dating the subclipse integration but at the moment the newest version is only provided for win32/64 and so I’m waiting until I can consume it from upstream. All other components (xtext, egit and mercurial) are unchanged.

Linux Support

As promised since the beginning. At the very moment the JavaFX 2.0 team provides builds for Linux e(fx)clipse will provide all in one downloads (one was able to install from the p2-site since the beginning). The JavaFX 2.0 Linux build provided is for 32bit and so is the e(fx)clipse all in one version you can download.

The linux support though is still a bit limited – the live preview (JavaFX-SWT-Integration) crashed my Eclipse instance.

CSS

Support for CSS 3 Selectors

I’ve added support for CSS 3 selectors as the screenshot below shows:

Support for LCD Text

I’ve added support for the newly introduced LCD Text support which is done in CSS using “-fx-font-smoothing-type”

It’s not really easy to follow which CSS-Attributes are added and sometimes the docs are not correct so if you encounter an attribute you definately know is working but the CSS-Editor marks it as an error file me a ticket.

Colors in CSS

I’ve added 2 things when it comes to colors inside the CSS-Editor. You can use a color picker instead of entering the rgb-value manually:

Thanks to Sebastian Zarnekow’s blog this was a piece of cake.

And for already existing colors the hover will display it:

FXGraph

Support for @DefaultProperty

Elements who mark one for their properties as the @DefaultProperty are now respected and you can omit the attribute-name for them making your the file more readable in many situations – whether you make use of this feature is up to you.

Support for Script-Value references

The syntax has been expanded to allow referencing of script values:

FXML

In this release it only received bugfixes. If you want to help with it file bugs, send me patches, … .

Converters

I’ve started working on SVG and FXG to FXML-Converters as I already outline in one my last posts my plan was to add them to e(fx)clipse to allow you converting those external formats to JavaFX 2.0 representations. You should not expect a lot for it as of now because they are in a very very early stage and as outlined in the above post JavaFX 2.0/2.1 (at least for SVG which I looked a bit closer) won’t provide enough API to implement a fully compliant convert as of now.

The main purpose to add them already today into e(fx)clipse is to receive feedback from you on problems you encounter. I hope you share the source SVG and FXG drawings with me or even provide a patch?

An interesting sidenote on this is that technically I’m transforming the source formats into an EMF-Model (there’s a specific one for SVG and one for FXG) and then do the conversion using xtend (a Eclipse and Java-Developer should get started with xtend within 30 minutes because the tooling feels so similar to your JDT-Editor).

Just one final sentence on FXG: Adobe if this is really the spec of a format I’m happy I never had work with your stuff – take a look at SVG-Spec on how I expect someone to define a (graphic) format.

Community Support

I’ve been receiving more and more mails to my private account and I’m always grateful to help but to not only put the burden on me I decided to open a google-group where people can ask questions, others can help too, … . I’ll try to update the fxgraph-reference as well but you know I’m doing this in my spare time and so things take time.

If e.g. you mastered the first steps in fxgraph and want to share your findings, don’t hesitate to send a message to above group. I’ll plan to add an extra page to http://efxclipse.org so that people have a central place to find informations. I’m happy for reviews in blogs (even if there are things you don’t like about e(fx)clipse I want to know them).

You can find the new group at: http://groups.google.com/group/efxclipse. Come, join and bring up ideas to make e(fx)clipse a success.

What’s cooking for the next releases

  • Bugfixes
  • Code improvements (make FXML and FXGraph use the same code base e.g. for content proposals)
  • EclipseCon preperation – If you haven’t seen this. We are going to demonstrate a JavaFX-e4-Application which live snycs with an SWT-e4-Application
  • SVG-Path-Editor based on Xtext naturally (the grammer is already in the git-repo)

Orion
Orion

Orion 0.4 M2 – New and Noteworthy

It has been another blockbuster milestone for the Orion project. This milestone brings extensive tooling improvements, including global search and replace, content assist for HTML, template completion for JavaScript, and CSS outline and error checking. The user interface has also had a major facelift with an eye toward giving more pixels to the most important content, and optimizing for mobile devices and touch displays. There is also a brand new user settings page, and a completely redesigned Git user interface. As always, you can give it a spin on OrionHub (sign up), or download your own copy. Read on below for more details.

Replace across multiple files

You can now replace matches across multiple files from the Search Results page. After performing a search, click Replace to open a slideout where the replacement text is entered. After entering the text, click Preview Changes to open a preview of all the matches to be replaced. From this page you can check or uncheck individual files or matches, and use next/previous diff buttons in the compare editor to cycle through your changes. Finally, click Commit to perform the replace.

Search results improvements

You can now navigate through search results using the Up and Down arrow keys on your keyboard. Push Right arrow to open a popup showing additional lines surrounding the search result, and Left arrow to close the popup.

Find File dialog improvements

There have been several improvements to the Find File dialog, accessed via Ctrl+Shift+R in the editor or by pressing ‘t’ on other pages:

  • When multiple matching files have the same name, the full path of each file is now shown to help you tell them apart.
  • Matching favorites now appear at the top of the list
  • You can navigate between search results using the Up and Down arrow keys
  • Matches are now sorted alphabetically

JavaScript content assist templates

JavaScript content assist in Orion now provides templates for common control structures. Simply invoke content assist with Ctrl+Space, and select from among the available templates that match your current cursor position. Templates have been added for:

  • for...in iteration over object properties
  • for loop over an array
  • while and do/while loops
  • if and if/else blocks
  • try/catch and try/catch/finally blocks
  • switch blocks

Some templates require you to fill in certain variables such as conditions or other values. Use Tab to iterate through the fields to be completed, and Enter to finish the template.

JavaScript content assist variable and argument completion

JavaScript content assist will now propose matching local variables and function arguments from all enclosing functions in the current script.

HTML content assist

Content assist has been added for HTML files. Invoking content assist in an empty file will produce a basic well-formed HTML 5 document. Completion is offered for all elements supported in HTML 5. Closing element tags are inserted where appropriate.

For lists and tables, completion will also insert the first list item or table row for you:

CSS Lint plug-in

Orion CSS Lint integration, previously available as a separate plugin, is now included by default in the set of plug-ins distributed with Orion. In addition, this plug-in now provides an outline view for CSS files.

New settings page

A new Settings page has been introduced. The JavaScript Editor tab allows customization of fonts and colors in the JavaScript editor. Note that changes take effect immediately across all editors you currently have open in the current browser.

The Plugins tab shows the set of installed plugins, and supports adding and removing plugins. This page will evolve to show further details about each plugin as well.

Navigator “Go up” command

A new command has been added to the Navigator page, allowing you to quickly navigate up to the parent of the current folder. Simply click Go Up, or use Alt+Up on your keyboard.

Background progress reporting

Orion can now report progress on multiple background operations at once, and even report progress on operations occurring in other frames and pages. This sounds simple, but anyone who has tried to do this on the web will realize how amazing this is. Click the progress button in the top right corner of the page to drop down a list of current and recent operations. From this list you can also visit a separate page showing a longer operation history.

A new Related Pages menu has been added to the page header. This allows you to quickly navigate between multiple pages that deal with the same file or folder you are currently viewing. For example, from the editor page you can now quickly jump to the Git Log page showing commits involving that file.

Revamped Orion header

The header at the top of each Orion page has been overhauled and cleaned up. Highlights include:

  1. More static information has been moved to the top of the header, and dynamic information has moved down to be closer to the content.
  2. The logo has been moved and shrunk to make more room for the header information you really care about.
  3. More room has been created for additional navigation features such as the new Related pages menu.
  4. Toolbars have been moved down out of the header into the most appropriate page area. For example the Save button and current line/column information is now in a bar directly above the editor rather than in the global header. One result of this change is that toolbars are still available when the header/footer are collapsed via Ctrl+Shift+M

For more information on the Orion UI design philosophy and direction, see the Orion Page Layout wiki page.

Customized tablet/mobile presentation

Orion styling has been tweaked to work much better on mobile devices. When using a display of 1024 pixels or less, we now pad the checkbox and twistie icons with more hittable breathing room.It is now much easier to check/uncheck boxes and invoke commands on a small touch screen. In addition, an editor problem with automatic uppercasing introduced with a recent iOS update has been addressed. The Orion editor now functions well again on iPad.

Fork me on Orion

Orion now uses URI templates to invoke commands on an Orion page using a URI. These commands are limited to altering the page layout such as opening input fields and dialogs. For example, you can now create a URL to initiate a clone operation on a particular repository. To see this in action, click Fork me on OrionHub to clone the Orion client code in your OrionHub account. Note you still need to manually click “Submit” after visiting the URL before the clone operation actually starts.

New git repository page

A completely new Git Repositories page has been introduced in this milestone. This replaces the previous deep tree structure with a flatter, more web-like presentation. Most basic commands are available at a glance without having to drill down, making the page much easier to use on touch and mobile devices. The Working Directory section shows at a glance what changes you have made that require staging or committing. The Commits sections shows all incoming commits that require merging, and all outgoing commits that have not been pushed to the current branch’s remote repository. There are further sections listing all branches, tags, and remotes for the current repository.

New git commit details page

A new Git Commit page has been introduced to accompany the new repositories page. Simply click on any commit from either the Repositories or Git Log page to open the commit details page. From here you can see all information about the commit, including author/committer, link to parent commit, associated tags, and diffs of all files modified by the commit. You can also tag or cherry-picka commit from this page.

Save and apply Git patches

You can now save unstaged changes as a patch to be reapplied later. From the Git Status page, simply select the files to be saved, and click Save Patch.

Saved patches can be applied later, or by another user, by clicking Apply Patch on the Git Repositories page. A patch can be applied either from an uploaded file, or from a URL (such as a bugzilla attachment).

Remove git tags

Git tags can now be removed. From the Git Repositories page, find the tag you want to remove and click Delete. Tag deletions can be pushed to a remote repository using the Push All command on the same page.

Automatic password reset

You can now associate an email address with your Orion account from your Profile page. Once the address is confirmed, it can be used to automatically reset your Orion password if you forget it in the future.

Server running Jetty 8

We have upgraded the neolithic Jetty version we previously shipped with the Orion Server. We are now running and delivering the most recent Jetty 8.1 from eclipse.org.

Enjoy!

Mickael Istria
Mickael Istria

Goodbye PetalsLink, hello JBoss|Red Hat !

Today is my last day working for PetalsLink.

Working for PetalsLink was a quite interesting experience:

On the technical side, I enjoyed moving all the XML-based tooling of PetalsStudio to a more powerful EMF-based approach for Petals JBI editor – for those who don’t know JBI, it is a standard that allows to define SOA artifacts in your ESB. Moving to EMF allowed us to provide better tooling faster, because most of the complexity in manipulating JBI can be removed with very few efforts leveraging EMF ExtendedMetaData. That was the first time I faced this part of EMF, and I got pretty impressed of how well it works (working with EMF always gives this impression of “being well”). I also improved the ability to plug new JBI components into the Studio, which is a critical point when you have to deal with connectors for almost everything – Mail, SFTP, Talend, XSLT…. So that was an interesting challenge in term of conception and development.
Petals Studio was also the pretext to start using Git, GitHub and Sonar. I am pretty happy to have learnt these 3 tools that clearly improved the way I work.

Also, I had the great opportunity to work closely to several Eclipse projects:

  • I could contribute the Tycho build of GMF Tooling, put it on Hudson, get source moved to Git/mirrored to GitHub, improve wiki… GMF Tooling is a project I’ve used for 3 years now and I often saw in it some critical organization points to improve to make it more dynamic in term of development. Working at PetalsLink gave me the opportunity to do what I think was necessary to keep the project healthy. With the help of Michael Golubev, I now think this was an real success.
  • I could contribute to Nebula the TreeMapper widget, which will probably have some very interesting use-cases soon. As I became a committer, I also helped in improving Tycho build and CI, nad it seems like the project liked it if we look at the new p2 update-sites.
  • I contributed some small improvements to Eclipse BPEL designer, tried (unsuccessfully) to make SWTBot use Tycho, and developed a useful extension for Draw2d.

The only thing I wish I would be able to do here is to push ahead the usage of Sonar at Eclipse, at least for GMF Tooling and Nebula.

But I probably learnt even more things from PetalsLink by discovering another company organisation that is very different from what I could experiment before (OpenWide and BonitaSoft): PetalsLink is focused on the Research about SOA and agility of Systems of Information. It is a wide topic! Petals products are quite good compared to other alternatives in the SOA landscape, but they don’t meet the success they deserve, it was a bit frustrating for a developer.

I enjoyed working for PetalsLink, all the expectations are fulfilled, so it is time for me to go ahead, to find a new experience, a new team, new challenges, new issues… I love discovering new things!

That’s why I’ll start working for JBoss|Red Hat tomorrow, as part of the team developing JBoss Tools and JBoss Developer Studio.

I’ll have the opportunity to work with a great team! My main occupation for the next monthes will be to assist Nick Boldt in making JBoss Tools CI and build infrastructure better and better. I’d also like to open the road towards efficient QA for JBoss Tools, including -among other- usage of Jacoco and Sonar. Then I’ll also work on developing nice stuff for some JBoss Tools modules, most probably on the SOA/BPM part.

That’s gonna be a lot of fun! I’m eager to be tomorrow and actually get started for this new team/employer/project/product/users.

Let’s keep in touch via this blog and twitter ;)


David Bosschaert
David Bosschaert

Backing up through FTP on a Mac

It's been a little over half a year now that I made the transition to mac. I was more or less forced into it by Dell because they didn't make the 1920x1200 high-res laptops any more that I like working with.
But I have to say, the Apple hardware is second to none - I haven't experienced any mysterious crashes since.

However I had to find Mac alternatives for all the software that I was using, and I managed to find most of what I was looking for quite quickly...

  • For viewing zip archives I currently use Zipeg, it only does extraction but that's good enough more most cases.
  • I really like Breeze for keyboard-based window alignment, similar to what Windows 7 has.
  • And I started using BetterTouchTool to map a keystroke the mousebuttons (saves me from having to press the touchpad all the time, which I don't really like).
  • I'm still undecided about iTunes, I don't really like it (e.g. it's missing a feature that shows what you're playing in the dock or something like that) but it kinda does what it needs to do and there doesn't seem to be anything better on the Mac, strangely enough...
  • Most other applications that I had been using before have Mac versions, except for...
... a backup solution! I was always using Areca in the past which works great and had both Windows and Linux versions available. I guess everybody on Mac simply buys a Time Machine but I wanted to use my existing network storage drive for my backups.

I found iBackup and used it for about half a year. It was seemingly able to do the work over a Samba mount to my network drive, although I did notice that I was getting many failure runs, in fact over half of the runs were failures. It might have been caused by the SMB implementation on my NAS drive, I don't really know but I noticed that it was having issues with relatively large files (over a couple of megs).
I started looking at using FTP to do the backups instead (my NAS drive supports FTP) but iBackup doesn't support that.

After looking around for a while I couldn't find any freely available backup option for Mac that uses FTP. I might have missed one or two, but in the end I started writing a little shell script to do the job. One of the things that I was worried about was the backup speed. My script logs in and out for every directory recursively so I was concerned that it would take much longer to complete than the SMB option. I was very surprised that for my data it took 9 minutes to complete, where the SMB-based option took several hours if it completed at all.

So here it is, a simple little bash script to backup any directory on your mac using FTP, I invoke it like this
example..
ftp-bku.sh ~/bin ~/docs ~/etc ~/utils
Note that I have my FTP credential in my ~/.netrc file so that I don't need to provide them in the script itself...

For those who are interested, you can find the script below (btw one thing that isn't completely reliable yet is the return code of the ftp program. It's 0 in some cases when there actually is a problem. Not sure if this can be fixed, although I could grep the output for error messages...)

FTPURL=ftp://User@192.168.1.24:2121
FTPBASEDIR=MyDir
TIMESTAMP=$(date +"%d%m%y-%H%M%S")
BACKUPDIR=backup_`hostname`_$TIMESTAMP
# Perform the actual FTP backup
function backup {
    PNAME="$1"
    DNAME="$2"
    ftp -i -V $FTPURL<<EOF
    bin
    cd "$FTPBASEDIR"
    mkdir "$BACKUPDIR"
    cd "$BACKUPDIR"
    lcd "$PNAME"
    mkdir "$DNAME"
    cd "$DNAME"
    mput *
    quit
EOF
    if [ "$?" == "0" ]; then
        echo Backup succeeded: "$BACKUPDIR"
    else
        echo Backup failed: "$BACKUPDIR"
    fi
}
# Backup the directory specified as $2 recursively where the base directory is $1
# So to backup /Users/david/etc/tmp as etc/tmp you pass in 
#  /Users/david/etc/tmp etc/tmp
function backup-dir {
    cd "$1"
    if [ -d "$2" ]; then
        BASE="$1"
        DIR="$2"
        BASELEN="${#BASE}"
        SUBDIR="${DIR:BASELEN}"
        TARGET="`basename "$1"`$SUBDIR"
        backup "$2" "$TARGET"
    fi
    cd "$2"
    for dir in *
    do
        if [ -d "$2/$dir" ]; then
            backup-dir "$1" "$2/$dir"
        fi
    done
}
# Staring point, backup all directories specified on the command line
for directory in "$@"
do
    backup-dir "$directory" "$directory"
done

Hendrik Eeckhaut
Hendrik Eeckhaut

Xtext resource caching: loading resources 5 times faster

Those who cannot remember the past are condemned to repeat it (George Santayana). I've always felt ambivalent about that quote. History never ever repeats itself exactly. In computer science on the other hand, it applies very well. In all our collective software applications, we recalculate the same results time and time again and are therefore faced with constant question to remember or not to remember. In this blog series, I'm going to talk about a cache for Xtext resources that we've developed over the past year.

read more

Philip Wenig
Philip Wenig

More than 500 OpenChrom downloads this month!

OpenChrom breaks the 500 download mark today! It’s the first time that OpenChrom has been downloaded more than 500 times in a month since its start in April 2010. Jippie!


Doug Schaefer
Doug Schaefer

Change, sometimes it just happens.

Well, it's been almost two weeks since my previous employer decided it was time for me to make a career change. Of course there's more to it than that but that's all I'm going to say about that. "It is what it is," and I'm actually pretty excited to see where my career takes me next.

While I'm an independent developer (which sounds much better than unemployed, no?), I have a few things I want to work on. Writing again in this blog is definitely one of them. It's been way too long and I've gotten used to spewing things in Twitter which is very handy but doesn't stay around long enough and isn't long enough to capture my thoughts in time. I have lots of opinions on things and it's good therapy for me to write them down.

The main technical area I continue to be very interested is, of course, Eclipse and the CDT. I've spent a lot of time over the last few months learning and thinking about usability and the importance of design and user experience. Pretending to be a newbie CDT user and walking through normal day-to-day activities shows me a few areas that need to be addressed. And since I'm still a CDT committer, I have the power to fix them.

I continue to be fixated with mobile and the new world that mobile UI and application architectures brings us. There's a reason these devices are flying off the shelves at your local phone and electronic store. They're so easy for the regular consumers to learn and use, and so powerful. It's that kind of user experience I'd like to see brought over to the desktop as well. I continue to follow the progress of Qt 5, which I believe can be a great framework not just for new desktop paradigms, but for mobile as well. It still seems to have a ways to go before it's stable, but I'm going to start experimenting with it as soon as I can get a build that works on my laptop.

The third area is a new one for me that I started chewing on in my spare time over the last few months, and that's web app development. Node.js has caught my eye as it has with numerous other developers. It's asynchronous programming model is very similar to the way we often program in embedded to produce scalable systems that react to events in the real world. While JavaScript is the cool thing in the web world these days, I have wondered whether we could provide similar APIs in a type-safe world, say using Java. People use Java on servers, no? And the convergence of server-side apps and mobile clients and embedded devices is a natural. It's the "Internet of Things".

So stay tuned for more over the upcoming days. As I mentioned, writing is good therapy, whether it be text in a blog or code in the exciting new world of mobile/web.

January 30, 2012

Wayne Beaton
Wayne Beaton

Vendor Neutrality in an Open Project

Imagine that you want to contribute to an open source project. You visit the project to browse the information provided by the project team and make your way to the downloads page. There, you discover that the downloads are hosted at a separate site owned and maintained by one of the project’s contributing organizations. Let’s say that the organization is a competitor of your own employer. Would you still want to contribute to that project? Would you feel invited to join? Would you feel that the project is open to your ideas?

Vendor neutrality is a tricky thing to balance. Organizations that contribute to open source deserve some recognition, but if you cross the line from recognition to vendor bias, you may end up turning away potential contributors and their contributions.

Splashing a few logos on a project page is a great way to provide recognition. Committer email addresses can very often also provide some amount of recognition. The trick is to stay on the right side of the line that separates “interesting; company X contributes a lot to this project” and “company X obviously owns and runs this project”. It can be very difficult to manage perception.

Vendor neutrality is a requirement that’s baked right into the Eclipse Bylaws:

The Eclipse technology is a vendor-neutral, open development
platform supplying frameworks and exemplary, extensible tools (the “Eclipse Platform”).

It’s something that we take very seriously. It’s not something, however, for which we have very many hard-and-fast rules. Managing vendor neutrality tends to be a subjective matter that is highly-dependent on perception.

For example, it’s generally acceptable for a project to include a link or two on their download page to software that is hosted elsewhere. Some projects do this to provide more complete packages that contain the project code along with value-add software. There’s nothing wrong with doing this, provided that:

  • the project code is accessible directly from the vendor-neutral eclipse.org download server;
  • the eclipse.org-based downloads are the prominent choice; and
  • there is a means for other organizations provide similar links to their project-related downloads.

Similarly, providing links to services related to a project can be helpful for the adopter community. Again, there’s nothing wrong with doing this, provided that the playing field is level. If a project chooses to provide links to services, it must be done in a vendor-neutral manner: other providers of similar project-related services must have a means of having their links included. It’s often enough to just document a reasonable set of conditions that must be met for another organization to list their services. Or you can just outsource the problem completely and include a link to services listed in the Eclipse Marketplace.

The Eclipse wiki provides further guidance concerning links to non-eclipse.org content.

Vendor neutrality is a big and important part of project diversity. If you are an Eclipse project, you have to care about project diversity. By extension, you have to care about vendor neutrality.


Eclipse Announcements
Eclipse Announcements

Voting is Open for the Eclipse Community Awards

Nominations for the Eclipse Community Awards are complete and voting has opened for the individual and project category nominees. Congratulations to all the worthy candidates! Show your appreciation to the people that have made Eclipse a stronger community by casting your vote.

Chris Daniel
Chris Daniel

Life-saving Eclipse functionality

As you know, I am working on Eclipse Fedora Build. Eclipse 3.8 ("almost M5") will get soon into Fedora Rawhide repository very soon.

Testing the build involved running new Eclipse and a number of of older packages, which included egit, jgit and others. My  local git repository got quickly corrupted (not sure yet why), so I created a patch, copied it into a safe place overwriting the previous one, deleted the repository, and cloned it again.

When I tried to apply the patch, it turned out that it was empty, and last couple days of my work was gone (because I happily overwrote the old patch).

Fortunately, Eclipse has a feature that deals with that kind of situations:


and then, a nice version selector appears:





My work was wonderfully resurrected!

Thank you, Eclipse!



Max Rydahl Andersen
Max Rydahl Andersen

JBoss Source Lookup

The JBoss Tools Source Lookup plugin automatically adds a source attachment when debugging JBoss AS servers.

The plugin has been tested with JBoss AS 7.x and JBoss AS 6.1.

 

Installing the JBoss Source Lookup plugin

 

https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/org.jboss.tools.as.sourcelookup.updatesite/

lookupblog1.png

Install the JBoss Tools Source Lookup category and restart Eclipse.

 

Using the JBoss Source Lookup plugin

 

 

The use and debugging of this plugin is demonstrated in the following screencast: Debugging JBoss AS server.

 

The JBoss Source Lookup plugin enhances source attachment in the following way:

 

  • archive file doesn't have to be in the maven classpath
  • archive file doesn't have to be included in the classpath (jbossweb-*.jar, for instance). The JBoss Source Lookup plugin will find a class within a JBoss AS distribution and, if it is a Maven artifact, the plugin will attach the corresponding source.
  • archive file doesn't have to be in the m2e index (jbossjts-4.16.0.Final.jar, for instance)

 

You don't have to add any JBoss AS Runtime to the classpath. I have added it in order to ensure the classes within the runtime are included in the Java Search and in order to be easier to add a breakpoint.

 

Debugging Apache Tomcat and Glassfish servers

 

The JBoss Source plugin can serve to debug other servers.

If a server includes mavenized archives, the JBoss Source container will find, download, and show source files.
I have tested the Apache Tomcat 7.0.25 and Glassfish 3.1.1.

 

If you want to debug Apache Tomcat and/or Glassfish, you have to do the following:

 

  • create some Apache Tomcat/Glassfish server

    lookupblog3.png

  • open the server editor

    lookupblog4.png

  • click Open launch configuration and select the Source tab

    lookupblog5.png

  • click the Add button and select the JBoss AS Source Container

    lookupblog6.png

  • JBoss AS servers will be automatically recognized and you can choose them by clicking a server
    As to other servers, you need to click the Choose Home button, select all the directories in which the server's archives are placed.

        If you debug Tomcat, you can choose $TOMCAT_HOME/lib.  When debugging Glassfish, you can choose $GLASSFISH_HOME/lib and $GLASSFISH_HOME/modules.
        You can add as many JBoss AS Source containers as you want.

lookupblog7.png

 

  • move a JBoss Source container(s) to the end (optional)

    lookupblog8.png

  • you can add a Server Runtime container to the project's classpath (optional)

    lookupblog9.png

  • start the server in the debug mode

    lookupblog10.png

    StandardWrapper.java is placed in the glassfish's web-core.jar.  
    The Source Lookup plugin finds this archive's source and shows it in the editor.

 

In a similar way you can debug Apache Tomcat server.

lookupblog12.png

The ApplicationFilterChain.java is placed in the Tomcat's catalina.jar archive.

 

 

The Source Lookup plugin finds source for a mavenized archive as follows:

 

  • using the m2e API
  • using the archive's metadata (META-INF/maven)
  • using nexus repositories that can be defined using the Source Lookup preferences page

    lookupblog11.png

 

The Source Lookup preferences page enables you to add/remove, enable/disable and/or change ordering of Nexus repositories.

You can see that the helloworld project I have used in this blog, is not a maven project (it doesn't contain the maven icon).
JBoss Source Lookup plugin can be used to debug any Java project.

 

The plugin doesn't have to be used for debugging only.

It will find, download and open a source file for a mavenized archive included in the classpath when double-clicking a class file in the Package Explorer view, opening it using Navigate>Open Type or some other way.

 

The JBoss Source Lookup plugin can be used for any Java project and any launch configuration.

 

Note: When starting debugging the first time, it could take some time until m2e updates indexes and the JBoss Source lookup plugin scans the container's directory.

Ayushman Jain
Ayushman Jain

Null Analysis for Fields with Eclipse JDT

It is common knowledge that Eclipse has an intra-procedural null analysis capability, augmented recently with null annotations for inter-procedural analysis in Juno M4. However, a big flaw and pain point till now was that the anlsysis would only work for local variables/parameters, and NOT for fields! Strange, innit? Well, a bunch of problems with handling fields prevented the initial null analysis implementation to be generic enough to handle fields as well. Access from different threads, through different objects, initialization of even final fields in different constructors were some of the roadblocks because of which this work was put on the backburner. However, even though we haven't found a holy grail to tackle these problems, we've come out with atleast a basic implementation of null analysis for fields! Rejoice!

A. The Problem
Prior to Juno M5, the following code snippet would raise null warnings only on the local variable, but not on the field.


B. The Solution
See the Juno M5 new and noteworthy page for the new null analysis for fields.
Note that for non-constant fields, we only raise "potential NPE" warnings even if the field has been assigned null or compared against null because we assume that there's always a chance of another thread modifying it between the assignment/comaparison and the actual reference. So consider the following snippet


C. Not quite there yet?
There are a few limitations with the current null analysis for fields:
  • Yet to be done for final fields that are initialized at the time of declaration. This will be done with the fix for bug 237236 soon.
  • The analysis only works for non-static fields of the current object or static fields of the current type ONLY. That means, in the following code snippet. you get null warnings on direct access of field1 or access via "this", but not if field1 is accessed via another object 'test'.
class Test{
   public Object field1;

   void foo(Test test) {
      if (field1 == null) { 
         System.out.println( field1 .toString());  // "potential" NPE warning
     } else {
        // do something
     }
     System.out.println(field1.toString());  // Potential NPE warning here

     if (this.field1 == null) { 
         System.out.println( this.field1 .toString());  // "potential" NPE warning
     } else {
        // do something
     }
     System.out.println(this.field1.toString());  // Potential NPE warning here
    // access through object 'test' will raise no warnings. See below

     if (test.field1 == null) { 
         System.out.println( test.field1 .toString());  // no warning
     } else {
        // do something
     }
     System.out.println(test.field1.toString());  // no warning


  }
}

This is a limitation of the current code analysis infrastructure and we hope to address this sometime soon. The soon to be released null annotations support for fields will greatly assuage this problem in the short term.

Please do start using this new feature. Even with its limitations, its quite useful and we've found a long list of unsafe code patterns in the Eclipse SDK itself. Deepak's post here presents one such example


Apart from this, Juno M5 has more interesting items. See my previous post on pre-built indexes, Stephan's post on Resource leak warnings and the Juno M5 new and noteworthy page for more.

Stay tuned!



Bryan Hunt
Bryan Hunt

Google Summer of Code 2012 with Xtext, EMF, and MongoDB

The Eclipse Google Summer of Code for 2012 will start coming to life soon, and I have an idea for a project involving Xtext, EMF, and MongoDB.  Ed Merks and I have created a project called MongoEMF that allows you to persist EMF objects to MongoDB.  MongoEMF has the ability to query objects based on attribute and reference values, but is lacking some functionality and robustness.  We think a re-write of the query engine using Xtext and EMF would make for a great Google Summer of Code project.  This project has a very well defined scope, is easily unit tested, and involves some pretty cool technology.

The project will consist of two major parts.  The first will be to define a query grammar (possibly re-using an existing grammar) using Xtext.  The result will be an EMF query model that can be serialized and de-serialized to a string.  The string will be used as the query portion of a URI, and must be human readable.  For example:  mongo://host/db/collection/?(tag == ‘java’ || tag == ‘JSON’) && (category == ‘Eclipse’).  Clients will be able to specify the query as string or EMF model.  The second part of the project will be to create a processing engine that builds a MongoDB query from the EMF query model.  The result will be a DBObject that can be sent to MongoDB as a query.

An example use-case is as follows:  A client constructs an EMF query model.  The query model is then serialized to a string and included in a URI.  The URI is sent to a server in a HTTP GET call.  The server extracts the query string from the URI and re-builds the EMF query model.  The query model is passed to the query engine and a DBObject is returned containing a MongoDB specific query.  The DBObject is sent to MongoDB resulting in some number of DBObjects returned.  The resulting DBObjects are converted into EMF objects and returned to the client.

The student is expected to develop extensive unit tests for his / her code as well as end-user documentation.  Documentation will be contributed to the UserGuide on the MongoEMF wiki.  We also anticipate that the student will become a committer on MongoEMF, and will continue to provide bug fixes and enhancements after the project is complete.

We consider this to be an advanced Eclipse project.  The student should already be comfortable coding in Java and developing OSGi bundles with Eclipse.  A student with working knowledge of EMF will be preferred, but you are not required to already know Xtext or MongoDB.  If you are interested in this project, I would recommend forking the MongoEMF project on GitHub and experimenting with the latest code in the master branch.  Instructions for setting up your environment can be found on the Development wiki page.  If you have any questions, please comment on this post.

This project idea will be included on the Eclipse Google Summer of Code wiki soon.


Annamalai Chockalingam
Annamalai Chockalingam

Eclipse Spykit V2 Available

Hey Guys

Thanks for all your support to Eclipse Spykit V1.
Having had all the information on a tabular fashion, we thought as Architects, as Designers, as Code Reviewers ... you wouldnt want to get into details straight away. You would want to start from Summary, to breakup and then to details.

Eclipse Spykit V2, is an attempt to present the same data as in V1 in a more pictorial manner and zoom out to provide you with the summary of Startup Information.

Here is the screenshot of Eclipse Spykit V2.


Please visit http://code.google.com/a/eclipselabs.org/p/eclipse-spykit/
Code is available for Download on SVN.
Binary is available for Download on Downloads Page.

Looking forward to get the same response as earlier and also this time more issues and bugs and enhancements and recommendations.

Regards
Malai

January 29, 2012

Jan Kohnlein
Jan Kohnlein

Impressions on GEF

For the Generic Graphical View project I've been digging deep into the Graphical Editing Framework (GEF) lately. GEF is the base technology below almost any graphical framework in the Eclipse environment. I wanted to keep the tool stack as low as possible and have the maximum control on everything so I decided to use GEF directly. Here are my impressions.

I really like GEF's base architecture: The separation between Draw2D and GEF, the concepts of Tools, Requests, EditParts and EditPolicies. It helps you to find the component to change in order to implement a new feature quickly. The pictures in the GEF online help really help
understanding this.


Pecularities

In some areas GEF appears to be kind of rusty. A whole bunch of relevant commercial products has been relying on it for years. Long term backward API compatibility has taken its toll. Some things definitely need a serious overhaul and often a better naming. I am very happy to hear that a 3.0 version is planned. Here is my wishlist for improvements:
  • Make coordinates double by default. Integer coordinates often result in rendering glitches due to rounding errors and are not well suited for scaling.
  • Add alpha channel (transparency) support.
  • Revise scaling of fonts: Sometimes a label's bounds don't match its text's extend.
  • Rename methods of the update mechanism. I am often confused about the semantics validate(), invalidate(), invalidateTree() or revalidate().
  • Rectangular bounds are not well suited for round things like ellipses. Similar to that, clipping child figures only makes sense for Viewports but nothing else. The need of an invisible container figure for side affixed children is really an ugly workaround.
  • Diagram layout does not take connection labels into account.
  • Add support for curve connections.
  • The feedback figures - the surrogates when a figure is moved or resized - seem to come from a time where hardware graphics acceleration was pure luxury. If you have nested edit parts you might have to reimplement the nested figure construction twice for nicer feedback.
  • Using a bit less inheritance and more composition would be fine.


Mutable Geometric Primitives

As many other graphics frameworks, GEF code tries to create as little new objects as possible. Geometrical primitives such as points, dimensions and rectangles are therefore mutable and reused often. There are even things as a static Rectangle.SINGLETON for temporary calculation. This pretty much reminds me of good old C++. I am not sure whether such optimization is still necessary. It results in pretty unreadable code:
Point p = figure.getLocation(); 
// p is the location in local coordinates
p.getParent().transformToParent(p);
// now p is in parent coordinates
Point q = p.add(p).scale(2):
// this will also modify p
You see: As the semantics of the variable changes, it is no surprise you cannot find a more expressive name than p. In addition, you have to be very careful if you are dealing with a reference or a copy. Modifying a Translatable (once again bad name, as Dimension also implements this interface) directly can also circumvent an event mechanism. This is really error prone. I'd strongly advise to introduce immutable primitives.


Coordinate Transformations

The way transformation between local, global and parent coordinates are handled is somehow unsuggestive. I've used various 2D and 3D scenegraph-based frameworks but I never got as confused with coordinates as in GEF. For example, if you have a ScalableLayeredPane showing some scaled content, its translateToAbsolute(Point) method will not take the scaling into account while translateToParent(Point) will.


Some Hints

Starting with GEF from zero is hard. You will likely spend a serious amount of time debugging why your diagram doesn't show anything at all. Better copy some basic setup from one of the GEF examples. Here are my favorite pitfalls:
  • missing minimum size on figure - figure does not show up at all in some layouts
  • wrong coordinate system - figures don't appear where they should, somtimes in nirvana
  • wrong layout manager, e.g. a plain XYLayout on a FreeformFigure - results in endless layout loop
  • reusing a geometry element instead of making a copy - completely unpredictable editor behavior
  • the default ChangeBoundsRequest does not take local coordinate systems into account
For better diagram layout algorithms the KIELER project offers a good choice.

January 28, 2012

Ayushman Jain
Ayushman Jain

Faster Java search using pre-built indexes with Eclipse JDT

JDT indexes referenced libraries (or JARs) in your projects for use in the Java search. However, in most cases these libraries seldom change, and the indexing may be costly and take time when you invoke search for the first time after adding the JAR on the buildpath.

From 3.8M5 onwards, you can avoid this redundant indexing by providing a pre-built index for each classpath entry in the classpath container. This feature was recently implemented in bug 356620.

So how do you generate the indexes in the first place?
1. Create the JAR
2. Go to Run Configurations>Eclipse Application. Give a name to the configuration, viz. indexer, and in 'Main' tab choose Run an application, and use the list to select org.eclipse.jdt.core.JavaIndexer

3. Go to the 'Arguments' tab and use the arguments -option <indexFileLocation> <jarFileLocation> in addition to the existing ones.

4. The index file will be generated at the specified location.

Now when the JAR in question is being added to the build path of a project, the classpath containers can add the index location to classpath, which will look as follows:

<classpathentry kind="lib" path="C:/Users/IBM_ADMIN/Desktop/TestIndex.jar">
<attributes>
<attribute name="javadoc_location" value="file://C://abc"/>
</attributes>
</classpathentry>

Voila! JDT will no longer index the JAR and even the first search will be lightning fast!

Note: This feature is mainly intended for plug-ins that implement their own classpath container, not for the end user.

Holger Voormann
Holger Voormann

How to use Vex as a Widget – Article in Eclipse Magazine

Florian’s article on how to use Vex as an editor widget has just been published in the German Eclipse Magazin 2.12. In a sample dialog Vex is used to enter Wiki text in the WYSIWYG way.

Vex is a pure SWT widget and doesn’t require any web browser. It’s an alternative to the solution FCKEditor in a browser widget which Thomas Kratz recently described in his post.

Vex is an acronym for Visual Editor for XML. With Florian’s WYSIWYG Wiki editor we have to rename Vex into Vest: Visual Editor for structured text. ;-)


Flattr this


January 27, 2012

Ekkehard Gentz
Ekkehard Gentz

mobile development – my next sessions + events

here’s an overview of my upcoming sessions and events and I would be glad to meet you there:

M-Days – Frankfurt, 2012-02-01: Location Based Services

At the Mobile Days in Frankfurt I’m talking about Location Based Services. In many of my customer projects I’m using Location Based Services, have integrated Maps, track GPS etc. I’ll talk about good practices, tips and tricks and demonstrate some of my work. You’ll find me at Developer Stage 1 on Wednesday 2012-02-01 at 13:00.

In the night I’ll also attend the Mobile Media Night ;-)

At M-Days I’ll first time use my new Camholder from Heiko Behrens (@HBehrens) – will later blog about my experiences with heikos awesome new product.

BBDevCon Europe – Amsterdam, 2012-02-08: SuperApps

Only some days later I’ll speak at BlackBerry Developer Conference about developing Super Apps. I’m happy to meet some friends again and looking forward to get the newest informations about BB10 – the future OS for BlackBerry.

Mobile Developer Conference – HH, 2012-02-15: Push Services

More and more mobile applications are using Push Services. Unfortunately there’s no common API and so you have to know the differences and what’s possible on the different platforms. I’ll talk about PushServices for Apple, Google, Microsoft and RIM.

Mobile Tech Con 2012 – Munich 2012 – 2012-03-29: Power Workshop Cascades

Next MobileTechCon is in Munich – not far from Rosenheim, where I work and live. I’ll present a full-day Power Workshop about the new UI Framework Cascades from RIM. With Cascades you can write great apps in a short timeframe with awesome animations. Designers and Developers can work hand-in-hand: a PlugIn for Photoshop allows you to easy move graphical work and drag it into your QML Editor. Cascades is one of te reasons why I as a developer am sure, that RIM will came back in 2012. Using Cascades you can develop Applications for PlayBook 2.x and also upcoming BB10.

EclipseCon America 2012 :(

Unfortunately this time I cannot travel to EclipseCon America, because exactly same week there’s MobileTechCon in Munich.

But of course I’m developing the BlackBerry Conference App for EclipseCon 2012 and hope that the timing is better next year.

—————————————————————————————————————————

(c) 2012 Creative Commons License 3.0 (BY-NC-SA) by  ekkescorner 


Filed under: Blackberry, EclipseCon, mobile

Birt World
Birt World

BIRT Runtime Addition

As part of the 3.7 release BIRT now uses a BIRT POJO runtime. This change was described in the BIRT 3.7 New and Notable. If you are using a version of BIRT prior to 3.7 be sure to check out the Migration Guide. As part of the 3.7.2 release of BIRT which will be released in a couple of weeks, the team has decided to release a second runtime that uses the OSGi runtime. This new download will function similar to the BIRT runtime prior to BIRT 3.7 and is available on the full downloads page. You can try out the 3.7.2 release candidate version of this download by selecting the release candidate on the recent builds page.

Dave Carver
Dave Carver

Does Popularity = Success?

Does the current popularity of an open source project, automatically mean that it is successful?   It can but how do we define successful for an open source project?

Just because a project is popular does not necessarily mean that it is successful.  It just means at that point in time and duration it is also getting a lot of attention.   I’ve been involved with a wide variety of open source projects over the last 15 years.  Several I’ve started. Several I’ve participated in from both as a community member and as a committer.   Some I would say have been popular at one point or another, other’s I would say never hit the “High School” popularity meter thresh hold.

Popularity is defined by Merriam-Webster’s Learner’s dictionary as, “state of being liked, enjoyed, accepted, or done by a large number of people : the quality or state of being popular”.

Successful is defined as “having the correct or desired result.”   So being successful does not necessarily equal popularity.   A successful open source project is one that has met its desired goals and objectives.   One of them could be, to become popular, and blogged about, and tweeted about constantly, but the winds of popularity change at a moments notice.  Success lasts for as long as the project is meeting its stated goals.

Success is defined by the commiters and the community that forms around the project.  Is it meeting its user’s needs?  Is it growing its user community and committer base?  Is it adapting and changing to meet knew requirements?   These are just some of the criteria that a project can be measured on to be successful.  Yes, popularity can be one criteria, but it should not be the sole deciding factor.

We need to be careful on tying success to popularity alone.   There are many projects out there that I would consider successful that have never hit the popularity threshold.  Those projects may not be used by Millions of people, but they have built a community around their project, and provide value to that community.   How many people are using it, or number of companies that have adopted it, should not take away from the success of the project if it has met its objectives.

So success is going to mean different things to different people.  There is no one way to measure if project is successful.  To me, if your project even gets a handful of people forming a community around it, you are already successful.


January 26, 2012

Deepak Azad
Deepak Azad

Weird code pattern in Eclipse SDK

In recent Juno milestones JDT has added several new static analysis capabilities - resource leak detection (Juno M3), annotation based null analysis (Juno M4), null analysis for fields (Juno M5). This week I have been testing these new features on the entire Eclipse SDK source code. 

While there are quite a few 'gems', the following code pattern occurs quite frequently. If the object can be null at the first if condition, how is it magically guaranteed to be non-null at the second if statement?  :-)


As Stephan mentioned in his blog today - Help the JDT Compiler helping you. Please start using the new static analysis options and report any issues you find. In the process you will certainly make improvements to your code as well.

Eclipse Announcements
Eclipse Announcements

EclipseCon 2012 Gold Sponsors Announced

The Eclipse Foundation is pleased to announce the Gold sponsors for the upcoming EclipseCon 2012 conference in Reston, Virginia on March 26-29, 2012. Actuate, IBM, Oracle, Red Hat and SAP have all agreed to be the premier sponsors of the annual Eclipse community event.

Chris Daniel
Chris Daniel

Fedora Eclipse Build: Introduction

It has been almost a month, since I stared my work for Red Hat.

I am taking care of Eclipse Build, which is even more complicated than regular Eclipse build (yes, Kim, that *is* possible).

The first and the most important assumption of Linux Eclipse Build is: no binaries allowed.

Some people call that kind of builds liberating. That is the last word that I'd use now ;-).

I will describe nuances that I have met during preparing Eclipse Juno for Fedora 17 in the following posts, but right now I'd like to mention just the first issue I have met:

If you want to build Eclipse, you need a builder, namely, a PDE Build. It looks like a chicken an egg problem, and the only solution is to build the builder using ant and OpenJDK. There is only one problem with that (OK, one serious problem and a lot of smaller ones that I will skip for now): Eclipse Java Compiler is not consistent with OpenJDK javac, or, stating it more clearly, JDT code cannot be compiled with javac.

That's not a big technical problem, as patching the source code before the build and making it javac compatible (and JDT incompatible) is not a very difficult thing, but it is open a rather serious question.

How does it come to the situation, where you cannot build Eclipse from scratch, but you have to use binaries to build Eclipse? Isn't it a bit against open-source philosophy? Today need we just Eclipse Compiler, which cannot be built (unless customized) from source. Tomorrow may we depend on something far less open.

Would not it make sense to put a requirement on Eclipse that some core plugins must compile with OpenJDK? I do not expect here mirroring all OpenJDK bugs in Eclipse compiler, but at least allowing for true open source build of it...

Here is a bug for those of you who are interested in the cause of the javac problem when building JDT.

In the next post: do Orbit users get what they expect?

EDIT: here is the link to the patch that makes JDT compile with OpenJDK.

Tasktop Team
Tasktop Team

Why I joined Tasktop

I’ve long been an admirer of Tasktop, for a number of reasons: First, as Eclipse users already know, Tasktop has built some really cool Eclipse technology, including the Mylyn task-focused interface. But many companies have built cool open source tools. It’s much harder to take those tools and build a growing, dynamic company around them. But plenty of companies have also done that, usually by following the standard open source business model: package services and a bit of value-add around a captive open-source offering, and wait for customers. Tasktop takes a far more challenging and rewarding approach: It nurtures a healthy open source eco-system around core technologies, but then re-imagines and re-purposes them, leveraging unique products that address real customer pain. That takes real vision, and to me it’s a clear signal that the Tasktop leadership is able to imagine and execute at an entirely different energy level.

So rather than admire Tasktop from a distance, I joined it! I first worked with Tasktop last year as a consultant developing the initial implementation of what has become the Mylyn Model Focusing Tools project. That was a great opportunity to get to know some of the team and the Tasktop way. Everything I saw then fit nicely with what I’d already intuited. We have a really great combination of engineering excellence, creativity and lightweight organization.

It’s nice to say “we” again — I hadn’t realized just how much I’d missed having colleagues to work together with on challenging problems. The morning I joined Tasktop, I saw a stream of emails from everyone welcoming me to the team. I must admit to some cynicism about the whole “team” thing — like so much else, it can be an empty word that doesn’t match up to reality — but in this case it feels very genuine. So heartfelt thanks to everyone.

It’s an exciting time to be building software tools. It might sound funny, but I like to think of software development as a helping profession. That’s because I think that software products really can help people live more fulfilling, interesting and even happy lives. When I tell my family and non-techie friends that I’m working on Automated Lifecycle Management (ALM) tools I get a blank look. So instead I remind them that almost everything we do relies on software and that software programs are by far the the most complex artifact that humans have ever created. And I tell them that software development communities are growing ever more diverse, distributed, interwoven and complex. So what do we do at Tasktop? We build software that embraces those complexities.

Tasktop Dev tackles the issue of software complexity. It handles a lot of the repetitive and boring stuff, simplifies and clarifies everything else, and is deeply and imaginatively integrated with other development tools. Tasktop Sync and Code2Cloud — along with other exciting tools that we’re working on — tackle the even more challenging issue of community complexity. Even a relatively small software product might involve code developed by a rich community spanning companies, technologies, continents, and even (think about the Open-Source movement) different economic models and incentive systems. And in larger projects thousands of developers might be collaborating across all of these dimensions. Software development efforts are intimately connected with customers, management, marketing, support, regulators and every other imaginable kind of stakeholder. All of these people need to talk to one another, and it seems that everyone uses different tools to manage the unique aspects of their tasks or work environments. Tasktop builds software that helps those tools to work together so that everyone can focus together on the stuff that matters. In short, we break down boundaries and help people communicate. That’s worth doing.

January 25, 2012

Chris Aniszczyk
Chris Aniszczyk

Kepler

Just to let everyone know, some members of the eclipse.org community recently voted on naming the next simultaneous release after Juno gets released in June 2012. Taking input from the community, the Eclipse Planning Council finalized the name to be Kepler.

Personally, I think it’s a great choice and a nod to Johannes Kepler.

January 24, 2012

Felipe Heidrich
Felipe Heidrich

How to load content in your IFRAME

When we started the TextView we used an IFRAME as the top most element.Over the time we changed the way we load the content of the IFRAME a few times, in this blog I will go over what we learnt in the process.
In our first version we made the entire initialization of the text view synchronous. That was done using this strategy:


var iframe = document.createElement("IFRAME");
parent.addChild(iframe);
var frameWindow = iframe.contentWindow;
var frameDocument = frameWindow.document;
var html = "<!DOCTYPE html><HTML><HEAD>";
for (var i = 0; i < stylesheets.length; i++) {
var objXml = new XMLHttpRequest();
objXml.open("GET", stylesheets[i], false);
objXml.send(null);
html += "<STYLE>" + objXml.responseText + '</STYLE>';
}
html += "</HEAD><BODY></BODY></HTML>";
frameDocument.open();
frameDocument.write(html);
frameDocument.close();
// call method to create all other elements
createElements(frameDocument.body);
This method works on all browsers but is not without limitations.
First, it is possible that iframe.contentWindow is undefined. This happens when the parent is not connected to the DOM.Another similar problem is that the parent (or an ancestor of it) can be hidden, in which case the browser can choose to notapply any styling to it.

The second problem is using STYLE instead of LINK to include the css files. In order to use STYLE we need to download all the filessynchronously one after the other. Another problem using STYLE is that all the URIs in the CSS are relative to the page base URI, which causes problemsduring deployment.

The solution for these problems is to wait for the load event of the iframe to write the html and to use LINK to include the css files:


var iframe = document.createElement("IFRAME");
var iframeLoaded = false;
iframe.addEventListener("load", function() {
if (iframeLoaded) return;
iframeLoaded = true;
var frameWindow = iframe.contentWindow;
var frameDocument = frameWindow.document;
var html = "<!DOCTYPE html><HTML><HEAD>";
for (var i = 0; i < stylesheets.length; i++) {
html += "<LINK rel='stylesheets' type='text/css' href='" + stylesheets[i] + "'></LINK>";
}
html += "</HEAD><BODY></BODY></HTML>";
frameDocument.open();
frameDocument.write(html);
frameDocument.close();
createElements(frameDocument.body); // BAD CSS is not done loading
}, false);
parent.addChild(iframe);
This code is step forward, it solves the problem when iframe.contentWindow is undefined.Using LINK also means that all files are downloaded in parallel and there is no problems with relatives URI inside the CSS.

The main problem with the code above is that the CSS are not loaded at the time body is being accessed. The solve this problem our initialsolution was to use the load event for the frameWindow:


var iframe = document.createElement("IFRAME");
var iframeLoaded = false;
iframe.addEventListener("load", function() {
if (iframeLoaded) return;
iframeLoaded = true;
var frameWindow = iframe.contentWindow;
var frameDocument = frameWindow.document;
var html = "<!DOCTYPE html><HTML><HEAD>";
for (var i = 0; i < stylesheets.length; i++) {
html += "<LINK rel='stylesheets' type='text/css' href='" + stylesheets[i] + "'></LINK>";
}
html += "</HEAD><BODY></BODY></HTML>";
frameDocument.open();
frameDocument.write(html);
frameDocument.close();
var windowLoaded = false;
frameWindow.addEventListener("load", function() {
if (windowLoaded) return;
windowLoaded = true;
createElements(frameDocument.body);
}, false);
}, false);
parent.addChild(iframe);
Here is where things get ugly, there are number of problems:

  • Firefox does not send any load events when document.write() is called from the iframe load handler.
  • calling document.write() not from the iframe load handler causes Firefox to change the navigation history.
  • Chrome some times does not fire load events for the iframe window (when navigating back or forward).
  • Safari sends the load event for the iframe before the CSS is loaded.
  • Webkit sends the load event for the iframe before the CSS is loaded, adding a SCRIPT element after the last LINK element fixes it for Webkit.
To workaround the problems listed above the next version includes a timer:


var iframe = document.createElement("IFRAME");
var iframeLoaded = false;
iframe.addEventListener("load", function() {
if (iframeLoaded) return;
iframeLoaded = true;
var frameWindow = iframe.contentWindow;
var frameDocument = frameWindow.document;
var html = "<!DOCTYPE html><HTML><HEAD>";
for (var i = 0; i < stylesheets.length; i++) {
html += "<LINK rel='stylesheets' type='text/css' href='" + stylesheets[i] + "'></LINK>";
}
html += "<SCRIPT>var waitForStyleSheets = true;</SCRIPT>";
html += "</HEAD><BODY></BODY></HTML>";
frameDocument.open();
frameDocument.write(html);
frameDocument.close();

var done = false;
frameWindow.addEventListener("load", function() {
if (done) return;
if (frameDocument.readyState === "complete") {
done = true;
createElements(frameDocument.body);
}
}, false);
var createTimer = function() {
if (done) return;
if (frameDocument.readyState === "complete") {
done = true;
createElements(frameDocument.body);
} else {
setTimeout(createTimer, 10);
}
}
setTimeout(createTimer, 10);
}, false);
parent.addChild(iframe);
The version above is almost our current solution. Except that it does not work on Firefox. For some reason, on Firefox the frameDocument.readyState stays permanently set to "interactive" when document.write() is called from the iframe load handler. The only way we found to detected that all CSS are loaded was checking the cssRules of each stylesheet (thank you Mihai).


var iframe = document.createElement("IFRAME");
var iframeLoaded = false;
iframe.addEventListener("load", function() {
if (iframeLoaded) return;
iframeLoaded = true;
var frameWindow = iframe.contentWindow;
var frameDocument = frameWindow.document;
var html = "<!DOCTYPE html><HTML><HEAD>";
for (var i = 0; i < stylesheets.length; i++) {
html += "<LINK rel='stylesheets' type='text/css' href='" + stylesheets[i] + "'></LINK>";
}
html += "<SCRIPT>var waitForStyleSheets = true;</SCRIPT>";
html += "</HEAD><BODY></BODY></HTML>";
frameDocument.open();
frameDocument.write(html);
frameDocument.close();

var done = false;
frameWindow.addEventListener("load", function() {
if (done) return;
if (frameDocument.readyState === "complete") {
done = true;
createElements(frameDocument.body);
}
}, false);
var createTimer = function() {
if (done) return;
var ready = false;
if (frameDocument.readyState === "complete") {
ready = true;
} else if (frameDocument.readyState === "interactive" && isFirefox) {
var sheets = frameDocument.styleSheets;
if (sheets.length === stylesheets.length) {
var index = 0;
while (index < sheets.length) {
var count = 0;
try {
count = styleSheets.item(index).cssRules.length;
} catch (ex) {
//invalid access error means the css is not loaded
if (ex.code !== DOMException.INVALID_ACCESS_ERR) {
//other errors, like network security, assume the css is loaded
count = 1;
}
}
if (count === 0) { break; }
index++;
}
ready = index === sheets.length;
}
}
if (ready) {
done = true;
createElements(frameDocument.body);
} else {
setTimeout(createTimer, 10);
}
}
setTimeout(createTimer, 10);
}, false);
parent.addChild(iframe);

This is all the code that was needed to load the content into the iframe - somewhat extreme if you'd ask me. Probably the most pertinent question is why we are using an iframe, the answer to that is definitely another post...

Felipe Heidrich
Felipe Heidrich

Using the Orion Editor with Almond

In my last post I gave instruction how to use the Orion Editor without requirejs, since then the code changed quite a bit and the instructions in the last post no longer work. We changed all the editor files to follow the AMD spec (you can find more details about this change here). It is still possible to use the editor without requirejs but you will need to use an AMD "shim" loader. The one I recommend is almond.

To illustrate how to use the editor with almond I decided to write an simple application for that. It is actually an upgrade of the code snippet written by Andrew Niefer in this post. You can find my version of the code in gist.

Besides changing the snippet to use requirejs I have also added a few extra features.

Here are the instructions:

First, in your blog post add a pre element with the attribute name set to "orion".
Then, in the class attribute you can specify the following parameters:

  • writable - if set the element is writable.
  • ruler - if set the line numbering ruler is shown.
  • js - use the javascript syntax highlight styler.
  • java - use the java syntax highlight styler.
  • css - use the css syntax highlight styler.
  • html - use the html syntax highlight styler.
Last, at the end of your blog added these lines:

<script src="http://planetorion.org/editor/orionformatterbuilt.js"></script>
<script type="text/javascript">
require("examples/textview/orionformatter");
</script>
Here is an example:

<pre name="orion" class="js ruler writable">
var this = "is some javascript code";
</pre>
This gets rendered to:

var this = "is some javascript code";
Now that the introduction part is over I'd like to talk about the process I used to create the orionformatterbuilt.js file which is the compiled version of orionformatter.js.

First lets take a look at what a html page with requirejs needs to do use orionformatter.js:


<!DOCTYPE html>
<html>
<head>
<script data-main="orionformatter" src="../../requirejs/require.js"></script>
<script type="text/javascript">
require({
baseUrl: '../..'
});
</script>
</head>
<body>
<h3>Orion Text View Demo: using Orion Formatter and RequireJS</h3>
<pre name="orion" class="js writable ruler" style="border: 1px solid teal;">
/* Some js code */
function log (text) {
var console = window.document.getElementById('console');
showConsole();
}
</pre>
</body>
</html>
It only needs to include "requirejs/require.js" and point data-main="orionformatter", very clean. The second script element setting the baseUrl was just necessary because our directory structure is a bit different.

The next step is to replace requirejs by almond.


<!DOCTYPE html>
<html>
<head>
<script src="/examples/textview/almond.js"></script>
<script src="/examples/textview/orionformatterbuilt.js"></script>
<script src="/examples/textview/orionformatter.js"></script>
<script src="/orion/textview/eventTarget.js"></script>
<script src="/orion/textview/textModel.js"></script>
<script src="/orion/textview/keyBinding.js"></script>
<script src="/orion/textview/textView.js"></script>
<script src="/orion/textview/projectionTextModel.js"></script>
<script src="/orion/textview/tooltip.js"></script>
<script src="/orion/textview/rulers.js"></script>
<script src="/orion/editor/regex.js"></script>
<script src="/orion/editor/textMateStyler.js"></script>
<script src="/orion/editor/htmlGrammar.js"></script>
<script src="/orion/textview/annotations.js"></script>
<script src="/examples/textview/textStyler.js"></script>
<script type="text/javascript">
function onload() {
require("examples/textview/orionformatter");
}
</script>
</head>
<body onload="onload();">

<h3>Orion Text View Demo: using Orion Formatter and Almond</h3>

<pre name="orion" class="js writable ruler" style="border: 1px solid teal;">
/* Some js code */
function log (text) {
var console = window.document.getElementById('console');
showConsole();
}
</pre>

</body>
</html>
Note that to use almond directly it was needed to include all the required files manually. Another difference is that requirejs ensures that orionformatter only runs when the dom is ready. With almond we don't get that, that is why the load event handler was necessary.

Now is the time to run the requirejs optimizer on almond. This is the magic:

$ node r-edge.js -o baseUrl=../.. name=examples/textview/almond include=examples/textview/orionformatter.js out=orionformatterbuilt.js uglify.ascii_only=true

Notes:

  • uglify.ascii_only=true was needed because textView uses unicode characters
  • r-edge.js was used because of a bug in r.js, this will soon be fixed.
  • See orionformatter.js line 16, without this line almond did not work (for me).
  • The doc suggests to pass wrap=true to the optimizer, in this case that can't be used as the load event handler needs to call the require method.
Now using orionformatterbuilt.js the html above can be simplified to this:

<!DOCTYPE html>
<html>
<head>
<script src="orionformatterbuilt.js"></script>
<script type="text/javascript">
function onload() {
require("examples/textview/orionformatter");
}
</script>
</head>
<body onload="onload();">

<h3>Orion Text View Demo: using Orion Formatter and Almond (optimized version)</h3>

<pre name="orion" class="js writable ruler" style="border: 1px solid teal;">
/* Some js code */
function log (text) {
var console = window.document.getElementById('console');
showConsole();
}
</pre>

</body>
</html>
In some cases, like when using the Orion Formatter with Blogger, it might not be possible to add a load event handler to the body. The workaround is add the script elements at the end of the body. The html would look like this:

<!DOCTYPE html>
<html>
<body>

<h3>Orion Text View Demo: using Orion Formatter and Almond (final version)</h3>

<pre name="orion" class="js writable ruler" style="border: 1px solid teal;">
/* Some js code */
function log (text) {
var console = window.document.getElementById('console');
showConsole();
}
</pre>


<script src="orionformatterbuilt.js"></script>
<script type="text/javascript">
require("examples/textview/orionformatter");
</script>
</body>
</html>

Wayne Beaton
Wayne Beaton

Top Ten Ways to Say Eclipse

Every couple of days, I get an email from somebody looking for a price quote for Eclipse. Generally, the sender is a software reseller acting on behalf of a client. Sometimes they ask to partner with us, sometimes they just want a simple price quote. In all cases, I answer with some boilerplate text that I keep around:

Eclipse is free and open source software that is distributed royalty-free under the terms of the Eclipse Software User Agreement. Please let me know if we can be of further assistance.

Now, the interesting thing for me, is the number of different product names people use to describe the thing that they want to buy. Here are a few of my favourites (in no particular order).

  • Eclipse Foundation Eclipse Galileo SR1 3.5.1 EN 01
  • IDE License JAVA programming: Open Source
  • The “Eclipse” Software
  • “For a Better World” (an Eclipse Publication)
  • LTO Ultrium 5 1500 GB Data Cartridges
  • Eclipse Indigo (3.7) Packages for Mac OS
  • Eclipse + plug-in
  • ECLIPSE IDE for Java EE Developers 1.2.0.20090621-0820 epp.package.jee for Win7
  • ECLIPSE Practice Management Software/Medical Billing Software
  • SCA dev lab Software and SCA tools

There’s a couple in there that seem to come out of nowhere, obviously from folks who have us confused with somebody else. Curiously, I get almost no email about soccer clubs or vampires.

EclipseCon 2012AGILEALM 2012


Thomas Kratz
Thomas Kratz

Richt Text Editor for Eclipse/SWT

I have been looking around, but a feasible Rich Text Editor for SWT seems to be hard to find. I finally came accross the FCKEditor integration from the JFire/Nightlabs guys. They do not promote it, but it works fine for me. I had to grab some dependencies from different repos at nightlabs and make some hacks to make it play nice with the Rest of my app, but it looks stable and works on all platforms (some other editor needs a xulrunner, thats still messy on 64bit platforms) as it uses the Browser widget to render FCKEditor.


Customized FCKEditor in an eclipse e4 RCP app.

EclipseLive
EclipseLive

Webinar: Transforming development visibility and productivity with Borland StarTeam 12.0 and Tasktop

Mik Kersten, Founder of Eclipse Mylyn, CEO Tasktop Technologies & Stuart McGill, Borland General Manager
 
Abstract:
StarTeam 12 is here with full Tasktop Dev and Sync support. The new StarTeam release, together with Tasktop, includes a host of new features designed to benefit both developers and management. Now it is easier than ever to extend the interoperability and co-existence between ALM tools and asset types across software development teams, while management benefit from improved insight into delivery goals and their predictability. In this webinar you will discover the benefits of our new collaboration, and: * Discover how StarTeam customers benefit from Borland's strategic partnership with Tasktop * Learn how Tasktop Sync delivers visibility by integrating StarTeam with your other ALM tools * See how developers get the most modern and integrated experience for StarTeam with Tasktop Dev
delicious delicious | digg digg | dzone dzone

Eclipse Jetty
Eclipse Jetty

i-jetty 3.1 Released

Release 3.1 of i-jetty for Android is now available from the Android Market and the i-jetty download page.

This release updates the embedded Jetty to jetty-7.6.0.RC4, although the majority of the changes have been to the Console, which is a webapp that allows you to interact with your Android device from a remote browser.

Higlights include:

  • pagination of large data sets such as Contacts and Media thumbnails (images, videos)
  • re-implementation of generated content as json & ajax REST
  • ability to cause the device to ring (helpful for finding it around the house!)
  • ability to show current location of the Android device on Google maps , or track its location on the map as the device moves.

Here’s a screenshot showing tracking my phone as it moves from the Sydney Opera House to Fort Denison on Sydney Harbour:

Tracking phone via i-jetty console webapp

Tracking phone via i-jetty console webapp

Enjoy.

January 23, 2012

Peter Kriens
Peter Kriens

Objects Revisited

Alan Kay is the  inventor of Smalltalk, the first fully truly object oriented language. I learned Smalltalk in the early eighties and almost everyday that I use Java I am crunching my teeth that James Gosling did not steal more ideas from Smalltalk. About 20 years ago, during an OOPSLA, Alan Kay presented the idea that data should always carry its own methods to access that data. His example was

January 21, 2012

Gunnar Wagenknecht
Gunnar Wagenknecht

Use Target Definition Files in PDE Build

I’m not hip when it comes to building Eclipse based products. I still use plain vanilla PDE Build. The cool guys all switched to Tycho. Well, you’re allowed to call me dinosaur then. Anyway, I’ve been using .target files as a source for dependency management for quite a while now. They are very useful in Eclipse. All dependencies for all the bundles are defined in one place. You simply open one and Eclipse starts downloading one half of the Internet. Maven already did the other half, I’ve heard.

I also use them to drive PDE Build. Instead of specifying stuff to fetch for a build again I simply point PDE Build to the same .target file I use in the IDE. Works like a charm as long as you only use “Software Sites” (p2 repositories) which are accessible via URL by any developers Eclipse instance as well as the build machine.

Previously, this was implemented by transforming the .target file XML using XSL into an Ant script. The Ant script did a bunch of p2 mirror calls to download the bytes. I recently upgrade to a newer version of the builder containing a Juno version of the org.eclipse.pde.core bundle. Starting with 3.8 this bundle defines a nice Ant task that does not require the XSLT magic.

<target name="buildTargetPlatform" unless="skipTargetDefinition">
  <!-- note: this requires pde.core (from Juno) in the base builder -->
  <pde.provisionTargetDefinition
      targetFile="/path/to/my.target"
      destinationDirectory="${repoBaseLocation}/target"
      clearDestination="false"/>
</target>

January 20, 2012

Michael Jastram
Michael Jastram

ProR Snapshot Build available

Good news to everyone interested in ProR - we finally have a snapshot build available on the RMF website.  If you are interested in ProR, ReqIF, etc., please give it a spin.

The last release took place in August 2011 - an eternity ago, as far as software is concerned.  The reason for this long delay had been announced before: We migrated ProR to Eclipse, where it became the GUI for the Requirements Modeling Framework (RMF).  Becoming an Eclipse Foundation process is a huge endeavor: A project has to undergo a comprehensive intellectual property review, and once migrated, there are strict rules to ensure that all IP is accounted for.  As if this is not enough, we also performed some major refactoring of the code base.

Read the rest at the Formal Mind Blog

BJ Hargrave
BJ Hargrave

Juke Box Hero, Got Stars In His Eyes


I learned Wednesday that I was named a JavaOne Rock Star for my Why OSGi? presentation with Peter Kriens at JavaOne 2011. Nice!

Jae Gangemi
Jae Gangemi

happy 2012

greetings and salutations in the year 2012! after a very, very long hiatus, development work on perlipse has resumed.

stay tuned for further updates!

Laurent Goubet
Laurent Goubet

Traceability test case : UML to Java generation

The next version of Acceleo will introduce a number of improvements of its existing features, one of its most important, the automatic builder, being entirely re-written in order to get rid of legacy code and improve the user experience. This also comes with a much better experience for users that need to build their Acceleo generators in standalone, through maven or tycho. More news on this are available on the bugzilla and Stephane's latest post.

One of the least visible features, yet one I find among the most interesting aspects of the Acceleo code generator, is the traceability between the generated code, the model used as input of the generation, and the generator itself. Basically, you always know where that esoteric line of code came from : which part of the generation template generated it, and which model element triggered its generation.

This feature has known a series of improvements as we used it intensively with the UML to java generator. We are now confident that we can record and display accurate information even for some of the most complex use cases. This generator isn't the most complex generator we could write with Acceleo, but it is quite complete nonetheless. Here are some examples of what the Traceability can provide to architects developping their code generators :

Determine which model element triggered the generation of a line of code


On the left-hand side, a file that has been generated. On the right-hand side, an editor opened as result of using the action "open input" : the model is opened and the exact element that was used to generate the part of code is selected.

Find the part of a generator that created a given part of the code

On the left-hand side, the same generated file as above. On the right-hand side, the result of using the "open generator" action : the Acceleo generator which generated that selected part of the code is opened, with the exact source expression selected.

Real-time Synchronization



These are but a few of the features that can be derived from the synchronization between code, model, and generators. Some more examples include : previewing the result of a re-generation, incremental generation, round-trip (updating the input model according to manual changes in the output generated code)...

Most of these features are better seen in video to get an idea. If you want to see some of them in action, some more flash videos of what traceability can do for you are available on the Obeo network (though a free registration is required).

Andrei Loskutov
Andrei Loskutov

Eclipse job in Böblingen

We (Verigy) have a job opening for a Java / Eclipse developer in Böblingen / Germany. Details on G+.

Gunnar Wagenknecht
Gunnar Wagenknecht

Upcoming Events

I know some of you already finished planning for the next few months. There are a couple of interesting events I’ll attend which might be of interest for you. Thus, I thought sharing won’t hurt.

FOSDEM (Feb. 4 – 5, Brussels, Belgium)

I’ve never been in Brussels before. I’ve also never been at FOSDEM before. Andrew told me about his plan to generate some nice Eclipse buzz there. Well, it looks like that will turn out great. Mike will be there too. We’ll have an Eclipse stand for people to show some projects and talks about Eclipse and we’ll also give a few talks about Eclipse. Mine will be about EclipseRT.

EclipseCon (March 26 – 29, Reston, Virginia, USA)

Ok, this one is a classic (for me). I’ve been there before. You gotta have to be there! However, this year my flight to EclipseCon will be shorter. The event moved from the west coast to the east coast. Frankly, I always wondered about switching location away from Santa Clara. But I’ll also miss San Francisco. It’s a beautiful city always worth a visit. Yet it took me three EclipseCons until I finally visited it in 2009 for the first time. I may need to find a new event in that area. ;)  Anyway, I’ll give one of the many tutorials there (Dynamic Server Applications with EclipseRT).

JAX (April 16-20, Mainz, Germany)

Also bit of a classic, I like that event. It’s packed with lots of sessions and people. I’ll talk about developing cloud applications with Eclipse Gyrex. Our first major version (1.0) is only weeks away and that talk will be a great opportunity to learn more about Gyrex and see how we use it to solve some interesting problems.

Hope to see you soon at any of the events!

Jan Kohnlein
Jan Kohnlein

Multitouch Gestures in the Generic Graph View

In my previous post, I've already described the discovery mechanisms of the Generic Graphical View project: Starting from one node you can step by step reveal other connected nodes in the same model. The model itself is fixed - it is still a view! - but the user can decide herself which subset of elements should appear in the diagram. That behavor allows to create diagram views focussed on a specific semantic aspect of the model.

The challenge is to find a decent UI for nodes wich have several hidden connections. How should a user select any subset of these?

Since the Helios release SWT supports four multitouch gestures: PAN, ZOOM, SWIPE and ROTATE. On my Mac's touchpad these gestures are actually easier to perform than a conventional drag operation because there is no extra mouse button. So I decided to give it a try and have a look how gestures could be used in the graph view. Here is a screencast showing the results:



SWT's multitouch API is fairly simple (example snippet). The first step was to add multitouch events to GEF, such that the can be handled in the same way as mouse or keyboard events. I had to extend a couple of GEF classes. If you're interested in the details, have a look at the classes in the package org.eclipse.xtext.graphview.behavior.gestures and the GraphViewRootEditPart.

These changes allow to use a ZOOM gesture on a ScalableFreeformRootEditPart.
Note that the PAN gesture is already supported by GEF because the FigureCanvas uses hardware scrolling. Unfortunately, these event is always consumed, such that it will not make it through to other GEF elements.

The ZOOM gesture can also be used to drill down into elements. If the mapping defines an open reference to another diagram, you can drill down by selecting it and performing the ZOOM in gesture. If you‘re inside a drill down diagram, you can ZOOM out into the container diagram.

Any Tool can now handle multitouch gestures by implementing the IViewerGestureHandler interface. For a DragTracker this makes no sense, as it is exited as soon as the mouse key is released and you cannot start a drag and a multitouch gesture simultaneously.

The RevealGestureTool works as follows: Click on the + button to reveal the hidden connected elements, Then use ROTATE or SWIPE to rotate elements, ZOOM to change the distance and right-click to select and pin individual elements. Another click will commit the input.

January 19, 2012

Mariot Chauvin
Mariot Chauvin

Modeling 2.0 : Let's collaborate!


A bit of history



4 years ago, when I joined Obeo, I started to work on a new modeling tool dedicated to system engineering. The main focus of this tool was to enable system engineers to model graphically complex systems with different representations, for each speciality, depending on their viewpoint. The tool was associated to a methodology and integrated in a modeling workbench.




Separation of concerns by representations was a first step to scalability of graphical representations, another was to add several mechanisms (layers, filters, hide/reveal) to allow end users to hide some elements. The approach is somehow similar on what Miles is working on.

We took the decision to create a generic runtime with the possibility to specify graphical representations and to drive the tooling by the viewpoints. The approach has similarities with Jan current's work, and I think our work inspired him a little bit.

Since the runtime has been used for safety analysis (diagram screenshot) and several other use cases.

However, although our tool primary concerns was collaborate modeling since its inception, we did not offer directly a solution to the concurrent access problem. In fact, we left it to the Revision Control System (RCS) used by end users. As Alex wrote concurrent access management by RCS have several drawbacks, so we decided to offer the possibility for end users to collaborate more seamlessly.

On the technical side, we decided to use CDO, a technology we had experienced successfully in others projects, and which seems to match the most to our requirements. As our graphical modeling technology is based on GMF Runtime, our global technical task was to integrate GMF and CDO.

GMF and CDO, integration challenges


If you are used to component architecture like the Eclipse platform one, you may think that these two components will plug together quite easily. Unfortunately, this is not the case for various reasons :

  • EMF Transactions and CDO Transactions
    GMF Runtime relies on EMF Transaction to manage read and write accesses to models. To simplify this means that one is not allowed to do a modification without encapsulating its change in a recording command. On its side CDO provides its own transaction mechanism, which relies on the database store one. So it is necessary to integrate the two mechanisms. This is one of the features Dawn provides (see those bugzilla entries for further information).
  • Transactional model break in GMF Runtime
    GMF Runtime is a bridge between EMF models and GEF. Among others things, it provides a notation model, to store graphical information. The synchronization between the graphical model and the semantic model, is one of the responsibility of edit parts. The choice to split the synchronization responsibility in each edit part enables one to easily override the default behavior for a given edit part. This choice is consistent with the high extensible approach of the framework. However, it has one major drawback, edit parts should be instantiated to update the notation model ! As GMF Runtime edit parts creation is done in an post commit listener, when no models changes are allowed, the runtime have to force the transaction using a special option.
    This behavior prevents one to have triggers for those modifications. If you need to avoid conflicts (see below), you will not be able to acquire lock before commit. In this case it means that one have to extract the synchronization from edit parts and to call it at the right time.
  • Avoiding conflicts
    If CDO provides live updates of shared models, it does not prevents conflicts. There is two ways to handle them. The first one is to write your own conflict resolver, which will take a decision when a conflict occurs. The second one is to avoid conflicts through locks. Easier to said than to implement, but that the way we choose.
    • Lock integration
      To avoid conflicts, the simplest way is to lock automatically elements before their edition. In practice, one could use the EMF Transaction trigger mechanism to do this. Edit parts need to listen to locks events to deactivate accordingly their edition capabilities and provide visual indicators of the lock. Lastly, to provide logical lock for end-users, one may provide a lock strategy.
    • Consistency maintenance on client side
      EMF Transaction enables one to rollback a transaction, before its commit. This is generally done for validation or lock acquisitions purposes. The recording command manages this rollback and will abort properly the transaction if it occurs. However with the abort, the CDO state of the object will change (see bug 312534 for more details). To avoid conflicts a solution is to use CDO save points to restore the object to a clean state if a transaction aborts.
       
  • Native mode for GMF Runtime notation models ?
    One of the coolest thing of CDO is its EObject implementation, but to benefit from the scalability it provides, you need to regenerate your metamodel with a CDO dependency. When one works with such CDO model instances, the mode in which one is, is called native. As GMF Runtime notation metamodel depends on the EMF one (don't do this at home), using notation models in native mode is far from being easy. So we worked on a solution which keeps source and binary compatibility with legacy code (see bug 336707 for technical details) and provides notation cdo native models, the code is available here (no builds yet).
       
  • Content and cross reference adapters
    These two utilities should not be used as they will break the lazy loading mechanism of CDO. By default GMF runtime initializes one cross reference adapter when configuring the editing domain. You could quite easily override the default behavior. EMF Transaction uses an adapter that walk through its content, but removing it is much harder. 
On our product, the work is still in progress, but we he have implemented solutions for most challenges presented above. During this work we opened several issues :   
As you may seen, the CDO team has been very responsive, and already provided fixes for most of them. I would like to thank them for their availability and help.

This blog entry present results coming from a work collaboration between Thales and Obeo.
Ce message de blog est issu d'un travail en commun entre Thales et Obeo.

EclipseLive
EclipseLive

P4Eclipse Tutorial

Perforce Software
 
Abstract:
See how to install, configure, and use P4Eclipse, the Perforce Plug-in for Eclipse. Connect to a Java project in a workspace. Edit, diff, and submit a file. Perform a refactor and use graphical tools to review file history. (10:20 mins.)
delicious delicious | digg digg | dzone dzone

EclipseLive
EclipseLive

Modernize your ALM Architecture with Tasktop Sync 2.0

Dr. Mik Kersten, Tasktop CEO, Founder of Eclipse Mylyn
 
Abstract:
In this must-see webinar, Tasktop CEO Mik Kersten will provide the first in-depth view of Tasktop Sync 2.0. Tasktop Sync 2.0 provides a set of industry-first facilities for connecting your ALM stack. With the massive response to Tasktop Sync 1.0, we have focused this release on features for capturing your ALM architecture in the Sync tool in order to connect all stakeholders with real-time traceability and collaboration. Our goal is to help you transform your ALM stack by allowing you to tailor the best of open source, Agile, in-house, and enterprise ALM solutions. 
delicious delicious | digg digg | dzone dzone

Roy Ganor
Roy Ganor

Getting Started with Facebook App Development

Last week I was playing with Facebook App development, getting ready to the Facebook announcement. It was quite pleasant experience, although things could be simpler. The Facebook Open Graph concept gives a nice overview on what and why this all about, so that part went very smooth. When things get technical, the Facebook Developers site turns messy. That is, all topics are covered in a 'tutorial' approach rather than an API approach like most developers are used to. Moreover, the layout of this page is definitely not intuitive as it mixes between reference and tutorial docs. That's said, the general experience was good.

To help other developers get started with Facebook app development I created a nice application which take the reader through the steps to develop applications with phpcloud.com. It was a nice exercise and it can really help with the development workflow.

The topic "Getting Started with Your Facebook App on phpcloud.com" covers :

  1. Create an account on phpcloud.com
  2. Create an app on Facebook
  3. Setting up development environment
  4. Deploy a sample Facebook app to phpcloud.com
  5. Push updates to your Facebook app


January 18, 2012

Vojimir Golem
Vojimir Golem

Getting started with PlayN (Part II)

Part I has shown how to install and use the PlayN a cross-platform game abstraction library. In this screencast you will see how to use Eclipse IDE to run/edit/debug cross-platform games developed with PlayN.

This short (4 minutes) screencast shows the same "Showcase example" presented at Google I/O 2011: "Kick-ass Game Programming with Google Web Toolkit" by Ray Cromwell and Philip Rogers.

In this video more emphasis are put on tool (Eclipse & PlayN) usage:







Hudson-CI Blog
Hudson-CI Blog

First Hudson Release from Eclipse Foundation

The Hudson team is pleased to announce its 3.0.0 Milestone 0 release from the Eclipse Foundation. We have worked diligently and expertly over the past year to get to this milestone release.  Since release 1.398  the Hudson community has benefited from the team’s work through the introduction of the 6-week release cycle, based on a new development and release process and the ongoing work on bugs, enhancements and new features

What is included in this release?

The M0 release is the first release of Hudson as a top level technology project from the Eclipse Foundation. It has been a very busy 12 months for us and that is shown in the large numbers of new features, enhancements and bug fixes the team has developed.

Over 50+ new features and enhancements cover:

  • Maven 3
  • Cascading Projects
  • JAXB-based REST API and plugin,
  • enhancements to
    • Parameterized Builds
    • Downstream Projects
    • User Management
    • Security and Authorization
    • UI
    • GIT support

Over 350 bugs across the full range of Hudson have been fixed especially focused on stability, performance and the core SCM plugins such as GIT and SVN.

In parallel to this, in August 2011 the team began the process of submitting the Hudson core code to the Eclipse Foundation  The foundation has stringent entry requirements on all project source code and third party licences to ensure they are IP and license clean. Hudson’s source code, split over 10 core modules, has now been approved and is available in the Eclipse GIT repository.

There are over 200 third party libraries distributed with Hudson (including many that relate only to plugins).  Some of these are LGPL licensed libraries that the Eclipse Foundation does not accept under any circumstances. The team developed and implemented a strategy to replace these with more suitable libraries ensuring little impact on the core code or Hudson plugins using them.

For example:

  • The Java Native Access, JCaptcha and JFreechart  libraries have been repackaged as external plugins for this release. Additionally HawtJNI will be bundled as part of Hudson core for future releases, to replace the JNA support.
  • The BIRT Charting engine will be the charting method of choice going forward, but backward compatibility with JFreechart is maintained by existing plugins through the simple addition of a dependency on the external JFreechart libary package.
  • Winstone, originally used as the the standalone container for Hudson has been replaced by Jetty.

The balance of the libraries were considered for submission to the IP checking process.  In itself this is no small task. Each library has to be submitted with its source code.  Some of the libraries were so old that the code was not readily available or had been forked with local changes.

The Hudson team modernized the code through such means as replacing forked libraries with current versions and working with library owners to feed forked changes back into the latest library versions.  The Eclipse Foundation contacts owners and contributors to libraries to establish IP cleanliness.

As you can imagine, this is a labour intensive process but the work of both the Hudson team and library owners has ensured that over half of the 100+ third party libraries have been approved already. This core set of 100+ libraries represents those that are physically packaged in the core war.

The rationalization and approval process for the balance of the libraries is ongoing. But the result of this mammoth effort is that Hudson is ready to move forward and develop features related to the high level themes that the community agreed upon.

The final part of the effort in the leadup to this M0 release is the work that has been done on both the Hudson Eclipse website and wiki. Much of the content from the older hudson-ci.org has been rewritten or updated and moved to the new infrastructure. Over 70 pages are now available from the new sites, including the recently published Hudson Book (151 pages of material in it’s own right) that contains the most up to date information on installing, administering and using Hudson.

What can you contribute to this release?

As an alpha release we are not expecting miracles! But the release has gone through development and testing cycles and we are very pleased with the results.  You should be able to run this release of Hudson on your container of choice and expect it to behave well. You can install plugins  and expect them to run.

With the changes to libraries detailed above there may be some issues that we need to address quickly. Known issues will be with any plugin that uses JFreechart. We are in the process of either forking or contacting plugin owners to create the dependency on the external plugin. But the plugin may not yet be available from the update center. Keep an eye on the blog and Twitter feed for the latest news.

If you have any issues or further enhancements relating to this Eclipse release Please raise issues in the Eclipse Bugzilla system which you can find at https://bugs.eclipse.org/bugs/ - Hudson lives under the top level Eclipse Technology project. You will need to register for an Eclipse BugZilla account to log issues if you don’t already have one. For more information on the Hudson community, mailing lists, forums etc. please head over to the communities page.

Feel free to join us at the next community phone call to voice your opinions and experiences with this new release.

What is coming next?

It’s our intention to release monthly milestones until we get to our first approved Eclipse production release. By which time we feel that the Hudson project at Eclipse will be fully functional and ready for migration of your production servers. In the meantime, updates will continue in parallel on hudson-ci.org for all your production Hudson needs.

Susan Duncan


Eric Rizzo
Eric Rizzo

Today is "strike" day to protest SOPA

Today is "strike against censorship" day to protest the SOPA and PIPA bills that are attempting to pass in the US Congress. Please educate yourself about the potential negative impacts of these laws and get involved.

http://sopastrike.com/strike
https://www.google.com/landing/takeaction/
http://americancensorship.org/


Jan Kohnlein
Jan Kohnlein

Discovery Diagrams for the Generic Graphical View

If you've read my previous posts or seen my presentation at EclipseCon Europe 2011, you'll already know the Generic Graphical View framework: Using two Xtext-based DSLs - one for mapping semantic to graphical elements and the other for styling the figures - you can easily create nice looking diagrams for any Java based model.


In its first version the contents of the diagram was entirely defined in the mapping DSL. It was only possible to restrict the visible elements to a subset of the model by adding filtering expressions in the mapping. For bigger models it was hard to focus on a subset that is not structural defined but based on semantics, e.g. all classes that deal with addresses in a CRM application.

Many graphical frameworks handle the selection of the visible elements in a diagram by means of dialogs. The user is then forced to switch between keyboard and mouse which is annoying, and these dialogs are often complicated and unintuitive. The goal for the Generic Graph View project was to build a UI for choosing the diagram contents that uses the mouse or trackpad only and avoid dialogs at all cost. The following screencast demonstrates the basic functionality.



As a first step, actions were introduced that allow to hide existing graphical elements - nodes, labels or connections. If you hover over an element, you'll get an popup button allowing to remove it from the view. So you can start with a big diagram and strip it down to what you want to see. Once an element inside a node has been removed, you can restore the node completely using another popup button. You can define elements as initially hidden using a hidden flag in the mapping definition.

In addition to the subtractive approach, you can step by step extend the diagram contents from an initial node. If you're hovering over a node that has hidden connection, several + buttons will popup. When one of these buttons is triggered, the hidden elements and connections will appear in transparent arranged in a circle around the source element. In the same drag operation you can change the distance and the angle of that circle. This behavior will get really cool with multitouch gestures, which I will cover in a separate post.

Stephane Begaudeau
Stephane Begaudeau

Maven integration in Acceleo

With the release of the new Acceleo stand alone front end for the compilation of Acceleo modules, I’ve started to work on a brand new maven integration in Acceleo.

Currently in Acceleo, if you need to build Acceleo modules with maven you have to use a Tycho based build with a java class generated by Acceleo to tweak the build (for example to register the metamodel(s) used in the modules). This Tycho based build will always produce an Eclipse plugin as a result.

The next major release of Acceleo will have a maven plugin dedicated to the compilation and it will bring several key improvements. Firstly, the new compilation front end brings a completely stand alone compilation. Those who want to build their Acceleo modules without having to build an Eclipse plugin will be able to do so. Secondly, this new front end support more complex project structures (with for example, multiple output folders in a same project). Thirdly, you will have the ability to contribute a class to influence the uris of the dependencies in the saved files (for example, change all the uris of the dependencies to other module to “platform:/plugins” uris that are more “eclipse plugin” friendly). Finally, it also features an improved resolution of the dependencies of a project with several options.

Your project will be able to have a dependency to Acceleo modules in another project (that should have been previously compiled). A valid Acceleo project is just a directory on the file system with at least one “source” sub-directory and one “output” sub-directory (no need of an Eclipse nature or anything like that).

This first solution is fine as long as you have the source code of the other modules but sometime you need to build something with the dependencies in jars. The maven plugin for Acceleo will let you declare a dependency to a jar containing already compiled Acceleo modules by using:

  • The absolute path of the jar. Ex: C:\…\myJar.jar
  • The path of the jar relative to the project built. Ex: ${project.basedir}\lib\myJar.jar
  • The groupId and the artifactId of the jar resolved by maven  (the version of the jar is optional since some version number includes the date of the build and therefore change often). Ex: myGroupId:myJar:myVersion
  • The name of an Eclipse bundle resolved by Tycho preceding by “p2.eclipse-plugin” only in a Tycho based build (“p2.eclipse-plugin” is the groupId of all the dependencies resolved by Tycho). Just like the previous use case, the version of the jar is optional too. Ex: p2.eclipse-plugin:myJar:myVersion

For those who want to have a look at this new maven based build for Acceleo, you can find its source code on github.com and you can test it with a simple pom.xml like this one.

Mik Kersten
Mik Kersten

Happy Birthday Tasktop

Five years ago, on Friday January 15th, I defended my PhD thesis on Focusing Knowledge Work with Task Context. The following Monday, January 17th, we incorporated Tasktop Technologies. Driven by the years of research that it took to prove that tasks are more important than files, integration is more important than features, and that focus begets flow, we embarked on a journey to bring to market a transformation in how we work and collaborate around software.

Our journey and passion have been fueled by our customers and our open source community, as to date we have not taken any external funding, and instead embarked on what’s more recently been defined as the Lean Startup approach to building a company in an Agile and customer-centric fashion. Bootstrapping, we have doubled in revenue and nearly doubled in head count each year since our inception, and now support over a thousand customers and over a million open source users. Working closely with our ISV partners, the Eclipse community and open source ALM projects, we are proud to be one of the key contributors defining the future of ALM.

In addition to the opportunity to be a part of a transformative endeavor, what’s guided our vision is a manic focus on the needs of individual software workers. Mylyn and its commercial counterpart, Tasktop Dev, materialized because the growth in complexity of software and the fragmentation of ALM tools were bringing our and our fellow developers’ productivity to a halt. Tasktop Sync was born out of the same need to give other stakeholders such as testers, project managers and business analysts, a connected and collaborative view on the software delivery process. With our focus on integration, our goal is to empower developers and other stakeholders in order to advance ALM to support the rise of the software-powered economy.

We want to take this birthday moment to thank all of the customers and partners who have made it possible for us to do what we love, which is to invent the future of ALM and to strive for our goal of doubling the productivity of software developers and managers. We hope you like the next round of innovations that we are hard at work for launching in 2012, which will be a definitive year for software, for ALM and for Tasktop Technologies.

January 17, 2012

Kim Moir
Kim Moir

2011 by the numbers

2011 was an exciting year in the Eclipse community.  From my corner of the Eclipse universe, he's what it looked like:


One book chapter, many thanks



I contributed a chapter on Eclipse to the Architecture of Open Source Applications in 2010 and the book was published in May 2011.  Thanks to Amy Brown and Greg Wilson, for their long hours editing and providing feedback to the authors of this book.  It's a great read!  When Greg first approached me about writing this chapter, my immediate thought was "How hard could it be? I live and breathe Eclipse all day".  It was much more difficult that I imagined but in the process I learned a tremendous amount and am a better committer for the experience.  Many thanks to DJ Houghton and John Arthorne for reviewing my drafts and providing valuable feedback. A special thanks to Jeff McAffer who I interviewed about the decision to switch to OSGi in 3.0 and Steve Northover for his suggestions to make the SWT section into something more pixel perfect.  Merci Olivier Thomann for answering my many compiler questions,  and Boris Bokowski and Paul Webster for their thorough discussions with me regarding the modelled workbench and dependency injection in 4.x.  Also, thanks to Mike Wilson to allow me the flexibility in my job to spend some time at work working on this chapter.  I'm excited to see that Amy and Greg are now editing a second volume of this book.

Six milestones, many release candidates, two service releases, and one coordinated release, four streams, thousands of builds, millions of tests
No rest for the committers.

143 bug fixes
I closed about 143 bugs in the releng bucket in the past year.  That doesn't seem like much really.  I'd have liked to solve more.  The largest issues implemented from a releng perspective were shared licenses, code coverage, and the largest work item, the Git migration.

42 Git repos 
The Equinox and Eclipse projects migrated all their repos to Git.  We now have about 42 Git repos.  This involved a tremendous amount of work on the part of the Eclipse team as a whole.  There were many whiteboard drawings and detailed discussions about the migration process with John, Paul and a Mr. Gheorghe.  There was no Ringo.  Thank you Paul for all the huge amount of testing, script writing, and migration of all the ui and e4 repos. Thanks John for your work many sage suggestions on our Git migration, as well as your suggestion to implement the git flow method to simplify our development and build processes.  Thanks Andrew Niefer for migrating many of the Equinox and PDE repos, Bogdan Gheorghe for your work with SWT, and Oliver Thomann for testing JDT Core repos.  Thanks Tom Watson for your Git advice, having already climbed the Git learning curve while working on the OSGi Alliance repositories.  To Dani Megert and Markus Keller, your always fine attention to detail and pointing out areas that could be improved is appreciated. Paul is giving a talk about our migration at EclipseCon 2012 called Let's Git this Party Started.  I'm sure it will be insightful and entertaining.

One EclipseCon, two talks, one castle, many great people
I was privileged to attend EclipseCon Europe in Ludwidsberg this past November and present two talks.  I thoroughly enjoyed preparing these talks, and even more presenting them.  On the Wednesday morning, I talked about our Git Migration, and that evening I gave a talk with John Kellerman about history of Eclipse over the past 10 years.  After the second talk, a few people came up to me and said that the talk was so good that it should have been a keynote.  That was very fantastic to hear because we really put a huge amount of effort into that presentation.  I also had a lot of fun talking to people at our booth where we had posted many pictures of the Eclipse family from over the years. The Saturday after the conference Simon Kaegi, Eric Moffatt and I visited Heidelberg castle.  Canada scores very low on the castle index so this was a treat.   


You can't buy Eclipse magazines or giant pretzels at train stations in Canada either. I was impressed.



19 blog posts
I didn't have much time to write blogs posts this year.  The most popular one I wrote this year was about smashing open source stereotypes.




I'm never sure how popular a blog post will when I write them. It's always a surprise.  The comparison of Mozilla and Eclipse build infrastructure I wrote last year still holds the record for most popular (it ended up on reddit).


One marathon, many kilometers of training
How is running related to release engineering?  Running keeps me sane when release engineering gets crazy :-)  Preparing for the Ottawa marathon in May means that you have to start training at the end of January.  Running through snow, ice, wind and rain teaches you there isn't really anything you can't do when you are willing put in a lot of hard work to reach your goal.  And when you reach that goal, there's a lot of joy, because you know that you have conquered all the obstacles in your path and emerged victorious.

My sneakers after a 19K training run through deep slush
Open source is really a huge team effort and I had a lot of fun in the Eclipse community in 2011.

Who knows what 2012 will bring?

Kai Toedter
Kai Toedter

Eclipse 4.x talk for JUG Ostfalen

If you are interested in the Eclipse 4.x Application Platform and happen to live close to Braunschweig (Germany), join my talk for the JUG-Ostfalen:

Was ist neu bei der Eclipse Rich Client Platform 4.x?

When: Friday, January 20th, 7:00 pm
Where: CKC Braunschweig, Am Alten Bahnhof 13, 38122 Braunschweig
Language: German

After my session there is another talk: “Agile Review” (Eclipse Plugin) by
Malte Brunnlieb, Philipp Diebold, Thilo Rauch und Peter Reuter.

The event is free: Registration and info is here: http://eclipse4.eventbrite.com/

Would be great to see you there!

Kai

You find me on Twitter and Google+.
Next Eclipse RCP 3.x/4.x trainings in Munich

flattr this!

Ankur Sharma
Ankur Sharma

OSGi Tracing in Equinox

The Equinox implementation of OSGi provides the tracing APIs in org.eclipse.osgi plug-in since Eclipse 3.5. The tracing options are generally Boolean flags stored in a .options file as key-value pair. A typical .options file would look like this

org.my.plugin/ui=true
org.my.plugin/ui/editor=true
org.my.plugin/ui/prefs=true
org.my.plugin/debug=false
org.my.plugin/debug/data=true

The hierarchy is defined using the slashes. But this is only a general practice. The tracing does not understand this.

-osgi.debug
To load the values from the .options file, provide the file name as command line parameter (or program parameter in launch config)

command line arg example
eclipse.exe -debug C:\tracing\.options

program argument (in launch config) example
-Dosgi.debug=C:\tracing\.options

Using -debug is same as setting the osgi.debug system property.

Accessing the option values at runtime
1. In RCP application
If the RCP application has access to the org.eclipse.core,runtime.Platform object and thus they can access it directly like this

String value = Platform.getDebugOption("org.my.plugin/ui");

User can validate if the program is running in debug mode using Platform.inDebugMode() API.

2. In pure OSGi application
An OSGi application can access these options using the DebugOptions service


ServiceTracker debugTracker = new ServiceTracker(bundleContext, DebugOptions.class.getName(), null);
debugTracker.open();
DebugOptions debugOptions = (DebugOptions) debugTracker.getService()
boolean uiOption = debugOptions.getBooleanOption("org.my.plugin/ui", false);

Using the API has the advantage that user does not have to check for nullness.

More Tracing API
org.eclipse.osgi provides more APIs which are very helpful in logging the trace.

1. Registering a debug option listener
The listener can be registered as service using the BundleContext (that you receive in the activator class when the bundle is started)


final Hashtable<String, String> properties = new Hashtable<String, String>(4);
properties.put(DebugOptions.LISTENER_SYMBOLICNAME, TracingConstants.BUNDLE_ID);
bundleContext.registerService(DebugOptionsListener.class.getName(), new MyDebugOptionsListener(), properties );

2. Listening to the debug option change events
Once the listener is registered, a callback will happen each time a debug option is changed. The callback does not tells you the delta and instead throws the whole lot. So we can use this place to read and init from the DebugOptions


/* (non-Javadoc)
* @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions)
*/
public void optionsChanged(final DebugOptions options) {
//DebugTrace trace;
trace = options.newDebugTrace("org.my.plugin");
// boolean field
DEBUG = options.getBooleanOption("org.my.plugin/debug", false);
}

this is just an indicative code. You don't have to necessarily do it this way.

3. Writing to trace
This is the easiest part. Afterall the reason we did the whole exercise was to make the tracing simple. A handle to trace object can be obtained from the debug options.


/** Trace object for this bundle */
private final static DebugTrace TRACE = MyPluginActivator.getDefault().getTrace();  // returns the trace object obtained using options.newDebugTrace("org.my.plugin");




@Override
protected Control createContents(final Composite parent) {
if (MyPluginActivator.DEBUG) {
TRACE.traceEntry("/debug", parent);
}
...
...
}

Checking MyPluginActivator.DEBUG is optional. TRACE.traceEntry will check for the flag "/debug" anyway. This is to improve of the performance. We store the the flag values to boolean fields and update them through the listener.



4. Where is the log file?
 The log is stored in the file as set in the debug options. By default, it tends to store them to workspace\.metadata\trace.log

options.setFile(new File("/path/to/trace/file"));

5. Controlling the trace logs
The logs are conntolled by two system properties

eclipse.trace.size.max : The system property used to specify size a trace file can grow before it is rotated
eclipse.trace.backup.max : The system property used to specify the maximum number of backup trace files to use

Easier way to manager the logs?
PDE will be providing UI for managing the logs and make them dynamic. See Bug 296631. This is mostly like to make it to Juno M5 release.

What do you mean by dynamic?
If you notice, the debug options can be loaded at the launch time (using -osgi.debug) or programatically when running. However, if you wish to turn the tracing on/off in a running product, its tricky. PDE will be providing an extension using which a plug-in can expose its debug option flags. The UI will display these flags in preferences where they can be turned on/off for a running application. Cool! isn't it?


* If you find any discrepancies in the above post, please bring it to my notice so that they can be updated.

Update: Tracing UI is now available in latest Integration builds and will be there from Juno M5.

January 16, 2012

Tom Schindl
Tom Schindl

SVG for FXML-Conversion

So some weeks ago I read Jasper Potts blog on FXG to FXML-Conversion tool (useing simple XSL-Stylesheet). This blog Jasper asked if there’s probably one day someone providing a conversion tool for SVG.

This has been on my list for some time now and because I was traveling a bit in the last 2 weeks I had some time to hack on such a converter. I’ve not used XSL but instead used xtend (svg-parser (java),fxml-converter (xtend)) (because an XML-File comes with a lot of multiline strings). It took some time to wrap my head around SVG and how I could translate this in FXML/JavaFX 2.0 API calls but I finally I’m at a point where I have something to show off:

Please note that the JavaFX 2.0 image on the left is only made up of primitive JavaFX 2.0 elements (Circles, SVGPaths, Rect, Gradients, …) and it by far does not yet handle all the nifty stuff one can do with SVG but it shows me that such a conversion tool is doable to some extend though e.g. when it comes to filtering, … SVG has much more definitions than the JavaFX-API currently provides.

I was not even able to convert the SVG-Gaussian-Blur to JavaFX’ Gaussian-Blur (but that might just me I’m not an expert in graphics stuff), SVG allows to apply multiple filters/effects to a node, … . So to provide full SVG-Support – without residing to libraries like Batik – in JavaFX 2.x we’d need more API (or at least a tutorial how to e.g. write custom effects) but even with the current API one can get quite far as you don’t notice any missing thing in the above screenshot.

I’ve pushed the orignal svg-File (from the KDE oxygen-theme) and the resulting fxml-File to my git repo so that you can compare them.


Orion
Orion

Writing a Content Assist Plugin For Orion

Orion includes a simple but powerful infrastructure for implementing content assist for your favorite language. This article will describe how to create your own content assist plugin by working through a simple example. As with any Orion plugin, the starting point is an HTML file declaring your plugin. You can find a complete example here, but the body of the plugin is a simple script like this:

  window.onload = function() {
    var provider = new eclipse.PluginProvider();
    provider.registerServiceProvider("orion.edit.contentAssist",
      new RubyContentAssistProvider(),
      {name: "Ruby content assist", pattern: "\\.(ru|rb)$"});
    provider.connect();
  };

This script registers an implementation of the orion.edit.contentAssist service. The service parameters indicate that it should be associated with filenames ending in “.ru”, or “.rb”. The content assist implementation is found in the RubyContentAssistProvider object defined in a separate script, rubyContentAssist.js. This script defines a service implementation object declaring the computeProposals method. The completion reference for the arguments and return value of this method are provided in the orion.edit.contentAssist documentation.

Example 1: Simple keywords

Let’s start with a simple example that offers completion on a subset of Ruby’s reserved keywords.

function computeProposals(prefix) {
  return ["alias","and","begin", "break","case","class"];
}

We are given a string argument that contains the sequence of word characters immediately preceding the current cursor position. We didn’t use the argument here but we could have used it to only compute the proposals matching that prefix. Since a simple keyword list is trivial to compute we didn’t bother – the Orion content assist implementation will only show proposals matching that prefix anyway. Here’s a shot of our current content assist implementation in action:

Example 2: Advanced completion features

Now let’s look at a more interesting example:

  function computeProposals(prefix, buffer, selection) {
    var proposals = ["alias","and","begin", "break","case","class"];
    var prefixStart = selection.offset - prefix.length;
    var precedingChar = buffer.charAt(prefixStart - 1);
    if (precedingChar === '=' && "begin".indexOf(prefix) === 0) {
      //suggest writing a block comment
      proposals.push({
        proposal: "begin\n\n=end",
        description: "=begin - block comment",
        escapePosition: prefixStart+6
      });
    }
    return proposals;
  }

We have added two more arguments to the computeProposals function: buffer, and selection. These arguments contain the current editor buffer and selection at the time content assist was invoked. We are using this information to check if the user is attempting to create a Ruby block comment, which starts with “=begin”.

Instead of returning a simple string in this example, we are returning a proposal object. This object allows us to provide more details back to the caller such as a description of the proposal, and the cursor position the editor should have after the completion has been inserted. In this case we want the cursor to end up inside the newly created block comment.

Also note that the text of the proposal does not include the equals character. The completion engine will only replace the provided prefix word, which only includes normal word characters (letters, numbers, or the underscore character). We already know that the character immediately before the prefix is an equals character already, so we don’t need to insert another one. Here is a shot of our enhanced content assist in action:

Note that both the begin keyword and the block comment proposal are included here. The description we provided for the block comment proposal helps the user understand the difference in this case. A more complete example could do more sophisticated analysis of the source to rule out the possibility of a keyword appearing at this location, and only show the block comment proposal.

Example 3: Linked mode completion

We’ll use one final example to illustrate Orion’s linked mode completion. This works exactly like some of the content assist in the Eclipse Java development tools, where after selecting a proposal the user uses the tab key to iterate through a set of fields that need to be filled in. Once all the fields are filled in, the user presses enter to finish the insertion process and exit linked mode. In Orion we indicate a linked mode completion by adding a positions property to a returned proposal. This property is an array of position objects indicating the offset and length of each linked region that requires user completion. In this example we use linked mode for an “if block” template where the user must provide the conditional expression:

  function computeProposals(prefix, buffer, selection) {
    var proposals = [];
    var prefixStart = selection.offset - prefix.length;
    if ("if".indexOf(prefix) === 0) {
      //suggest writing a block comment
      proposals.push({
        proposal: "if condition\n\t\nend",
        description: "if - if block",
        positions: [{offset: prefixStart + 3, length: 9}]
        escapePosition: prefixStart+14
      });
    }
    return proposals;
  }

When this proposal is accepted, the proposal text is inserted and the editor selection moves to the first position, which is the “condition” field. Below is a screenshot of what the editor looks like after this proposal has been selected. Note that the message area in the Orion toolbar indicates to the user that they have entered into a linked mode completion.

After editing the condition, the user hits Enter to finish the insertion, and the cursor will move to the indicated escape position. Note that the escapePosition property doesn’t need to account for the fact that the user might add or remove characters in the linked fields before they are done. The content assist engine will automatically adjust this value to account for any typing, so you just need to record the final cursor position under the assumption that the user will not modify any of the linked fields.

This concludes our overview of Orion’s content assist infrastructure. As these examples illustrate, it is very easy to get started with writing your own content assist service for Orion. Writing a truly powerful content assist service requires much more in depth source code analysis, but Orion takes care of all the basic editing infrastructure to let you focus on the language analysis. Check out the complete Ruby editor example and Developer guide for the most up to date details.


Kai Toedter
Kai Toedter

GWT Contacts Demo with MVP and Testing

On Monday, January 23th, I am going to talk about some cool features of the Google Web Toolkit (GWT) at the OOP 2012 conference in Munich. To have a live demo for discussion, I implemented a GWT port of my Eclipse 4 Contacts Demo. In this blog post, I talk a bit about my experience with Google’s MVP (Model View Presenter) approach, including activities, places and event bus. Furthermore about UIBinder in combination with GWT Designer and Presenter testing using Mockito.

You can find the latest source of the demo at https://github.com/toedter/gwt-mvp-contacts. Here is a screen shot, as you see, I did not focus on nice design. Click on the image to see it in original size.

Model View Presenter (MVP)

The Model View Presenter Pattern has different flavors: “Passive View” and “Supervising controller“. In Passive View there is no dependency between model and view, Supervising Controller is not so strict and allows e.g. data binding from model to view. In GWT, presenters are represented by Activities, views are implemented by GWT UI classes. There are 2 common ways to define the binding between views and presenters: Either the presenter defines a display interface that the view has to implement, or the view interface provides a presenter interface. The latter one is often used in GWT when the UI is created with UIBinder, because it makes it easier for the view to call back to his presenter. In the contacts demo, the view interface for the list view looks like

public interface IContactListView extends IsWidget, AcceptsOneWidget {
  public interface Presenter {
    void goTo(Place place);
    void select(int index);
    void select(Contact contact);
  }

  void setPresenter(Presenter presenter);
  void selectInitialContact(Contact contact);
  void initialize(List contacts);
}

As you see, for laziness reasons I don’t use “Passive View” since I pass a domain object (Contact) to the view. A good introduction into GWT MVP you find at the GWT Web site. If you have a more application-like layout with kind of toolbar and several display regions, you might think you will need nested presenters/activities, but you don’t have to nest them. Thomas Broyer wrote a nice article about this issue, and I used his approach in my demo.

UIBinder and GWT Designer

UIBinder splits a UI component into a Java part and an XML/CSS part. That makes it easier to separate concerns and helps designers and developers working together. GWT Designer is a nice and free GWT UI Editor for Eclipse. One feature is the automatic creation of MPV related infrastructure, like corresponding activities and places. In the demo I have several implementations of the list view and the details view. You can change them by altering the ClientFactory implementation. The screen shot below shows a small details view example in GWT Designer, klick on it to see the image in original size.

Presenter Testing with mockito

One advantage of MVP based approaches is the good testability. For that purpose I wrote a few exemplary tests using mockito as Mocking framework. The reason for using plain JUnit tests together with mocks is mostly speed. With mockito it is pretty easy to mock all the involved GWT MVP infrastructure like activities, places, event bus and even a GWT Remote Procedure Call. Here is an example for a presenter test:

@RunWith(MockitoJUnitRunner.class)
public class ContactListActivityTest {

	@Mock
	private IClientFactory clientFactoryMock;

	@Mock
	private PlaceController placeControllerMock;

	@Mock
	private IContactListView contactListViewMock;

	@Mock
	private AcceptsOneWidget acceptsOneWidgetMock;

	@Mock
	private IContactServiceAsync contactServiceAsyncMock;

	@Mock
	private EventBus eventBusMock;

	private List contacts;
	private Contact contact1;
	private Contact contact2;

	@SuppressWarnings("unchecked")
	@Before
	public void setUp() throws Exception {
		when(clientFactoryMock.getPlaceController()).thenReturn(placeControllerMock);
		when(clientFactoryMock.getContactListView()).thenReturn(contactListViewMock);
		when(clientFactoryMock.getContactService()).thenReturn(contactServiceAsyncMock);

		// Mock a GWT RPC
		Answer answer = new Answer() {
			@Override
			public Void answer(InvocationOnMock invocation) {
				Object[] args = invocation.getArguments();
				AsyncCallback> asyncCallback = (AsyncCallback>) args[0];
				contact1 = new Contact();
				contact1.setFirstName("Kai");
				contact1.setLastName("Toedter");
				contact1.setEmail("kai@toedter.com");
				contact2 = new Contact();
				contact2.setFirstName("Kai2");
				contact2.setLastName("Toedter2");
				contact2.setEmail("kai2@toedter.com");
				final List contacts2 = new ArrayList();
				contacts2.add(contact1);
				contacts2.add(contact2);
				asyncCallback.onSuccess(contacts2);
				return null;
			}
		};

		doAnswer(answer).when(contactServiceAsyncMock).
                getAllContacts(any(AsyncCallback.class));

		// set the real contacts object, when clientFactory.setContacts is
		// called
		Answer setContactsAnswer = new Answer() {
			@Override
			public Void answer(InvocationOnMock invocation) throws Throwable {
				contacts = (List) invocation.getArguments()[0];
				// System.out.println("answer() to setContacts(): " + contacts);
				return null;
			}
		};

		doAnswer(setContactsAnswer).when(clientFactoryMock).setContacts(any(List.class));

		// Return the real contacts object, when clientFactory.getContacts is
		// called
		Answer> getContactsAnswer = new Answer>() {
			@Override
			public List answer(InvocationOnMock invocation) throws Throwable {
				return contacts;
			}
		};

		doAnswer(getContactsAnswer).when(clientFactoryMock).getContacts();
	}

	@Test
	public void testGotoPlace() {
		ContactListActivity contactListActivity =
                new ContactListActivity(new ContactPlace(null), clientFactoryMock);

		ContactPlace contactPlace = new ContactPlace("kai@toedter.com");
		contactListActivity.goTo(contactPlace);

		verify(placeControllerMock).goTo(contactPlace);
	}

	@Test
	public void testStartWithEmptyToken() {
		clientFactoryMock.setContacts(null); // force RCP
		ContactListActivity contactListActivity =
                   new ContactListActivity(new ContactPlace(""), clientFactoryMock);
		contactListActivity.start(acceptsOneWidgetMock, eventBusMock);

		verify(contactListViewMock).setPresenter(contactListActivity);
		verify(contactListViewMock).initialize(contacts);
	}

	@Test
	public void testStartWithToken() {
		String token = "kai@toedter.com";
		clientFactoryMock.setContacts(null); // force RCP

		ContactListActivity contactListActivity =
                new ContactListActivity(new ContactPlace(token), clientFactoryMock);
		contactListActivity.start(acceptsOneWidgetMock, eventBusMock);

		verify(contactListViewMock).setPresenter(contactListActivity);
		verify(contactListViewMock).initialize(contacts);
		verify(contactListViewMock).selectInitialContact(contact1);
		verify(eventBusMock).fireEvent(any(ContactViewEvent.class));
	}

	@Test
	public void testMayStop() {
		ContactListActivity contactListActivity =
                new ContactListActivity(new ContactPlace(null), clientFactoryMock);
		contactListActivity.start(acceptsOneWidgetMock, eventBusMock);
		contactListActivity.mayStop();

		verify(contactListViewMock).setPresenter(null);
	}

	@Test
	public void clientFactoryTest() {
		List testList = new ArrayList();
		clientFactoryMock.setContacts(testList);
		Assert.assertNotNull(clientFactoryMock.getContacts());
	}
}

If you are interested in above stuff and happen to be in Munich on January 23th 2012, join my Night School, 6:30pm at the OOP 2012.

Have Fun!

Kai

You find me on Twitter and Google+.
Next Eclipse RCP 3.x/4.x trainings in Munich

flattr this!

January 15, 2012

Stefan Winkler
Stefan Winkler

Separating the Wheat from the Chaff — Or: How to Sort Bugzilla Mails

One challenge in my daily work with my email is dealing with automated mails from Hudson or Bugzilla. As I am involved with several customer projects, I cannot keep track of all the Eclipse committer-related mail during the day.

As I am using GMail, I have become used to the mail filtering mechanism GMail offers to make email sent from Bugzilla or Hudson bypass the inbox and land in a separate IMAP folder (GMail uses a label metaphor, but when accessing mails via IMAP, GMail labels are mapped to IMAP folders).

Until recently, however, there was one problem, which I had not solved for months. As perhaps a lot of people do, I am not only receiving Bugzilla notifications related to bugs for which I am reporter, assignee, or on the CC list, but I also watch other Bugzilla accounts; most notably I, follow the emf.cdo-inbox@eclipse.org Bugzilla notifications to keep myself up to date (at least theoretically ...) with all the current bugs of CDO. The problem was that I wanted to separate the more important notifications (those for which I am reporter, assignee or explicitly part of the CC list) from the less important ones (namely those to emf.cdo-inbox). Most of the time (and here comes practice ...), I have too little time to dig through all the Bugzilla notifications and identify the important ones which I should really care about (or at least read) right now.

 

Of course, this is not a fault of Bugzilla, as Bugzilla sets really useful headers for its emails. In particular, the mails which I denoted as "more important" above can be identified by checking the content of the X-Bugzilla-Reason header. If this header contains CC, Reporter, or AssignedTo, I regard the notification as important. The actual problem is that GMail does not support filtering emails by arbitrary headers (or at least they have hidden that feature so well that I did not find it ...)

To solve the problem for me, I have not installed a small Unix utility called IMAPFilter on my virtual server which I am also using to host this blog. IMAPFilter can be configured via a config file written in the Lua programming language. This way, one can write arbitrary (and sophisticated, if needed) rules and commands to process email stored on one or more IMAP servers. In my case, a quite simple config file does the trick (Note: I still use GMail filtering rules to sort Bugzilla emails into the CDO/Bugzilla folder, because this was configured already, and it makes the IMAPFilter configuration a bit easier):

config.lua

myaccount = IMAP {
   server = 'imap.googlemail.com',
   username = 'myself@googlemail.com',
   password = 'S3cr3t!!!',
   ssl = 'ssl3'
}

results = myaccount['CDO/Bugzilla']:contain_field('X-Bugzilla-Reason','Reporter') 
  + myaccount['CDO/Bugzilla']:contain_field('X-Bugzilla-Reason','CC') 
  + myaccount['CDO/Bugzilla']:contain_field('X-Bugzilla-Reason','AssignedTo') 

results:move_messages(myaccount['CDO/Bugzilla-Important'])

(Note: the plus signs have to be read as logical OR)

That's almost it. The config.lua file goes into ~/.imapfilter and to execute the utility on a regular basis, I have created a crontab entry which calls imapfilter all 15 minutes:

0,15,30,45 * * * *     /usr/bin/imapfilter

Naturally, the above is only a simple example. Experiment for yourself to unleash the power of complex mail sorting.

Stephan Herrmann
Stephan Herrmann

A little statistics of the day

My latest query in Eclipse’s bugzilla answered 189 bugs.

Out of these a certain TLA was mentioned just in the bug summaries 54 times.
Additionally, the long form of the same word occurred 5 times.

Those who have followed my previous posts, know which three letters I’m referring to. Looks like they’re even more relevant in some Eclipse components than I ever fancied (no - not telling, in which component I searched :) ).

January 12, 2012

Saurav
Saurav

Eclipse Tips -Part 4

After quite a long time i chanced upon some UI programming. So the thought of putting the next edition of Eclipse Tips came to my mind.

File Browsing Dialog 


It may happen that you would like to browse for a file in the file system and then select it for further processing.Remember how you browse for projects when you import projects from your local file system.

The File browsing dialog can be brought by using FileDialog. You can also use the FileDialog to filter on the file names, extensions etc through the APIs such as public void setFilterNames (String [] names) and public void setFilterNames (String [] names) respectively.

This is how you can use FileDialog in your code


 FileDialog dialog = new FileDialog(parentComposite.getShell());

EMF Unparseable content

I also ventured into some intricacies of EMF Models.Part of my work was to evaluate the possiblity of sending non parseable content through the EMF Models. So i finalized two options Base64 Binary and CDATA.CDATA being the standard way caught my attention first. Here is the link which describes the difference CDATA and Base64 Binary. http://forums.devx.com/showthread.php?t=4667

CDATA


 In EMF you can pass the CDATA if you annotize your model with the mixed content.Please follow the steps to model a mixed content.

(a) Define the EClass for which you want to have the mixed content.Lets say I want to send my java script code through my Request EClass.
So i would define an EClass saying Request.Annotate the Request class by giving the source as Source http:///org/eclipse/emf/ecore/util/ExtendedMetaData.

(b) Create a new Details Entry value for that annotation with name as 'request' and kind as 'mixed'.So it makes the Request class to contain an attribute of type mixed content.

(c) Then define the actual attribute which will contain the mixed content for e.g. JSCode of type EFeatureMapEntry Then annotate JSCode with ExtendedMetadata and then put the Details Entry value with name as mixed and kind of elementWildCard.

How to add the CDATA from your code

//get the instance of the Request class


FeatureMapUtil.addCDATA(request.getJSCode(),"js code");


The FeatureMapUtil adds the CDATA to your mixed content attribute.

Another example i do is for the famous ExtLibrary model. I add an attribute called content in the Library class which contains the mixed content.Below is the xml of the ecore for that part.For this blog purpose i have removed all the other attributes and references of the Library class.



Check how the Library is class is told to contain a mixed attribute and then attribute called content is added which is the actual mixed content.

Base64 Binary


I also tried to explore the Base64Binary way of passing the content.

It is very simple as how to pass the Base64 binary data.Just create the attribute of type Base64Binary.EMF comes with a datatype built in for that.

I end this post here.

Happy working on eclipse.

Neil Bartlett
Neil Bartlett

Free OSGi BOF at DevCon 2012

The programme for the Birds-of-a-Feather (BOF) session at OSGi DevCon 2012 – co-hosted with EclipseCon 2012 – has been announced. I will be speaking about the Java 8 module system, Jigsaw and how they relate to OSGi: what are the differences; the pros and cons of each in different environments; and the potential for them to work together.

There will also be sessions on: OSGi Subsystems; simplifying development with the upcoming OSGi Bundle Repository (OBR) standard; and finally a surprise session from a mystery speaker.

The BOF is free to attend, you don’t need to be registered for OSGi DevCon/EclipseCon. So if you’re in the Washington DC area and interested in learning more about OSGi or meeting several of the top OSGi experts… you know where to go.

January 11, 2012

Neil Bartlett
Neil Bartlett

OSGi Training in 2012; London, NY, DC and Sydney

I will be running a series of OSGi training courses this year, with the first two being held in London and New York in February. The early bird pricing for London will expire in the next couple of days, so please do hurry to secure your place!

If you’re in North America and can’t make NY in February then there will be another chance to take the training in the Washington DC area (very close to Dulles airport). Then later in the year I will be down in Sydney, Australia.

You might be wondering about the “Masterclass in OSGi” series that I previously ran with Peter Kriens, who recently announced his resignation from the OSGi Alliance. Peter is very busy completing his duties for the Alliance and then will be fully engaged with his next venture, so he has told me that he is not able to participate in the masterclasses for the foreseeable future.

My new course is heavily based on the subjects and discussions that arose from the masterclasses that took place in 2010/11, though it is intended to be more accessible for OSGi beginners. I still believe it’s the absolute best way to quickly achieve a deep understanding and mastery of OSGi and modularity in Java, and I very much look forward to seeing you there.

Peter Kriens
Peter Kriens

Java Generics are a Lemon

After working with Java for almost 15 years and deep knowledge of Java generics on the class format level I learned something very basic the really, really hard way. I knew the collections in Java were not that good in comparison what you find in other environments (immutable anyone?) but now I learned that even adding all that extra cruft on my classes is useless when you have a major

Philip Wenig
Philip Wenig

Waiting for Java7 on Mac OS X 10.6.3 “Snow Leopard”

Somehow, it was a good decision to switch OpenChrom to Eclipse 3.7.1 (Indigo) and Java7 except of Mac 10.6.3 “Snow Leopard”. Why on earth do they not support Java7? I don’t know. But I was aware of, that I needed a quick workaround to make it running.

Hence, here’s my solution how to start RCP applications on Mac OS X using Java7:

First of all, create the folder “JavaVirtualMachines” in the directory “/Library/Java“. Unless it’s not created, you’re not able to install the Java7 Developer Preview.

user$ sudo mkdir /Library/Java/JavaVirtualMachines

You can choose between the JDK or JRE package. I took the JDK.

Install it by dragging it into the specified folder.

Now, we need to create a program specific launcher called “start.sh“, but you’re free to choose nearby any name you like. Therefore we dive into the application.app (in this case openchrom.app).

Create a file called “start.sh“.

The content of the starter “start.sh” depends on the specific settings of your RCP application. I took the settings from the application.ini file (in this case openchrom.ini).

#!/bin/sh

export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
LAUNCHER_JAR=../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar

java \
-Xms128M \
-Xmx500M \
-Dosgi.install.area.readOnly \
-Dosgi.configuration.area=@user.home/.openchrom/0.6.0/OpenChrom/configuration \
-Dosgi.instance.area.default=@user.home/OpenChrom/workspace \
-Dsun.awt.xembedserver=true \
-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts \
-jar $LAUNCHER_JAR

Start the terminal and navigate to the “start.sh” script. It is necessary to set the executable bit once using “chmod a+x“. The RCP application can now be started by starting the script using “./start.sh“.

user$ cd Desktop/0.6.0-PREV/OpenChrom/openchrom.app/Contents/MacOS/
user$ chmod a+x start.sh
user$ ./start.sh

This tutorial presented a workaround for OpenChrom. But it is applicable in the same way for Eclipse and other RCP applications.