A powerful function…

Many have downloaded, looked at, and have commented on the source code for the attachment viewer project but some may not be aware of a powerful function the SWT Browser brings to the table.  As described in a past post about the architecture, the line where the browser is connected with the embedded browser process (its actually a dotted line) is where this call happens.  The function, or method, is the execute method on the SWT browser.  This allows you to run essentially any JavaScript on a given web page or DOM.  The attachment viewer uses this method to call a JavaScript function named “showAttachments()”.  The Eclipse Java code takes the current selection – which in this case it looks for IAttachment – and then passes a set of URL’s and JSON to that JavaScript function.   This is how easy it is to “connect” the web world with the Eclipse world.

String cmd = "showAttachments(" + jObj.toString() + ");";
 if (browser.execute(cmd) == false){

Tutorial: How to add the Attachment Viewer to your mail file

As promised, here is the step by step tutorial for adding the attachment viewer to your email.  Go ahead and check out the video before you begin so you will get a clear picture of what I am talking about – in case you missed the post.  While these steps are very basic, I am going to explain them using the very technical Eclipse terminology so in the end you will surely know how the Notes 8 client is constructed and especially Mail. :)

Continue reading

Demo: Attachment viewer for Notes 8

So I was challenged a couple of days ago by Art Thomas to give him an attachment viewer for when he receives images, movies, etc in mail and he just wants to immediately view them without launching them individually.  I started thinking about how I would implement it and I came to the conclusion that we kind of have the ultimate viewer right at our disposable – the SWT Browser!  So in short, watch the video and let me know what you think.

I gave this out internally for now as a Widget and also showed some people how to change their mail application to have the viewer embedded into Memo and Reply forms (as I demonstrate in the video).  I think this project will be good for OpenNTF and a couple of tutorial videos on how I did it….more to come.

For video click more.

Continue reading

Why SWT/Qt when you have the Lotus platform?

I just read this interesting post about a project for an SWT version based on Qt.  The project argues it is for styling purposes.  What is interesting is the Lotus platform (Lotus Expeditor) which is what Lotus Notes 8.x is based on has had SWidgets since day one.  We even tried to get SWidgets put back into the Eclipse platform but with no success.   You can play with the Lotus Expeditor platform and the toolkit for free.

If you are not familiar with Lotus Notes or Lotus Expeditor you can check out the UI – which is all based on Eclipse/SWT over at the Lotus Notes site.

Here is a screen shot of the Notes email system with styled SWT widgets:

Automating SWT based applications with SWTBot

Many Lotus customers (and Lotus itself) use Rational Functional Tester(RFT) and in many ways RFT does a great job and in many ways it can be just too much for what you need to do.  If you want to integrate UI testing into your unit testing you might want to check out SWTBot.  I have recently started looking at SWTBot with a serious eye.  I plan on playing around with it for our own team use and I also have some team members looking into it to automate their areas.  I would like to get some feedback from the blogosphere and find out if anyone has actually used this or has integrated it into their ant scripts.  The site has a lot of good pages and articles to get you started running pretty quickly.  I think since its Java/Eclipse based it plays well into the “test driven development” model many companies are moving towards and should feel so daunting to a developer.

Code Snippet: Locating the source or target view part from a Property Broker action

This is a commonly used piece of function if you are writing SWT based components that use Property Broker for declarative communication.  The SWTHelper class does a few things that can make you code easier to follow.  If you have any other suggestions around this space get with me or post feedback on the wiki.

Locating the source or target view part from a Property Broker action