Enterprise Instant Messaging (Microsoft Unified Communications , IBM Sametime, Jabber)

Comprehensive Instant Messaging information resource for enterprise IT professionals
posts - 94, comments - 0, trackbacks - 0

Using Quickfind text field to search users in Sametime Connect Client 7.5.1

Quickfind text field allows users to quickly search users in Sametime Connect Client. Quickfind text field is a SWT composite, so you can add it your SWT shells and dialogs. This article demonstrates the process of using this text field in your plug-ins

Step1: Add following dependencies to the plug-in:
    com.ibm.collaboration.realtime.people
    com.ibm.collaboration.realtime.quickfind

Step2: Add following import statements in the java class:
    import com.ibm.collaboration.realtime.quickfind.ui.QuickFindWidget;
    import com.ibm.collaboration.realtime.people.internal.PersonImpl;
    import com.ibm.collaboration.realtime.quickfind.QuickFindResult;

Step3: Add it to SWT container and retrieve search results
    QuickFindWidget tmpQuickFindWidget = new QuickFindWidget(<SWT Container>, 0) {
    public boolean handleSelection(final QuickFindResult result)
    {
        try {
            Display.getDefault().asyncExec(new Runnable() {
            public void run() {
                try {
                        //Get Search results
                        PersonImpl tmpPersonImpl =(PersonImpl)result.getData();
                        System.out.println(“Display name: “ + tmpPersonImpl.getPerson().getDisplayName());
                        System.out.println(“STID: ” + tmpPersonImpl.getPerson().getContactId());
                    } catch (Exception e){ e.printStackTrace(); }
        }});
        } catch (Exception ex){
            ex.printStackTrace();
        }
        return true;
    }
    };
    tmpQuickFindWidget.setLayoutData(<Set Layout>);

Print | posted on Friday, June 22, 2007 12:45 PM |