Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.exampleplugin
Class ExamplePluginMenuItem

java.lang.Object
  extended by net.java.sip.communicator.service.gui.AbstractPluginComponent
      extended by net.java.sip.communicator.plugin.exampleplugin.ExamplePluginMenuItem
All Implemented Interfaces:
ActionListener, EventListener, PluginComponent

public class ExamplePluginMenuItem
extends AbstractPluginComponent
implements ActionListener

The ExamplePluginMenuItem is a JMenuItem that implements the PluginComponent interface. The PluginComponent interface allows us to add this menu item in the user interface bundle by registering it through the the bundle context (see ExamplePluginActivator.start(org.osgi.framework.BundleContext)).

Author:
Yana Stamcheva

Constructor Summary
ExamplePluginMenuItem()
          Creates an instance of ExamplePluginMenuItem.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Listens for events triggered by user clicks on this menu item.
 Object getComponent()
          Returns the component that should be added.
 String getName()
          Returns the name of this plugin component.
 void setCurrentContact(MetaContact metaContact)
          Sets the current MetaContact.
 
Methods inherited from class net.java.sip.communicator.service.gui.AbstractPluginComponent
getConstraints, getContainer, getPositionIndex, isNativeComponent, setCurrentContact, setCurrentContactGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExamplePluginMenuItem

public ExamplePluginMenuItem()
Creates an instance of ExamplePluginMenuItem.

Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Listens for events triggered by user clicks on this menu item. Opens the PluginDialog.

Specified by:
actionPerformed in interface ActionListener

getComponent

public Object getComponent()
Description copied from interface: PluginComponent
Returns the component that should be added. This method should return a valid AWT, SWT or Swing object in order to appear properly in the user interface.

Specified by:
getComponent in interface PluginComponent
Returns:
the component that should be added.

getName

public String getName()
Description copied from interface: PluginComponent
Returns the name of this plugin component. This name could be used as a label when the component is added to a container, which requires a title. A container that could request a name is for example a tabbed pane.

Specified by:
getName in interface PluginComponent
Returns:
the name of this plugin component

setCurrentContact

public void setCurrentContact(MetaContact metaContact)
Sets the current MetaContact. This in the case of the contact right button menu container would be the underlying contact in the contact list.

Specified by:
setCurrentContact in interface PluginComponent
Overrides:
setCurrentContact in class AbstractPluginComponent
Parameters:
metaContact - the MetaContact to set.
See Also:
PluginComponent.setCurrentContact(MetaContact)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.