Upload
internet
View
106
Download
1
Embed Size (px)
Citation preview
File Transfer API
E.C.F Eclipse
Plug-In
• Gerenciamento do Ciclo de vida dos Plugins.
- Carregar, Executar e Localizar
Quando o eclipse e iniciado ele sabe quais plugins estão instalados , pois todos os plugins estão instalados no que ele chama de Plugin registry.
Plataforma Eclipse
• O eclipse e organizado em níveis com plugins de baixo nível fornecendo ponto de extensão para os de alto nível.
• Plugins básicos são : - Standard Widget Toolkit (SWT) – API Gráfica (botões , Imagens, Labels)
- JFace – Extensão alto nível do SWT, que oferece mecanismos para construção de diálogos, wizards , Actions, ele também implementa arquitetura MVC.
Estrutura de um Plug-In
• A partir da v.3.X do eclipse, passaram a ser comandado por OSGi (Open Services Gateway initiative. Assim melhorando a portabilidade da ferramenta.
Estrutura
• Antes da versão 3.0 os plugins eram armazenado em um diretório próprio e todas as informações do Plugins estavam contidas no Plugins.xml, após a migração para o modelo OSGI , os plugins passaram a ser empacotados em arquivos JAR.
• Alem disso, as informações básicas sobre suas características foram movidas para o manifesta (META-INF / MANIFEST.MF), construídos apartar da versão 3.x contem dois descritores : Plugin.xml e Manifest.mf
Link para Exemplo Plugin
• http://javamagazine.com.br/downloads/jm37/jm-eclipseplugins.zip
Exemplo completo
File->New->project
Escolha:Plug-In development
Nesta tela informarmos os dados
Básicos do Plugins, como
Plugin-ID, Plugin-name e a
Classe de gerenciamento(class
Name)
Nesta tela lista os diversos
Template de plugin disponíveis
PDE.
PDE significa ( Plugin Deve
Lopment Environment)
O PDE gera automaticamente
O esqueleto de todas classes
Envolvidas e configura adequada
Mente os pontos de extensão.
Usaremos o plugin with popup menu
Analisando o Plugin.xml• <plugin>
• <extension• point="org.eclipse.ui.popupMenus">• <objectContribution• objectClass="org.eclipse.core.resources.IResource"• nameFilter="*"• id="br.com.jm.plugin.contribution1">• <menu• label="Leonardo Lima"• path="additions"• id="br.com.jm.plugin.menu1">• <separator• name="group1">• </separator>• </menu>• <action• label="Substituir caracteres especiais"• class="br.com.jm.plugin.popup.actions.SubstituirAction"• menubarPath="br.com.jm.plugin.menu1/group1"• enablesFor="1"• id="br.com.jm.plugin.newAction">• </action>• </objectContribution>• </extension>
• </plugin>
OverView• Docs• org.eclipse.ecf.filetransfer • Interfaces
IFileTransfer IFileTransferInfo IFileTransferListener IFileTransferPausable IFileTransferRateControl IIncomingFileTransfer IIncomingFileTransferRequestListener IOutgoingFileTransfer IOutgoingFileTransferContainerAdapter IRetrieveFileTransferContainerAdapter
• Classes FileTransferInfo
• Exceptions IncomingFileTransferException OutgoingFileTransferException UserCancelledException
Interface IFileTransfer
Method Summary
voidcancel() Cancel this file transfer.
java.lang.Exception getException() Get any exception associated with this file transfer.
doublegetPercentComplete() Get the percent complete for this file transfer.
booleanisDone() Return true if this file transfer is done, false if not yet completed.
Interface IFileTransferInfo
Method Summary java.lang.String getDescription()
Get any description associated with this file transfer info.
java.io.File getFile() Get the file for the proposed file transfer
long getFileSize() Get the file size (in bytes).
java.lang.StringgetMimeType()
Get the mime type string for this file transfer info.
java.util.Map getProperties() Get any properties associated with this file transfer.
Interface IFileTransferListener
Method Summary void handleTransferEvent(IFileTransferEvent event)
Handle file transfer events
Listener for handling file transfer events. Instances implementing this interface or sub-interfaces will have their handleTransferEvent called asynchronously when a given event is received. Implementers must be prepared to have this method called asynchronously by an arbitrary thread.
• http://www.eclipse.org/ecf/NewAndNoteworthy_0.4.0.html
Link para projetos ECF
• http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ecf/plugins/?root=Technology_Project
Link do Blog do ECF
• http://eclipseecf.blogspot.com/
Skype Provider
• http://wiki.eclipse.org/index.php/Skype_Provider
Skype Provider
• CALL
Skype Provider
• Send Msg