Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.gui
Interface PluginComponent

All Known Implementing Classes:
AboutWindowPluginComponent, AbstractPluginComponent, CheckerToggleButton, CheckForUpdatesMenuItemComponent, ContactInfoMenuItem, ExamplePluginMenuItem, LanguageMenuBar, OtrMetaContactButton, OtrMetaContactMenu, SettingsWindowMenuEntry, WhiteboardMenuItem

public interface PluginComponent

The PluginComponent is an interface meant to be implemented by all plugins that would like to add a user interface component to a particular container in the graphical user interface (GUI). In order to appear in the GUI all implementations of this interface should be registered through the OSGI bundle context.

All components interested in the current contact or group that they're dealing with (i.g. the one selected in the contact list for example), should implement the setCurrentContact and setCurrentContactGroup methods.

Note that getComponent should return a valid AWT, SWT or Swing control in order to appear properly in the GUI.

Author:
Yana Stamcheva

Method Summary
 Object getComponent()
          Returns the component that should be added.
 String getConstraints()
          Returns the constraints, which will indicate to the container, where this component should be added.
 Container getContainer()
          Returns the identifier of the container, where we would like to add our control.
 String getName()
          Returns the name of this plugin component.
 int getPositionIndex()
          Returns the index position of this component in the container, where it will be added.
 boolean isNativeComponent()
          Returns true to indicate that this component is a native component and false otherwise.
 void setCurrentContact(Contact contact)
          Sets the current contact.
 void setCurrentContact(MetaContact metaContact)
          Sets the current meta contact.
 void setCurrentContactGroup(MetaContactGroup metaGroup)
          Sets the current meta group.
 

Method Detail

getName

String getName()
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.

Returns:
the name of this plugin component

getContainer

Container getContainer()
Returns the identifier of the container, where we would like to add our control. All possible container identifiers are defined in the Container class. If the Container returned by this method is not supported by the current UI implementation the plugin won't be added.

Returns:
the container, where we would like to add our control.

getConstraints

String getConstraints()
Returns the constraints, which will indicate to the container, where this component should be added. All constraints are defined in the Container class and are as follows: START, END, TOP, BOTTOM, LEFT, RIGHT.

Returns:
the constraints, which will indicate to the container, where this component should be added.

getPositionIndex

int getPositionIndex()
Returns the index position of this component in the container, where it will be added. An index of 0 would mean that this component should be added before all other components. An index of -1 would mean that the position of this component is not important.

Returns:
the index position of this component in the container, where it will be added.

getComponent

Object getComponent()
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.

Returns:
the component that should be added.

setCurrentContact

void setCurrentContact(Contact contact)
Sets the current contact. Meant to be used by plugin components that are interested of the current contact. The current contact is the contact for the currently selected chat transport.

Parameters:
contact - the current contact

setCurrentContact

void setCurrentContact(MetaContact metaContact)
Sets the current meta contact. Meant to be used by plugin components that are interested of the current contact. The current contact could be the contact currently selected in the contact list or the contact for the currently selected chat, etc. It depends on the container, where this component is meant to be added.

Parameters:
metaContact - the current meta contact

setCurrentContactGroup

void setCurrentContactGroup(MetaContactGroup metaGroup)
Sets the current meta group. Meant to be used by plugin components that are interested of the current meta group. The current group is always the currently selected group in the contact list. If the group passed here is null, this means that no group is selected.

Parameters:
metaGroup - the current meta contact group

isNativeComponent

boolean isNativeComponent()
Returns true to indicate that this component is a native component and false otherwise. This method is meant to be used by containers if a special treatment is needed for native components.

Returns:
true to indicate that this component is a native component and false otherwise.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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