SlideShare a Scribd company logo
The Structure of an Eclipse Plug-in




This is a detailed description of the different parts that makes up an
Eclipse plug-in. The module focuses on the purpose of the different files
of a plug-in such as plugin.xml and the OSGi manifest file, MANIFEST.MF.
The module also describes how plug-ins are developed in Eclipse with
PDE, the Plug-in Development Environment




Redistribution and other use of this material requires written permission from The RCP Company.

L0001 - 2010-11-27
Basic Eclipse File Structure


An Eclipse IDE or RCP-based product consists of a rather large number of
files

The more important are the following
     configuration/* – the configuration of the product
     configuration/config.ini – the master configuration file
     plugins/* – the plug-ins of the product
     features/* – the features of the product
     name.exe – the executable that starts the application
     name.ini – application options




2
                                                                           L0001 - 2010-11-27
What is an Eclipse Plug-in


A plug-in is the smallest functionality that is managed in the Eclipse
platform

Plug-ins are described via a number of configuration files

Plug-ins have different forms under development and runtime

Plug-ins are sometimes deployed individually
     If you need update support, plug-ins must always be deployed as parts
      of a feature

A fragment has the same structure as a plug-in with very few changes




3
                                                                          L0001 - 2010-11-27
What Makes Up a Plug-in at Runtime?


Two types of plug-ins:
     Jar-based
     Directory-based

Directory based plug-ins used when
components outside the Eclipse run-time
component need access to files of the plug-in

This directory based plug-in consists of:
     about.html – textual description of the
      plug-in
     junit.jar – archive that contains plug-in
      code
     META-INFMANIFEST.MF – the identity of
      the plug-in
     plugin.properties – localized strings
     plugin.xml – extension points and
      extensions
     In this case the jar file must be accessible
      from the tested application


4
                                                     L0001 - 2010-11-27
Runtime Files of a Plug-in


OSGi files
     META-INF/MANIFEST.MF – description of OSGi bundle
     .options – options for this specific plug-in

General plug-in files
     plugin.xml and fragment.xml – description of extension points and
      extensions of a plug-in
     plugin.properties and fragment.properties – localized strings for the
      previous files




5
                                                                              L0001 - 2010-11-27
Runtime Files of a Plug-in


Product-specific files
     splash.bmp – splash screen used at product start-up
     about.ini – description of a product
     about.properties – localized strings for about.ini
     about.mappings – very simple macro facility for about.properties
     about.html – additional information about plug-in including licensing
     plugin_customization.ini – options for different plug-ins
     plugin_customization.properties – localized strings for
      plugin_customization.ini

*.jar – jar files with typically 3rd party functionality




6
                                                                              L0001 - 2010-11-27
Development-time Files of a Plug-in


Eclipse Project files:
     .project – basic description of Eclipse project
     .classpath – the Java class path for a Java Eclipse project (and thus also
      a PDE project)
     .settings – preference store for project level preferences – includes all
      property settings for the project

Product specification files
     *.product – product declaration files

Build declarations
     build.properties – build information for Ant with content of the
      resulting jar files for the project

Extension Points
     *.exsd – extension point declaration files



7
                                                                                  L0001 - 2010-11-27
MANIFEST.MF File


The OSGi manifest file describes the identify of the plug-in and the
dependencies on other plug-ins

Manifest files are very seldom edited directly!




     Manifest-Version: 1.0
     Bundle-ManifestVersion: 2
     Bundle-Name: %pluginName
     Bundle-SymbolicName: com.rcpcompany.training.cm33.core; singleton:=true
     Bundle-Version: 2.1.0
     Bundle-ClassPath: .
     Bundle-Vendor: %providerName
     Bundle-Localization: plugin
     Bundle-RequiredExecutionEnvironment: J2SE-1.5
     Export-Package: com.rcpcompany.training.cm33.core,
      com.rcpcompany.training.cm33.core.util
     Require-Bundle: org.eclipse.core.runtime,
      org.eclipse.emf.ecore;visibility:=reexport
     Bundle-ActivationPolicy: lazy




8
                                                                               L0001 - 2010-11-27
plugin.xml File (3.2 edition)


    <extension point="org.eclipse.ui.actionSets">
        <actionSet
            label="Sample Action Set"
            visible="true"
            id="Demo.actionSet">
            <menu
                label="Sample &amp;Menu"
                id="sampleMenu">
                <separator
                    name="sampleGroup">
                </separator>
            </menu>
            <action
                label="&amp;Sample Action"
                icon="icons/sample.gif"
                class="demo.actions.SampleAction"
                tooltip="Hello, Eclipse world"
                menubarPath="sampleMenu/sampleGroup"
                id="demo.actions.SampleAction">
            </action>
        </actionSet>
    </extension>




9
                                                       L0001 - 2010-11-27
plugin.xml File (3.3 or later edition)

     <extension point="org.eclipse.ui.commands">
         <command
                  id="com.rcpcompany.demo.menu33.commands.HelloWorld"
                  name=”&amp;Sample Action” />
     </extension>
     <extension point="org.eclipse.ui.commandImages">
         <image
                  commandId="com.rcpcompany.demo.menu33.commands.HelloWorld"
                  icon="icons/sample.gif” />
     </extension>
     <extension point="org.eclipse.ui.handlers">
         <handler
                  class="demo.actions.SampleHandler"
                  commandId="com.rcpcompany.demo.menu33.commands.HelloWorld” />
     </extension>
     <extension point="org.eclipse.ui.menus">
         <menuContribution locationURI="menu:org.eclipse.ui.main.menu">
             <menu
                      id="sampleMenu"
                      label="Sample Menu"
                      mnemonic="M">
                  <command
                          commandId="com.rcpcompany.demo.menu33.commands.HelloWorld"
                          id="com.rcpcompany.demo.menu33.commands.HelloWorld.mc.sampleMenu” />
             </menu>
         </menuContribution>
     </extension>




10
                                                                                                 L0001 - 2010-11-27
Plug-in Editor




 Double-click on the plugin.xml or MANIFEST.MF
 opens the editor

 Almost all plug-in details can be changed in the
 editor

 Overview page displays basic plug-in
 information




11
                                                    L0001 - 2010-11-27
Dependencies Page




 Displays dependant plug-ins
      Created by tools when the plug-in type is
       chosen
      New dependences can be added




12
                                                   L0001 - 2010-11-27
Runtime Page




 Displays runtime information such as plug-in
 classpath

 Populated by the tools based on inputs from
 wizards

 Additional libraries can be added to the
 classpath




13
                                                L0001 - 2010-11-27
Extensions Page




 Displays plug-in extensions
      Created by the tool based on the plug-in
       type
      Extensions can be added




14
                                                  L0001 - 2010-11-27
Extension Points Page




 Displays plug-in extension points
      This example is taken from the
       org.eclipse.ui plug-in




15
                                        L0001 - 2010-11-27
Build and build.properties Pages




 Interface to the build.properties file
      specifies which .jar files to generate

 Also describes which non-Java files that are part
 of the generated .jar file




16
                                                     L0001 - 2010-11-27
Development Time and Runtime


 The format and content of a plug-in differs slightly between development
 time (in PDE) and runtime
      A development time plug-in is valid as a runtime plug-in
      A runtime plug-in does not include any sources – whether they are Java
       or XML files
      Normally a runtime plug-in is packaged as a single jar file, except
       
           when the plug-in contains multiple jar files – e.g. 3rd party
       
           when the plug-in contains writable files – almost never
      The exact content of the runtime edition of a plug-in is controlled in the
       Build tab of plugin.xml editor
       
           If your icons are red and translations are missing, then you probably
           forgot to tick files in the Build tab…




17
                                                                                   L0001 - 2010-11-27
More Information


 Platform Plug-in Developer Guide
      http://help.eclipse.org/help33/index.jsp

 OSGi Specifications
      http://osgi.org/osgi_technology/download_specs.asp?section=2

 “OSGi Bundle Manifest Headers”
      http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/
       reference/misc/bundle_manifest.html

 “Eclipse Plug-in Migration Guide”
      http://help.eclipse.org/ganymede/nav/2_3




18
                                                                              L0001 - 2010-11-27

More Related Content

What's hot (20)

PPTX
Discovering the p2 API
Pascal Rapicault
 
KEY
OSGi, Eclipse and API Tooling
Chris Aniszczyk
 
PPTX
Discovery the p2 API (updated to Indigo)
Pascal Rapicault
 
PDF
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
Tim Pettersen
 
PDF
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Ralf Sternberg
 
PDF
P2 Introduction
irbull
 
PPT
Eclipse IDE
Anirban Majumdar
 
PPT
Eclipse introduction IDE PRESENTATION
AYESHA JAVED
 
PPTX
Post-mortem Debugging of Windows Applications
GlobalLogic Ukraine
 
KEY
Tycho - Building plug-ins with Maven
Pascal Rapicault
 
PDF
Eclipse_Building_Blocks
Rahul Shukla
 
PDF
From Renamer Plugin to Polyglot IDE
intelliyole
 
PDF
What's new in Eclipse Mars
Lakshmi Priya
 
PDF
Common Client Rich Client Platforms
Geertjan Wielenga
 
PPTX
Migrating from MFC to Qt
GlobalLogic Ukraine
 
PDF
Gwt and JSR 269's Pluggable Annotation Processing API
Arnaud Tournier
 
PDF
How to Build Developer Tools on Top of IntelliJ Platform
intelliyole
 
ODP
OSGi Sticker Shock Eclipse Con 2010
ericjohnson
 
PPTX
Eclipse RCP Demo
Csaba Toth
 
PPT
Introduction To Eclipse RCP
whbath
 
Discovering the p2 API
Pascal Rapicault
 
OSGi, Eclipse and API Tooling
Chris Aniszczyk
 
Discovery the p2 API (updated to Indigo)
Pascal Rapicault
 
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
Tim Pettersen
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Ralf Sternberg
 
P2 Introduction
irbull
 
Eclipse IDE
Anirban Majumdar
 
Eclipse introduction IDE PRESENTATION
AYESHA JAVED
 
Post-mortem Debugging of Windows Applications
GlobalLogic Ukraine
 
Tycho - Building plug-ins with Maven
Pascal Rapicault
 
Eclipse_Building_Blocks
Rahul Shukla
 
From Renamer Plugin to Polyglot IDE
intelliyole
 
What's new in Eclipse Mars
Lakshmi Priya
 
Common Client Rich Client Platforms
Geertjan Wielenga
 
Migrating from MFC to Qt
GlobalLogic Ukraine
 
Gwt and JSR 269's Pluggable Annotation Processing API
Arnaud Tournier
 
How to Build Developer Tools on Top of IntelliJ Platform
intelliyole
 
OSGi Sticker Shock Eclipse Con 2010
ericjohnson
 
Eclipse RCP Demo
Csaba Toth
 
Introduction To Eclipse RCP
whbath
 

Similar to L0016 - The Structure of an Eclipse Plug-in (20)

PPT
ITU - MDD - Eclipse Plug-ins
Tonny Madsen
 
PDF
Tuscany : Applying OSGi After The Fact
Luciano Resende
 
PPT
eclipse.dk - Eclipse RCP Under the Hood
Tonny Madsen
 
PDF
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
PDF
Taming Beastly Web Applications with Server-Side OSGi
mrdon
 
PPT
Creation&imitation
Tae Young Lee
 
KEY
Tycho - good, bad or ugly ?
Max Andersen
 
PDF
Eclipse IDE, 2019.09, Java Development
Pei-Hsuan Hsieh
 
PDF
GlassFish v3 Lite Admin Console
anissalam
 
KEY
企业级软件的组件化和动态化开发实践
Jacky Chi
 
PDF
JavaOne 2010: OSGI Migrat
SAP HANA Cloud Platform
 
PPT
Eclipse Training - Introduction
Luca D'Onofrio
 
ODP
Plug yourself in and your app will never be the same (2 hr editon)
Mikkel Flindt Heisterberg
 
ODP
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 
PPTX
Workshop Framework(J2EE/OSGi/RCP)
Summer Lu
 
KEY
How To Make A Framework Plugin That Does Not Suck
Max Andersen
 
PDF
OSGi tech session
Bram de Kruijff
 
PDF
Pkg-config support for Eclipse CDT documentation
TuononenP
 
PDF
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Nuxeo
 
ITU - MDD - Eclipse Plug-ins
Tonny Madsen
 
Tuscany : Applying OSGi After The Fact
Luciano Resende
 
eclipse.dk - Eclipse RCP Under the Hood
Tonny Madsen
 
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Ou...
Paul Withers
 
Taming Beastly Web Applications with Server-Side OSGi
mrdon
 
Creation&imitation
Tae Young Lee
 
Tycho - good, bad or ugly ?
Max Andersen
 
Eclipse IDE, 2019.09, Java Development
Pei-Hsuan Hsieh
 
GlassFish v3 Lite Admin Console
anissalam
 
企业级软件的组件化和动态化开发实践
Jacky Chi
 
JavaOne 2010: OSGI Migrat
SAP HANA Cloud Platform
 
Eclipse Training - Introduction
Luca D'Onofrio
 
Plug yourself in and your app will never be the same (2 hr editon)
Mikkel Flindt Heisterberg
 
Plug yourself in and your app will never be the same (2 hour edition)
Mikkel Flindt Heisterberg
 
Workshop Framework(J2EE/OSGi/RCP)
Summer Lu
 
How To Make A Framework Plugin That Does Not Suck
Max Andersen
 
OSGi tech session
Bram de Kruijff
 
Pkg-config support for Eclipse CDT documentation
TuononenP
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Nuxeo
 
Ad

More from Tonny Madsen (20)

KEY
L0043 - Interfacing to Eclipse Standard Views
Tonny Madsen
 
PPT
L0037 - Basic Eclipse Configuration
Tonny Madsen
 
KEY
L0036 - Creating Views and Editors
Tonny Madsen
 
KEY
L0033 - JFace
Tonny Madsen
 
KEY
L0020 - The Basic RCP Application
Tonny Madsen
 
KEY
L0018 - SWT - The Standard Widget Toolkit
Tonny Madsen
 
KEY
L0001 - The Terminology of the Eclipse Platform
Tonny Madsen
 
KEY
EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale A...
Tonny Madsen
 
KEY
PROSA - Eclipse Is Just What?
Tonny Madsen
 
PPT
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Tonny Madsen
 
PPT
Eclipse Demo Camp 2010 - UI Bindings - An Introduction
Tonny Madsen
 
PPT
ITU - MDD – Model-to-Model Transformations
Tonny Madsen
 
PPT
IDA - Eclipse Workshop II (In Danish)
Tonny Madsen
 
PPT
IDA - Eclipse Workshop I (In Danish)
Tonny Madsen
 
PPT
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
Tonny Madsen
 
PPT
ITU - MDD - EMF
Tonny Madsen
 
PPT
ITU - MDD - XText
Tonny Madsen
 
PPT
EclipseCon '08 - BoF - Building a local Eclipse user group
Tonny Madsen
 
PPT
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Tonny Madsen
 
PPT
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
Tonny Madsen
 
L0043 - Interfacing to Eclipse Standard Views
Tonny Madsen
 
L0037 - Basic Eclipse Configuration
Tonny Madsen
 
L0036 - Creating Views and Editors
Tonny Madsen
 
L0033 - JFace
Tonny Madsen
 
L0020 - The Basic RCP Application
Tonny Madsen
 
L0018 - SWT - The Standard Widget Toolkit
Tonny Madsen
 
L0001 - The Terminology of the Eclipse Platform
Tonny Madsen
 
EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale A...
Tonny Madsen
 
PROSA - Eclipse Is Just What?
Tonny Madsen
 
Eclipse Demo Camp 2010 - Eclipse e4 – The Status and the Future
Tonny Madsen
 
Eclipse Demo Camp 2010 - UI Bindings - An Introduction
Tonny Madsen
 
ITU - MDD – Model-to-Model Transformations
Tonny Madsen
 
IDA - Eclipse Workshop II (In Danish)
Tonny Madsen
 
IDA - Eclipse Workshop I (In Danish)
Tonny Madsen
 
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...
Tonny Madsen
 
ITU - MDD - EMF
Tonny Madsen
 
ITU - MDD - XText
Tonny Madsen
 
EclipseCon '08 - BoF - Building a local Eclipse user group
Tonny Madsen
 
Eclipse Summit Europe '08 - Implementing Screen Flows in Eclipse RCP Applicat...
Tonny Madsen
 
EclipseCon '09 - The Happy Marriage of EMF, Data binding, UI Forms and Field ...
Tonny Madsen
 
Ad

Recently uploaded (20)

PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 

L0016 - The Structure of an Eclipse Plug-in

  • 1. The Structure of an Eclipse Plug-in This is a detailed description of the different parts that makes up an Eclipse plug-in. The module focuses on the purpose of the different files of a plug-in such as plugin.xml and the OSGi manifest file, MANIFEST.MF. The module also describes how plug-ins are developed in Eclipse with PDE, the Plug-in Development Environment Redistribution and other use of this material requires written permission from The RCP Company. L0001 - 2010-11-27
  • 2. Basic Eclipse File Structure An Eclipse IDE or RCP-based product consists of a rather large number of files The more important are the following  configuration/* – the configuration of the product  configuration/config.ini – the master configuration file  plugins/* – the plug-ins of the product  features/* – the features of the product  name.exe – the executable that starts the application  name.ini – application options 2 L0001 - 2010-11-27
  • 3. What is an Eclipse Plug-in A plug-in is the smallest functionality that is managed in the Eclipse platform Plug-ins are described via a number of configuration files Plug-ins have different forms under development and runtime Plug-ins are sometimes deployed individually  If you need update support, plug-ins must always be deployed as parts of a feature A fragment has the same structure as a plug-in with very few changes 3 L0001 - 2010-11-27
  • 4. What Makes Up a Plug-in at Runtime? Two types of plug-ins:  Jar-based  Directory-based Directory based plug-ins used when components outside the Eclipse run-time component need access to files of the plug-in This directory based plug-in consists of:  about.html – textual description of the plug-in  junit.jar – archive that contains plug-in code  META-INFMANIFEST.MF – the identity of the plug-in  plugin.properties – localized strings  plugin.xml – extension points and extensions  In this case the jar file must be accessible from the tested application 4 L0001 - 2010-11-27
  • 5. Runtime Files of a Plug-in OSGi files  META-INF/MANIFEST.MF – description of OSGi bundle  .options – options for this specific plug-in General plug-in files  plugin.xml and fragment.xml – description of extension points and extensions of a plug-in  plugin.properties and fragment.properties – localized strings for the previous files 5 L0001 - 2010-11-27
  • 6. Runtime Files of a Plug-in Product-specific files  splash.bmp – splash screen used at product start-up  about.ini – description of a product  about.properties – localized strings for about.ini  about.mappings – very simple macro facility for about.properties  about.html – additional information about plug-in including licensing  plugin_customization.ini – options for different plug-ins  plugin_customization.properties – localized strings for plugin_customization.ini *.jar – jar files with typically 3rd party functionality 6 L0001 - 2010-11-27
  • 7. Development-time Files of a Plug-in Eclipse Project files:  .project – basic description of Eclipse project  .classpath – the Java class path for a Java Eclipse project (and thus also a PDE project)  .settings – preference store for project level preferences – includes all property settings for the project Product specification files  *.product – product declaration files Build declarations  build.properties – build information for Ant with content of the resulting jar files for the project Extension Points  *.exsd – extension point declaration files 7 L0001 - 2010-11-27
  • 8. MANIFEST.MF File The OSGi manifest file describes the identify of the plug-in and the dependencies on other plug-ins Manifest files are very seldom edited directly! Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: com.rcpcompany.training.cm33.core; singleton:=true Bundle-Version: 2.1.0 Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: com.rcpcompany.training.cm33.core, com.rcpcompany.training.cm33.core.util Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport Bundle-ActivationPolicy: lazy 8 L0001 - 2010-11-27
  • 9. plugin.xml File (3.2 edition) <extension point="org.eclipse.ui.actionSets"> <actionSet label="Sample Action Set" visible="true" id="Demo.actionSet"> <menu label="Sample &amp;Menu" id="sampleMenu"> <separator name="sampleGroup"> </separator> </menu> <action label="&amp;Sample Action" icon="icons/sample.gif" class="demo.actions.SampleAction" tooltip="Hello, Eclipse world" menubarPath="sampleMenu/sampleGroup" id="demo.actions.SampleAction"> </action> </actionSet> </extension> 9 L0001 - 2010-11-27
  • 10. plugin.xml File (3.3 or later edition) <extension point="org.eclipse.ui.commands"> <command id="com.rcpcompany.demo.menu33.commands.HelloWorld" name=”&amp;Sample Action” /> </extension> <extension point="org.eclipse.ui.commandImages"> <image commandId="com.rcpcompany.demo.menu33.commands.HelloWorld" icon="icons/sample.gif” /> </extension> <extension point="org.eclipse.ui.handlers"> <handler class="demo.actions.SampleHandler" commandId="com.rcpcompany.demo.menu33.commands.HelloWorld” /> </extension> <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="menu:org.eclipse.ui.main.menu"> <menu id="sampleMenu" label="Sample Menu" mnemonic="M"> <command commandId="com.rcpcompany.demo.menu33.commands.HelloWorld" id="com.rcpcompany.demo.menu33.commands.HelloWorld.mc.sampleMenu” /> </menu> </menuContribution> </extension> 10 L0001 - 2010-11-27
  • 11. Plug-in Editor Double-click on the plugin.xml or MANIFEST.MF opens the editor Almost all plug-in details can be changed in the editor Overview page displays basic plug-in information 11 L0001 - 2010-11-27
  • 12. Dependencies Page Displays dependant plug-ins  Created by tools when the plug-in type is chosen  New dependences can be added 12 L0001 - 2010-11-27
  • 13. Runtime Page Displays runtime information such as plug-in classpath Populated by the tools based on inputs from wizards Additional libraries can be added to the classpath 13 L0001 - 2010-11-27
  • 14. Extensions Page Displays plug-in extensions  Created by the tool based on the plug-in type  Extensions can be added 14 L0001 - 2010-11-27
  • 15. Extension Points Page Displays plug-in extension points  This example is taken from the org.eclipse.ui plug-in 15 L0001 - 2010-11-27
  • 16. Build and build.properties Pages Interface to the build.properties file  specifies which .jar files to generate Also describes which non-Java files that are part of the generated .jar file 16 L0001 - 2010-11-27
  • 17. Development Time and Runtime The format and content of a plug-in differs slightly between development time (in PDE) and runtime  A development time plug-in is valid as a runtime plug-in  A runtime plug-in does not include any sources – whether they are Java or XML files  Normally a runtime plug-in is packaged as a single jar file, except  when the plug-in contains multiple jar files – e.g. 3rd party  when the plug-in contains writable files – almost never  The exact content of the runtime edition of a plug-in is controlled in the Build tab of plugin.xml editor  If your icons are red and translations are missing, then you probably forgot to tick files in the Build tab… 17 L0001 - 2010-11-27
  • 18. More Information Platform Plug-in Developer Guide  http://help.eclipse.org/help33/index.jsp OSGi Specifications  http://osgi.org/osgi_technology/download_specs.asp?section=2 “OSGi Bundle Manifest Headers”  http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/ reference/misc/bundle_manifest.html “Eclipse Plug-in Migration Guide”  http://help.eclipse.org/ganymede/nav/2_3 18 L0001 - 2010-11-27

Editor's Notes

  • #2: \n
  • #3: The configuration/config.ini file contains the very basic information needed to launch the product. This includes\nA list of all the plug-ins that should be load at start up.\nThe name of the product to start.\nThe file name of the splash screen to show while the product is started, if any.\nThe plug-ins that makes up an Eclipse RCP application can be divided into three basic groups:\nThe basic Eclipse RCP plug-ins such as org.eclipse.core.runtime and org.eclipse.swt.\n3rd party plug-ins such as BIRT, EMF but also org.eclipse.update.core.\nThe plug-ins with the functionality of the application.\nThe RCP runtime (and OSGi) does not distinguish between the different types of plug-ins. The format of plug-ins are described in the module &amp;#x201C;L0016 - The Structure of an Eclipse plug-in&amp;#x201D;.\nThe file system will only include features if the product is feature-based. And unless the product uses the update manager, there is no reason to use features.\n
  • #4: A fragment is recognized in the MANIFEST.MF file by the presence of the Fragment-Host specification.\n
  • #5: In the above example we see the junit plug-in directory. The junit plug-in is available after downloading and installing Eclipse. Every plug-in directory has archive and manifest files. In the above example there are two additional files:\nabout.html - that contains detailed textual description about plug-in\nplugin.properties - file that contains localized strings from plugin.xml\nPlease note that most plug-ins are distributed as .jar files where the above files are embedded with the exception of the .jar file.\nOSGi is able to handle plug-in jar files that in turn contain other jar files. This situation can occur when a 3rd party jar file is needed in an application, but for various reasons it cannot be repackaged &amp;#x2013; e.g. due to licensing restrictions or a digital signing on the original jar file. When PDE must handle embedded jar files it simply retrieve the files when the bundle is started and then rearranges the class path to include the new locations. This, though, is expensive both in terms of execution time and disk-space and should therefore normally be avoided, if possible.\n
  • #6: Most of these files can exist both in a jar based plug-in (a plug-in packaged as a single .jar file) and in a directory based plug-in. As long as the files from a plug-in are accessed using FileLocator.find(Bundle, IPath, Map) this is completely transparent.\nMore information:\nMANIFEST.MF: http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html\nabout.ini:\nhttp://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/reference/misc/about_customization.html\nSee the module &amp;#x201C;L0054 - Localization of an Eclipse RCP Application&amp;#x201D; for information on exactly what can be localized\n
  • #7: \n
  • #8: The declaration files for extension points are based on a restricted form of XSD (as also implied by the extension).\n
  • #9: The complete syntax for the manifest file is found in &amp;#x201C;OSGi Specifications&amp;#x201D;. The Eclipse-specific headers are described in &amp;#x201C;OSGi Bundle Manifest Headers&amp;#x201D;.\n
  • #10: The plugin.xml file is a regular XML file. The schema for the XML is made up of the schemas for all possible extension points. The syntax is checked in the plugin.xml editor, but not when the plug-in is resolved.\nBefore Eclipse 3.0, the plugin.xml file also included the information that is now put in the MANIFEST.MF.\nThe plugin.xml file shown above defines a new global menu with an action (3.2 edition).\n
  • #11: \n
  • #12: The&amp;#xA0; PDE has a number of multi-page editors, including the plug-in manifest editor,&amp;#xA0;that share the same basic behavior.&amp;#xA0;The editor has one or more source pages that show the raw file content and one or more form pages that present the same information in a more structured format.&amp;#xA0;\nThe plug-in manifest editor partitions the form information into several pages for less clutter. The best way to learn about the plug-in manifest editor is to visit each page.\n
  • #13: The Dependencies page shows the dependencies that your plug-in has on other plug-ins.&amp;#xA0; The plug-ins your plug-in currently depends on are shown in the list. You can modify the list by adding more plug-ins (button Add...) or removing them from the list. Changes in this list will prompt PDE to update the plug-in manifest and also configure the build path of the project so that the classes of the imported plug-in are visible to the plug-in under development.\nOnce you add the plug-in reference to the list, you can browse it by selecting Open from the pop-up menu or double-clicking on the entry.\nUse the &amp;#x201C;Automated Management of Dependencies&amp;#x201D; sub-page to add all the possible plug-in dependencies to your project:\nContent assist will include all Java classes from these classes as well as all classes from required plug-ins\nThe required plug-ins will automatically be updated\n
  • #14: The Runtime page describes which Java packages of the plug-in may be exported to other dependent plug-ins. Only the listed packages can be used by other plug-ins.\nThere is a special case: it is possible to make certain packages visible only to a limited set of other plug-ins (&amp;#x201C;Package Visibility&amp;#x201D;). This feature can be used between very closely coupled plug-ins to allow a greater visibility than normally. One such case is for test suites, where the test code is kept in a separate plug-in &amp;#x2013; to avoid getting it into the production system &amp;#x2013; but it often needs a more enhanced interface in order to test many features. Note though that fragments are a better solution in this case.\n
  • #15: The Extensions page is used to browse and edit plug-in extensions. Extensions are the central mechanism for contributing behavior to the platform. Unless your plug-in is a simple Java API library made available to other plug-ins, new behavior is contributed as an extension.\n
  • #16: The Extension points page is used to browse and edit extension points defined by the plug-in. Our plug-in&apos;s extension points can be used by the plug-in itself or another plug-in.\nPlease note that the name of the extension point is localized &amp;#x2013; the text is found in plugin.properties with the key ExtPoint.acceleratorConfigurations.\nThe XML file that describes the complete extension point is found as the file schema/acceleratorConfigurations.exsd. More about this in the module &amp;#x201C;L0015 - Making Extension Points&amp;#x201D;.\nTo see more about the different plug-ins that make up the Eclipse IDE, browse the &amp;#x201C;Plug-ins&amp;#x201D; view of the PDE perspective.\n
  • #17: The Build page shows information about the generated runtime libraries. When packaged, platform plug-ins deliver all of their Java classes in JAR libraries. This page defines how the classes that are in source folders during the design time are packaged into the libraries. One source folder and one library have already been set during the project creation by the wizard. You can define more on this page.\nAlthough a plug-in can be divided into multiple .jar files, this should normally be avoided as it means the plug-in must be distributed as a directory instead of a .jar file.\nThe source build side of the tab is only relevant if you wish to distribute source plug-ins either to the public (not so likely) or to other parts of your company that might build on top of your work.\n
  • #18: When an IDE or RCP application or product is started under PDE &amp;#x2013; sometimes called self-hosted &amp;#x2013; the new process is given a bundle path that includes all development plug-ins as well as the target system plug-ins. Check the osgi.bundles setting in {your-workspace}/.metadata/.plugins/org.eclipse.pde.core/{launch-name}/config.ini.\n
  • #19: \n