Creating Protocol Extensions
Development / CreatingProtocolExtensionsIn this document i am trying to explain how to add support for a new protocol to GOIM 2.
I'm doing this by giving the example of adding xfire support.
1. Creating a new protocol project
This will be the base protocol support.
-
New -> Project ... Plug-in project
- Project name: net.sphene.goim.protocol.xfire (this can be of course be different)
- Source Folder: src / Output Folder: bin
- This plug-in is targeted to run with: Eclipse version: 3.3
- Plug-in Options: do NOT check 'This plug-in will make contributions to the UI' (This will be done by a second plug-in)
- You might want to create an 'Activator' Class (e.g. XfireActivator)
-
Add the Extension
-
In the MANIFEST.MF open the 'Extensions' tab and click 'Add...'
- select net.sphene.goim.core.protocols
- make sure to add net.sphene.goim.core to the list of plug-in dependencies
- Select an appropriate id (e.g. net.sphene.goim.protocol.xfire.protocol), name and icon
- still in the MANIFEST-MF editor click on the 'class' link and create a new class - e.g. 'XfireProtocolExtension' - it has to implement IProtocolExtension
-
In the MANIFEST.MF open the 'Extensions' tab and click 'Add...'
This class will only need one method:
public IIMAccountConnection createIMAccountConnect(IAccount account)
the job of this method is to create a new IM connection for the given account.
So you need to create a new class which implements 'IIMAccountConnection' and - to make your life easier - extends AbstractIMAccountConnection.
2. Creating a new protocol UI project
The UI project is responsible for providing the login/register (if appropriate) dialogs for the wizard. It might also contain other protocol specific UI.
-
New -> Project .. Plug-in Project
- net.sphene.goim.protocol.xfire.ui - by convention the UI project simply has an 'ui' addition.
- This time check 'This plug-in will make contributions to the UI'
- Do not use any plug-in templates
- open the MANIFEST-MF and add a new extension to the extension point 'net.sphene.goim.core.ui.protocolui'
- protocolextension: this should be the ID of your protocol - in our example net.sphene.goim.protocol.xfire.protocol
Last Modified: 2008-03-08 19:32:43 by Herbert Poul - [ Snip Changes ] [ Wiki History ]
Comments
No comments yet.