Week in review

Man it has been a busy week. I had Monday off due to Easter (national holiday in Denmark) but since then it’s been busy, busy, busy…

Besides being at a customer site all week incl. Saturday I hadn’t really expected the level of interest there would be in the TwitNotes plugin for Notes 8. Of cause I expected some to install it and try it out but not to the degree I have seen and heard about. I certainly got to test the comment system on lekkimworld.com – boy I have received a lot of comments. I would like to say thank you to all those who commented and all those who have contacted me by e-mail. The level of interest has been astounding and flattering.

Looking back it has also been an interesting journey from a development perspective as it has certainly brought some of the strengths and weaknesses of the “new” Notes platform into the light. I don’t think there’s much doubt that the platform is powerful and there’s potential but I was surprised to discover the level of difference in SWT performance and functionality across the different platforms (Windows XP, Windows Vista, Linux and Mac). It certainly takes some more consideration than plain ol’ Notes development.

Today I’m spending some time helping out my girl friends dad install and configure a new computer. Other than that I hope to get some time to work on TwitNotes. Yesterday I did some for on the UI to detect and handle links in posts to make them clickable. It sounds and seems simple but now that the table data is custom drawn to handle text wrapping nothing is simple. I have the fundamentals done already though.

And the right term is…

I have been wondering what the “correct” term for the little menu that each sidebar plugin has so today I got in contact via Mary Beth Raven (via im.bleedyellow.com of cause). She told me that the IBM term for a sidebar plugin is a “sidebar panel” and the menu is called a “panel menu”. So there it is…

TwitNotes – v. 1.0.2 released

TwitNotes v. 1.0.2 has been released to the update site. This release fixes the row height issue, some minor label provider stuff and adds the source of TwitNotes to posts so the source show up as “TwitNotes” instead of “web”.

This release also adds a “Clear author cache” action to reset the cache of Twitter author details during runtime. I use this to clear the cache if Twitter for some reason sends me incorrect images or I’m simply want to refetch the images. TwitNotes will cache author info for the duration of your Notes session otherwise.

TwitNotes – deploying in Sametime

Deploying the TwitNotes shelfView (aka sidebar) component in Sametime 7.5.1/8.0 yields a nasty stacktrace from the underlying platform. I thought everything should work across both platforms with everything based on XPD. I haven taken care not to rely on Notes 8 API’s such as the topology service but I guess that would yield a bundle dependency issue and not a stacktrace like this.

Anyone seen similar?

java.lang.NullPointerException: The active part must not be null
        at org.eclipse.ui.internal.expressions.ActivePartExpression.(Unknown Source)
        at org.eclipse.ui.internal.PartSite.initializeDefaultServices(Unknown Source)
        at org.eclipse.ui.internal.PartSite.(Unknown Source)
        at org.eclipse.ui.internal.ViewSite.(Unknown Source)
        at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPartHelper(Unknown Source)
        at com.ibm.rcp.ui.internal.shelf.ShelfViewReference.createPart(Unknown Source)
        at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Unknown Source)
        at com.ibm.rcp.ui.shelf.ShelfPage.activatePart(Unknown Source)
        at com.ibm.rcp.ui.shelf.ShelfPage.access$10(Unknown Source)
        at com.ibm.rcp.ui.shelf.ShelfPage$7.handleEvent(Unknown Source)
        at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Unknown Source)
        at com.ibm.rcp.swt.swidgets.SViewForm.internalSetMaximized(Unknown Source)
        at com.ibm.rcp.swt.swidgets.SViewForm.setMaximized(Unknown Source)
        at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUpTitle(Unknown Source)
        at com.ibm.rcp.swt.swidgets.SViewForm.onMouseUp(Unknown Source)
        at com.ibm.rcp.swt.swidgets.SViewForm$4.handleEvent(Unknown Source)
        at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
        at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
        at com.ibm.rcp.personality.framework.internal.RCPApplication.run(Unknown Source)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Unknown Source)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
        at java.lang.reflect.AccessibleObject.invokeL(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
        at org.eclipse.core.launcher.Main.run(Main.java:977)
        at com.ibm.rcp.core.internal.launcher.Main.startLaunch(Main.java:895)
        at com.ibm.rcp.core.internal.launcher.Main.main(Main.java:1313)
        at java.lang.reflect.AccessibleObject.invokeV(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.ibm.oti.vm.JarRunner.main(Unknown Source)

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.

TwitNotes – example of multiple submit area providers

As mentioned in the documentation TwitNotes is extensible using extension points. One of the extensions make it possible to contribute so called submit area providers that is functionality that can submit information. The supplied Twitter submit area provider is one example but if you add another the UI is simply augmented with a tabbed folder as shown below where there’s two providers present.

TwitNotes v. 1.0.1 available

TwitNotes v. 1.0.1 is now available from the update site. This release solves the following issues:

  • Text not wrapping on Windows XP (solved using custom PaintListener). An unfortunate side effect is that long posts with long words are being truncated – I’m working on a solution to this.
  • Image disappearing when selecting a row (solved by widening the image column as described here)
  • XML entities not being correctly unescaped that is posts show & etc. (solved using Apache Commons Lang StringEscapeUtils.unescapeXml(String))

To update go to File/Application/Install and select “Search for updates of the currently installed features” and follow the directions on screen (almost like installing in the first place).

Comments welcome to this post.