Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.gui
Class AbstractPluginComponent

java.lang.Object
  extended by net.java.sip.communicator.service.gui.AbstractPluginComponent
All Implemented Interfaces:
PluginComponent
Direct Known Subclasses:
AboutWindowPluginComponent, CheckForUpdatesMenuItemComponent, ContactInfoMenuItem, ExamplePluginMenuItem, OtrMetaContactButton, OtrMetaContactMenu, SettingsWindowMenuEntry, WhiteboardMenuItem

public abstract class AbstractPluginComponent
extends Object
implements PluginComponent

Provides an abstract base implementation of PluginComponent in order to take care of the implementation boilerplate and let implementers focus on the specifics of their plug-in.

Author:
Lyubomir Marinov

Constructor Summary
protected AbstractPluginComponent(Container container)
          Initializes a new AbstractPluginComponent which is to be added to a specific Container.
 
Method Summary
 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.
 int getPositionIndex()
          Implements PluginComponent.getPositionIndex().
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.service.gui.PluginComponent
getComponent, getName
 

Constructor Detail

AbstractPluginComponent

protected AbstractPluginComponent(Container container)
Initializes a new AbstractPluginComponent which is to be added to a specific Container.

Parameters:
container - the container in which the component of the new plug-in is to be added
Method Detail

getConstraints

public String getConstraints()
Description copied from interface: PluginComponent
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.

Specified by:
getConstraints in interface PluginComponent
Returns:
the constraints, which will indicate to the container, where this component should be added.

getContainer

public Container getContainer()
Description copied from interface: PluginComponent
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.

Specified by:
getContainer in interface PluginComponent
Returns:
the container, where we would like to add our control.

getPositionIndex

public int getPositionIndex()
Implements PluginComponent.getPositionIndex(). Returns -1 which indicates that the position of this AbstractPluginComponent within its Container is of no importance.

Specified by:
getPositionIndex in interface PluginComponent
Returns:
-1 which indicates that the position of this AbstractPluginComponent within its Container is of no importance
See Also:
PluginComponent.getPositionIndex()

isNativeComponent

public boolean isNativeComponent()
Description copied from interface: PluginComponent
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.

Specified by:
isNativeComponent in interface PluginComponent
Returns:
true to indicate that this component is a native component and false otherwise.

setCurrentContact

public void setCurrentContact(Contact contact)
Description copied from interface: PluginComponent
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.

Specified by:
setCurrentContact in interface PluginComponent
Parameters:
contact - the current contact

setCurrentContact

public void setCurrentContact(MetaContact metaContact)
Description copied from interface: PluginComponent
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.

Specified by:
setCurrentContact in interface PluginComponent
Parameters:
metaContact - the current meta contact

setCurrentContactGroup

public void setCurrentContactGroup(MetaContactGroup metaGroup)
Description copied from interface: PluginComponent
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.

Specified by:
setCurrentContactGroup in interface PluginComponent
Parameters:
metaGroup - the current meta contact group

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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