Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.

Similar presentations


Presentation on theme: "Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins."— Presentation transcript:

1 Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins

2 7-2 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Eclipse plug-in architecture  Some of this material was taken from a plug-in course developed by the ECESIS project.  You can find the complete source of the slides, lab exercises and solutions at eclipse.org/ecesis.  The materials are covered by the Common Public License.

3 7-3 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Eclipse plug-in architecture  Flexible, structured around extension points and plug-ins  This architecture allows for:  Other tools to be used within the platform  Other tools to be further extended  Integration between tools and the platform  No need to wait for new product releases

4 7-4 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Eclipse plug-in architecture Eclipse Platform Platform Runtime … Tool (plug-in) Tool (plug-in) Tool (plug-in) Workbench Workspace Help Team JFace SWT Plug-in Developer Environment (PDE) Java Development Tooling (JDT) Eclipse SDK

5 7-5 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Platform runtime  In the Eclipse, everything is plug-in except the Platform Runtime (the kernel)  All other subsystems build up on the Platform Runtime following the rules of plug-ins  The Basic platform includes:  Resources Management  Workbench  Team  Debug  Help

6 7-6 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Extension points  Describe additional functionality that could be integrated with the platform  External tools extend the platform to bring specific functionality  Java Development Tooling (JDT) and Plug-in Development Environment (PDE) are external tools integrated with the platform

7 7-7 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Extension points  There are two levels of extending Eclipse:  Extending core platform  Extending existing extensions  Extension points may have a corresponding API interface  Describes what should be provided in the extension

8 7-8 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Plug-ins  Define extension points  Each plug-in defines its own set of extension points  Implement specialized functionality  Usually key functionality that does not already exist in the platform  Provide their own set of APIs  Used for further extension of their functionalities  Are external, but fully integrated

9 7-9 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Plug-ins  Implement behavior defined through extension point API interface  Can extend named extension points from Eclipse or extension points of other plug-ins  Can declare an extension point and provide an extension to it  Are developed in Java programming language

10 7-10 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works What's in a plug-in?  A JAR file  An archive with the plug-in code  plugin.xml  Manifest that describes plug-in  about.html  Textual description of the plug-in  plugin.properties  Plugin-in properties

11 7-11 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Describing plug-ins  An extension to the platform has to be registered somewhere  Each plug-in has a manifest file that describes:  Location of the plug-in code  Extensions added by the plug-in

12 7-12 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Describing plug-ins  The manifest file is plugin.xml.  There are Eclipse tools that make it easy to edit the file without using XML directly.  The manifest describes:  Name, id, and version of the plug-in  List of other plug-ins (and versions) required by the plug-in described  Extension points  Where the plug-in code is located

13 7-13 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Example manifest file <plugin name="Helloworld plug-in" id="com.examples.helloworld" version="1.0.0 “ provider-name="EXAMPLE" class="com.example.helloworld.HelloworldPlugin"> > <view name="Hello View" icon="icons/sample.gif" category="com.example.helloworld" class="com.example.helloworld.HelloWorldView" id="com.example.helloworld.HelloWorldView">

14 7-14 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Plug-in development tools  In Eclipse Version 3.1, the plug-in development tools were greatly enhanced. This is the visual editor for plugin.xml.

15 7-15 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Packaging plug-ins  Plug-ins are packaged as Java Archives – JAR files  Archives are named using naming convention: _.jar  is the identifier  is the full version number from the manifest file  For example: org.eclipse.demo. plugin.simple_1.0.jar

16 7-16 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Publishing plug-ins  Used for preparing plug-in for deployment on a specific platform  Manual publishing makes use of Ant scripts  Ant is a open source build tool, commonly used in building processes with Java code  Ant scripts are Java based (platform independent) with XML configuration  Ant is supported in Eclipse

17 7-17 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Publishing plug-ins  Automatic publishing is available by using Eclipse wizards  You don't have to use Ant scripts  Wizards allow publishing in a single zip file. A single zip file can contain multiple plug-ins.

18 7-18 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Installing plug-ins  Plug-ins are installed under the plugins directory under the Eclipse installation directory  Usually c:\eclipse\plugins on Windows platforms

19 7-19 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Plug-in fragments  Used for extending existing plug-ins  Provide an additional functionality to existing plug-ins  Ideal for providing add-on functionality to plug-ins  Packaged in separate files  Fragment content is treated as it was original plug-in archive  At runtime the platform detects fragments and merges their content with the original plug-in

20 7-20 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Plug-in fragments  Described in fragment.xml files  Similar to plug-in manifest files  Plug-in archive can contain plug-ins or fragments

21 7-21 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Eclipse API  Meant to be used by plug-in developers  API elements are documented and completely specified  The API elements specify what they are supposed to do and how they are intended to be used.

22 7-22 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Eclipse API  The Eclipse platform code is separated into:  API packages  Contain API elements  Non-API packages  Contain internal platform implementation

23 7-23 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using the Eclipse API  The API can be used by doing one of the following:  Instantiating platform API classes  Subclassing platform API classes  Calling public API methods  Most commonly used  Calling protected API methods  Possible from API subclasses

24 7-24 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Using the Eclipse API  More ways to use the API:  Overriding API methods  Allowed for some methods  Implementing platform API interfaces  Accessing Fields in API classes and interfaces  Mainly final, read-only fields

25 7-25 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works  An Eclipse feature is a collection of plug-ins. It is the smallest thing you can download and install separately.  These were components before Eclipse 2.0. Features plug-in3plug-in4 plug-in1plug-in2 feature

26 7-26 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Update Manager  Can be used to discover, download and install features and plug-ins  Supported by modular nature of Eclipse  Makes it easy to install additional features and plug-ins, and to update existing ones  Installing or updating features and plug-ins requires adding files to Eclipse  Deleting files is never required as different versions of plug-ins and features can co-exist in Eclipse.

27 7-27 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Tools integration framework  Eclipse is the framework for integrating different tools  Vendors provide the tools  Eclipse provides the integration  Eclipse provides multiple levels for integration  Tool vendor must follow the rules for allow integration at the certain level  From users point of view it is all one tool  Eclipse provides seamless integration, users don’t know when they’re using different tools

28 7-28 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Invocation integration  Launches tools in external process  Used for integration of existing tools that are platform dependent  Tools can use Eclipse facilities such as resource management and project model  Tools cannot run within the Workbench and use other tools within Eclipse  Tools run in separate windows  Eclipse could be used by developers as a central point for navigating and manipulating resources

29 7-29 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Data integration  Allows tools to share the data  It is supported through:  Access method, specifies how application can access data from other applications  Interchange protocol, specifies the form of data  Data transformation, used for transforming data in more appropriate format  Tool data should be stored in a standard format to support data integration  XML for example  It is up to tool vendor to provide the format

30 7-30 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works API integration  Allows data access through tool specific API  Isolates data from direct access such as in data integration  Tool vendor specifies Java client API for accessing data  Non Java tools must also have Java API, which is possible to do through Java Native Interface (JNI)

31 7-31 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works API integration  Promotes behavioral reuse by reusing client API  Data integration promotes reuse of data state

32 7-32 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works UI integration  Allows tools to integrate at the UI level  It looks like the tools are all part of the same application  It is supported by a tool specifying with which tools to integrate at the run time

33 7-33 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works UI integration  The UI for the tool must be implemented using Eclipse UI framework  Integration with Workbench is done through extension points

34 7-34 Making the most of © 2006 IBM Corporation. Presented by IBM developer Works Other integrations  Event listening, by registering interest in other tools events  Selection management:  Tool provides selection provider  Tool listens for selection events  The Workbench notifies listeners of any change in the selection  Tool can modify its UI based on the notification received


Download ppt "Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins."

Similar presentations


Ads by Google