Archive for the ‘RCP’ Category

Sharemedia
Collaboration between ShareMedia and Remus Information Management

August 11th, 2009

ShareMedia and Remus information Management are two open source RCP applications which have similar features :

ShareMedia is a multi-platform photo manager. It supports several repositories such as local computer, Jabber, Picasa web or Flickr.

RIM is a free OpenSource client application for the management of information with a connection to multitude of data repositories like Flickr, Youtube or Facebook and a desktop-integration for an optimal usage for the offline management, visualization and easy accessibility of information to the user.

A few weeks ago, Tom Seidel and I decided to work on Eclipse bundles that will be shared between the two projects in order to speed up development and improve reusability of our code.

Our first goal is to define a common API which will be used by both applications and to port the existing image viewers from ShareMedia to this new API. ShareMedia has two full screen viewers including an OpenGL based one, inspired from CoverFlow from iTunes (see screencast bellow @0:55).

While these bundles are mainly targeted to ShareMedia and RIM, they can also be used in the Eclipse IDE and in any RCP application.

We now have a first implementation of the viewer API and two basic viewers. A few features are still missing and there is no background image loading so the IU may freeze a few seconds while loading large images, but it is working.

The following explains how to install the viewers in Eclipse and in an RCP application.

Installing the demo viewer into Eclipse :

The viewer has a dependency on Nebula Gallery which is not yet packaged into the feature. So you have to install the gallery widget from its update site :

http://download.eclipse.org/technology/nebula/gallery/update-N/

then install the demo viewer from ShareMedia / RIM update site :

http://smedia-rim.sourceforge.net/update/site.xml

Testing the viewer :

Select one or several image files in the package viewer / navigator view, open the context menu and select View in full screen…

viewer-fullscreen

Your monitors will fade to black and the first file will be displayed on your primary monitor. Commands are : ESC – Return to Eclipse , SPACE – Next image.

Multi-monitor setups are supported. Your secondary monitor will let you select the image to display on the primary monitor using a gallery of all items from your selection.

How to add a viewer to your application :

First, you will have to add the following bundles to your application

  • org.sharemediarim.api : the base API plugin, always required
  • org.sharemediarim.simple : the basic viewers. These are the only viewers available right now, just wait :-)
  • org.sharemediarim.viewers.adapter.file : the adapter for IFile objects. Only if you want do show eclipse resources (IFile) in the viewer.
  • org.apache.sanselan : dependency of o.s.v.adapter.file, used to read image thumbnails.
  • org.sharemedia.rim.viewers : Eclipse integration. Adds full screen action for IFile items in the context menu.

If you didn’t use the Eclipse integration, you can open the viewer from your code (usually in an action) :

1 – Create a viewer : a viewer can display images, but not necessary in full screen. It can also be hosted in a view :

IViewer viewer= new SampleViewer();

2 – Create a full screen viewer from the previous viewer. You can also provide additional viewers which will be displayed on secondary monitors.

final GenericFullScreenViewer fullScreenViewer = new GenericFullScreenViewer(new SampleViewer());

3 – Set the viewer’s input. Objects within the selection must implement IAdaptable and have an adapter to Image or IAdvancedImage. We provide a default Adapter for IFile in org.sharemediarim.viewers.adapter.file.

fullScreenViewer.setInput(structuredSelection);

4 – Register a listener to dispose the viewer on close. You can also reuse the viewer every time, and dispose it only on exit.

fullScreenViewer.addCloseListener(new Listener() {
public void handleEvent(Event event) {
viewer.dispose();
}});

5 – Finally, open the viewer :

fullScreenViewer.open();

Get involved :

If you are interested by using these viewers in your application or by creating new implementations, don’t hesitate to get in touch with us and help improve this API and viewers.

Project home page : http://sourceforge.net/projects/smedia-rim/

Issue tracker : http://www.remus-software.org/jira/browse/SMEDIARIM

Forum : http://sourceforge.net/forum/forum.php?forum_id=977188

Apple
Growl support for Eclipse RCP

July 5th, 2009

On Mac OS X, Growl has become the de facto standard for all notifications. There is an opened bug asking for Growl support in SWT/RCP : Bug 209911 – [Mac] Support for Growl notifications.

The best solution would be to have a standard API for notification with support for notification plug ins (including growl) and this is exactly what is discussed on bug 209911 and on the wiki page for Platform UI/Notifications.

But for those wanting to add Growl support to their applications as soon as possible, I’ve just attached to bug 209911 a plug-in which can successfully send Growl notifications.

Growl Action

Growl Action

Growl Notification from Eclipse

Growl Notification from Eclipse

The Growl wrapper depends on Apple’s Java/cocoa bindings, so the trick was to add external libraries to the plugin classpath :

Bundle-ClassPath: .,
external:/System/Library/Java

It works, but you should know that :

  • Apple Java/Cocoa bindings are deprecated.
  • This does not work with Cocoa/x86_64, probably because of the deprecation. There you get the following error :java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib: no suitable
    image found. Did find: /usr/lib/java/libObjCJava.A.dylib: no matching
    architecture in universal wrapper

Hopefully, the Growl wrapper is a really small class, and it should be rather easy to rewrite it with SWT’s internal Cocoa packages for someone who knows Cocoa (I don’t). If you want to take a look at the wrapper, just download my attachment to Bug 209911 and take a look at the class : com.growl.Growl.

Sharemedia
ShareMedia 0.3.1 is coming

November 2nd, 2007

Just publishing a screenshot of the latest and soon-to-be-released build of ShareMedia. This is me, browsing a Google Picasa album in ShareMedia on a dual monitor setup running Windows.

UI is is french but will hopefully switch to english depending of your locale.

Browsing Picasa Web

ShareMedia latest features include :

  • Write support for Picasa Web Albums (create new albums, upload files)
  • Better information view
  • Bug fixes
  • A lot of new extension points for developers

About ShareMedia : This is an opensource project, which goal is to create a multi platform photo manager and viewer (well, there is a basic support for videos too and music is planned), being able to use any backend for file storage : (your computer, friends computers, Picasa, Flickr, FaceBook, ..) while keeping the same features (copy, edit metadata, 3D slideshow, …). It is based on the Eclipse RCP framework.

The latest nightly builds can be found here (be careful, these are dev builds. Linux builds have problems with OpenGL)

The project page is here at sourceforge.

Thumbnails are displayed using the Nebula Gallery Widget
(We’re looking for help too :-) )

Eclipse
Continuous build for RCP apps.

September 17th, 2007

Setting up a continous build for RCP is not as easy as it should be. It took me approx. 1 day to make it work (being interrupted all the time) . This is how I did :

I used at first PDE Automation, but this article which can be found on eclipse.org is really outdated.
This page has all you have to know : Help : pde_product_build

Looks like it’s simple, isn’t it ? Well there are issues when you do it for real :

  • My rcp app is based on several plugins, with dependencies between each other. The build process seems to just ignore these dependencies and start compiling some plugins before the one on wich they depends. And the process fails. I had to move features order in my product definition to fix the compilation. (maybe some dependencies issues in my features, I have to check that)
  • Once, the build worked for one platform, I tried to make it produce an archive for each platform. The build process is supposed to support this by adding several platform to the configs properties. Actually, only the first one is correctly build, and the second one does not include the RCP feature (not useable). I had to make 3 different config and call the build 3 times in a row to produce the files for win32, linux, and macos.
  • Finally, I looked for an Intel Mac target, but this config is not supported, simply because the packaging is exactly the same as PPC Mac. You can safely use macosx, carbon, ppc as target for all macs (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=138047)

I added my own scripts to check out my app from SVN (only CVS is supported by automated builds) and to deploy the builds to my web server. The build is call from cron. Everything works :-)

(As usual, I’ll post these issues to bugzilla asap)

Sharemedia
Media Flow :-)

August 25th, 2007

Although I had other things to work on, I couldn’t resist to make an OpenGL library viewer for ShareMedia, my RCP based media management and sharing application. This was really easy : I only had to reuse the OpenGL full screen viewer I made w/ LWJGL some months ago and thanks to RCP extension points, it took less than 1h.

Work is still necessary to fix some small remaining issues and enable media selection using the mouse. But, hey, it already looks great :-)


Media Flow :-)

This library view will be available in the next release of Sharemedia (probably next week).