SWT@Notes 8: -console

As partly addressed by Bob Balfe there are numerous ways to debug Eclipse/SWT components in Notes 8 or Lotus Expeditor. One is as Bob mentions to launch the client using the -console switch so the OSGi console is displayed. While confusing at first the OSGi console is really your friend when developing applications. From the console you have direct access to the OSGi subsystem of Eclipse. But it isn’t just for the Eclipse stuff. Since some Notes 8 components such as the property broker and topology manager have console commands you can interact with them from the console when troubleshooting/debugging.

To launch Notes 8 with the OSGi console create a new shortcut and use the following command (change the path if Notes isn’t installed in c:notes8):

"c:notes8frameworkrcprcplauncher.exe" -config notes -console

Besides the -console switch the the rcplauncher.exe executable takes a number of interesting arguments. One of the really cool ones is that you can supply a port number after the -console switch to make the console listen on a telnet port. This way you can connect to a remote client using telnet.

"c:notes8frameworkrcprcplauncher.exe" -config notes -console 23

Cool, cool, cool.

If you’re developing Eclipse components I really suggest you look into the OSGi console as it can assist in troubleshooting bundles that fail to load due to unsatisfied requirements.

Were to start? Well when you have the console available try out these commands:

  • help: Pretty self-explanatory
  • ss: Shows all the bundles installed with their status (be aware – there’s a lot of them)
  • setlogrlev: Sets the log level of individual loggers. I’ll have an upcoming blog post on logging.
  • pbsh: Work with the property broker e.g. see defined wires etc.

developerWorks: Plug-in development 101

Are you ready to get going on development of plug-ins for the Notes 8 client (Eclipse)? If you are then look no further than this series of articles on developerWorks: Plug-in development 101. It’s a bit sad that it isn’t Notes 8 specific but hey it’s in the Open Source zone but even though you get the basics of the necessary steps for creating plug-ins.

Setting table row height in SWT

So it appears you can actually set the row height of a SWT table despite me previously saying you couldn’t. The caveat is that it cannot be set on a per row basis. Row height is set using a Listener for SWT.MeasureItem and then setting the height property of the supplied event object as shown below.

// resize the row height using a MeasureItem listener
table.addListener(SWT.MeasureItem, new Listener() {
   public void handleEvent(Event event) {
      // height cannot be per row so simply set
      event.height = 67;
   }
});

If need be you could compute the actual height using the GC.stringExtent(String).y and simply set to the biggest value you encounter.

Information from Custom Drawing Table and Tree Items at Eclipse.org.

Two interesting pieces of Eclipse news

  • Microsoft forges first official link to Eclipse
    “Microsoft Corp. today announced its first collaboration with the open source Eclipse Foundation by committing provide engineering support to allow the Eclipse Standard Widget Toolkit (SWT) use Microsoft’s Windows Presentation Foundation (WPF). The move aims to make it easier for Java developers to write applications that look and feel like native Windows Vista, according to Microsoft.”
  • BlackBerry embraces Eclipse
    “Research In Motion (RIM) has joined the Eclipse Foundation and released a BlackBerry plug-in for Eclipse that provides the ability to develop and debug BlackBerry applications without leaving the familiar Eclipse environment.”

SWT @ Notes 8: Here we go again

As mentioned before Lotusphere 2008 I’m contemplating a series of posts on tips and tricks on developing Eclipse/SWT components for Notes 8. I has been a little quiet on this front since Lotusphere since it takes a little more time than I have been having lately to write these posts. Now with Easter on the horizon I’m planning to get a number of posts out there. I’m working on a number of posts on the subject and currently planning to address:

  • Logging
  • Debugging
  • Why OSGi is important
  • Preferences
  • Actions and ViewParts
  • OSGi services vs. Eclipse extensions

If you have other suggestions please let me know by commenting to this post.

Contributing to a developerWorks wiki

Today I entered the IBM wiki world by contributing to the Composite Application wiki over at developerWorks. It all started with me having to figure out how to add menu items to the menu of a sideshelf component. I found the answer in the wiki (for those interested it’s quite easy using the org.eclipse.ui.viewActions extension point). What I didn’t find was an example of how to programmatically add actions which I also needed so once I figured it out I added the information to the wiki. Programmatically adding actions is useful if you don’t know which actions to add at compile and/or deployment time.

So if you go to the page on creating sideshelf components you’ll find a section on programmatically adding actions.

I really like the idea of the wikis and I really feel good after having contributed. Get some, give some.

P.S.: I know I’m still way behind blogging on my holiday compared to Ed Brill… 🙂

Why you as a Notes guy or gal should care about Eclipse 3.4

First off this is quite a geeky post I suppose but bear with me – there’s a nice screenshot at the bottom of the post…

The Eclipse foundation is busy developing Eclipse 3.4 which is what will form the base for Notes 8.5 Standard. At least that’s what I’m hearing since the new Expeditor platform is based on Eclipse 3.4. Why should you care as a Notes developer? Why because each release of Eclipse adds significant performance improvements and many new features are added to the underlying platform. While we cannot know which features has already been ported to the Expeditor platform which is the base for Notes 8(.0.1) Standard it is at its core based on Eclipse 3.2.2.

Lots of features has been added since Eclipse 3.2.2 was released (Eclipse is currently at Eclipse 3.3.2) and many of them could have big impact on you as a developer or a Notes user. Why you say? Because the features of Eclipse will directly affect the platform support available to you if you develop SWT plug-ins or if you just use Notes 8 Standard (and don’t we all). Below is a sample list of improvements in Eclipse 3.3 I compiled from the “New and Noteworthy” documents for Eclipse 3.3M1 to 3.3M7.

  • SWT on Vista (win32). SWT now gets everything right on Microsoft Vista
  • Faster JPEG/PNG image loading. JPEG images now load from 30 to 70 percent faster, and PNG images load 2 to 3 times faster, depending on the image.
  • New DateTime control. Your users can now enter dates or times using the new DateTime control. You can see the DateTime control in action on the DateTime tab of the SWT ControlExample. The ControlExample is included with the other example plug-ins (see the “Example Plug-ins” section of the 3.3M3 download page).
  • Mozilla everywhere. Mozilla can now be used as the underlying browser control on Windows and OS X, providing that you have XULRunner installed and registered. To use this just create your Browser with the SWT.MOZILLA style.
  • Native features on Vista (win32). SWT is now exploiting more of the native features of the Vista platform. For example, using native double-buffering on Vista win32 makes painting in double-buffered canvases twice as fast.

As you can see some of them could have big impact on you as a developer or user. Everything from better Windows Vista integration to using Mozilla as the embedded browser to just having a DatePicker control could be the difference that makes it worth it.

I’m not saying it is so but that last one could be why I’m having problems with the Sametime screen capture tool on Vista.

As to Eclipse 3.4 I also just perused the “News and noteworthy” documents for the Eclipe 3.4 milestones (M1, M2, M3, M4, M5) and there is some nice stuff in there as well such as the possibility of setting an alpha value for shell (ie. the underlying SWT control for windows). This could make for some killer UI’s. Below is an example screenshot.

Can’t wait to have a much more mature Eclipse platform as the basis for my Notes client.

Re: Eclipse Monkey – it really could be coming!

I received an e-mail from Dan Sickles with a comment on my post on Eclipse Monkey. It appears that integration of Eclipse Monkey into Notes 8 is being worked on by Matthew Hatem – it might just be a “pocket-project” but still – it’s exciting!

Matt did the demos for Mary Beth Raven at Lotusphere and did the “CSS Inspector plug-in” to style Notes 8 Standard (using notes.css) on the fly. They’re still working on getting the plug-in out there.

Here’s the comment from Dan:

“You may have some details on this from your DP chat, but Eclipse Monkey for R8 and Expeditor in general was being shown in the labs at Lotusphere if you knew to ask. I’ve been pestering IBM about this for years. Matt Hatem showed me a very nicely integrated scripting language IDE implementation, probably done with the DLTK, with examples in Javascript (rhino) and ruby (JRuby). Jython, Groovy and any other JVM scripting language could work too.

With a few lines of code, you can add a sidebar or any other Expeditor/SWT component. All the details including UI/Notes threading are handled for you. This was the basis of a blog comment (I forget where) that in two years, most (okay many) new Notes apps will be not be written in Lotusscript or java. For apps of any complexity, the domain classes would certainly be written in java but the overall application logic and UI “controller” code would be a good candidate for a scripting language.

Ask for a demo. I would like to see this in the product.

-Dan Sickles
Las Vegas, NV”