aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java
blob: b7e79724002d2acdfff59fad623b746af1a0f356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.plugin.exampleplugin;

import net.java.sip.communicator.service.gui.*;

import org.osgi.framework.*;

public class ExamplePluginActivator implements BundleActivator
{
    public void start(BundleContext bc) throws Exception
    {   
        ServiceReference uiServiceRef
            = bc.getServiceReference(UIService.class.getName());
        
        UIService uiService
            = (UIService) bc.getService(uiServiceRef);        
        
        if(uiService.isContainerSupported(
            UIService.CONTAINER_CONTACT_RIGHT_BUTTON_MENU))
        {   
            ExamplePluginMenuItem examplePlugin = new ExamplePluginMenuItem();
            
            uiService.addComponent(
                UIService.CONTAINER_CONTACT_RIGHT_BUTTON_MENU,
                examplePlugin);
                
        }
        
    }

    public void stop(BundleContext bc) throws Exception
    {   
    }    
}