Show ‘n Tell Thursday: SWT drag’n’drop in Notes 8.0.x and Notes 8.5 (19 February 2009)


This weeks SnTT post is about adding drag’n’drop of Lotus Sametime buddies in the Notes 8.0.x Standard and Notes 8.5 Standard client in SWT plug-ins. Unfortunately the Sametime API for dragging buddies around changed between Sametime 8.0.0 and Sametime 8.0.1 so you have to take this into account when developing drag’n’drop functionality that works across Notes 8.0.x and Notes 8.5. Read on…

As mentioned in my Drag’n’drop in SWT components post drag’n’drop uses a socalled Transfer classes to signal which types of data a drag source delivers and a drop target accepts. To allow Sametime buddies to dropped on your component you use PersonGroupTransfer class but this class changed package from Sametime 8.0.0 to Sametime 8.0.1… 🙁

In Sametime 8.0.0 (Notes 8.0.x) the class is com.ibm.collaboration.realtime.people.PersonGroupTransfer and in Sametime 8.0.1 (Notes 8.5) the class is com.ibm.collaboration.realtime.people.PersonGroupTransfer (do not mind that the Sametime 8.0.0 class is in an “internal” package as it is exported from the plug-in). This means that if you develop a plug-in that needs to run on both Notes 8.0.x and Notes 8.5 you need to factor the drag’n’drop support out into two separate plug-ins and match based on perfect version numbers of the com.ibm.rcp.collaboration.realtime.people.impl plug-in.

It’s a bit cumbersome but it works fine.

Published by

lekkim

Positive, competent, out-spoken, frank and customer focused architect and developer with a strong foundation in web, cloud and product development. I'm a strong advocate for API first and cloud based solutions and development. I have a knack for being able to communicate and present technically complicated matters in conference, customer and training settings. I've previously acted as team member and leader in a product organisation.

3 thoughts on “Show ‘n Tell Thursday: SWT drag’n’drop in Notes 8.0.x and Notes 8.5 (19 February 2009)”

  1. Hi,

    I need to catch data from Data from Sametime Contact Window. But I am unable to cast the event.data to right object. Need your help on it.

    I am attaching piece of code below.

    public void drop(DropTargetEvent event) {

                   

                    if (PersonGroupTransfer .getInstance().isSupportedType(event.currentDataType)) {

                     

               

                        PersonImpl persons = (PersonImpl) event.data;

  2.  It has been a while since I last did it but without digging up code from svn this is off the top of my head. Think there is a plain PersonTransfer object for dragging individual persons. if you use PersonGroupTransfer I think you have to cast to a person type. Also the safest way is not to cast but adapt. 

Comments are closed.