aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/exampleplugin
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2008-06-03 09:40:44 +0000
committerYana Stamcheva <yana@jitsi.org>2008-06-03 09:40:44 +0000
commitb16eb53a7f32c26c831973183264f1646b937c74 (patch)
treec7a253fe5be1c4d70ebe4a464d071e908e58f011 /src/net/java/sip/communicator/plugin/exampleplugin
parentc7612d2e1a4968d117090e55f6e41eb642d070f4 (diff)
downloadjitsi-b16eb53a7f32c26c831973183264f1646b937c74.zip
jitsi-b16eb53a7f32c26c831973183264f1646b937c74.tar.gz
jitsi-b16eb53a7f32c26c831973183264f1646b937c74.tar.bz2
Remove depricated methods in the UIService.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/exampleplugin')
-rw-r--r--src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java36
-rw-r--r--src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginMenuItem.java22
2 files changed, 38 insertions, 20 deletions
diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java
index 1aa9b10..7902133 100644
--- a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java
+++ b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginActivator.java
@@ -6,30 +6,32 @@
*/
package net.java.sip.communicator.plugin.exampleplugin;
+import java.util.*;
+
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
public class ExamplePluginActivator implements BundleActivator
{
+ Logger logger = Logger.getLogger(ExamplePluginActivator.class);
+
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);
- }
-
+ {
+ ExamplePluginMenuItem examplePlugin = new ExamplePluginMenuItem();
+
+ Hashtable<String, String> containerFilter
+ = new Hashtable<String, String>();
+ containerFilter.put(
+ Container.CONTAINER_ID,
+ Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU.getID());
+
+ bc.registerService( PluginComponent.class.getName(),
+ examplePlugin,
+ containerFilter);
+
+ logger.info("CONTACT INFO... [REGISTERED]");
}
public void stop(BundleContext bc) throws Exception
diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginMenuItem.java b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginMenuItem.java
index 780f6e5..706911f 100644
--- a/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginMenuItem.java
+++ b/src/net/java/sip/communicator/plugin/exampleplugin/ExamplePluginMenuItem.java
@@ -14,11 +14,12 @@ import javax.swing.JMenuItem;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.contactlist.MetaContactGroup;
-import net.java.sip.communicator.service.gui.ContactAwareComponent;
+import net.java.sip.communicator.service.gui.*;
public class ExamplePluginMenuItem
extends JMenuItem
- implements ContactAwareComponent,
+ implements
+ PluginComponent,
ActionListener
{
private MetaContact metaContact;
@@ -27,7 +28,7 @@ public class ExamplePluginMenuItem
{
super("Example plugin");
- this.addActionListener(this);
+ this.addActionListener(this);
}
public void setCurrentContact(MetaContact metaContact)
@@ -51,4 +52,19 @@ public class ExamplePluginMenuItem
pluginDialog.setVisible(true);
}
+
+ public String getConstraints()
+ {
+ return null;
+ }
+
+ public Container getContainer()
+ {
+ return Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU;
+ }
+
+ public int getPositionIndex()
+ {
+ return -1;
+ }
}