Jump to: navigation, search

Difference between revisions of "Rich Client Platform/FAQ"

(How can I define key bindings for commands?)
(switch broken link to the eclipsercp.org site to working archive.org copy)
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{RCP}}
+
{{RCP}} Eclipse Rich Client Platform FAQ  
Eclipse Rich Client Platform FAQ
+
  
The following are '''Frequently Asked Questions''' ('''FAQs''') about the Eclipse Rich Client Platform.
+
The following are '''Frequently Asked Questions''' ('''FAQs''') about the Eclipse Rich Client Platform. For relevant tutorials, help topics, newsgroups, examples, and other resources, see the main [[Rich Client Platform|RCP page]].  
For relevant tutorials, help topics, newsgroups, examples, and other resources, see the main [[Rich Client Platform|RCP page]].
+
  
For general Eclipse FAQs, which address many RCP issues, see [[The Official Eclipse FAQs]].
+
For general Eclipse FAQs, which address many RCP issues, see [[The Official Eclipse FAQs]].
 +
For Eclipse 4, see the [[Eclipse4/RCP/FAQ|Eclipse 4 RCP FAQ]].
  
==What is the Eclipse Rich Client Platform?==
+
== What is the Eclipse Rich Client Platform? ==
:While the Eclipse platform is designed to serve as an open tools platform, it is architected so that its components could be used to build just about any client application. The minimal set of plug-ins needed to build a rich client application is collectively known as the '''Rich Client Platform'''.
+
 
:For more details, see the main [[Rich Client Platform|RCP page]].
+
:While the Eclipse platform is designed to serve as an open tools platform, it is architected so that its components could be used to build just about any client application. The minimal set of plug-ins needed to build a rich client application is collectively known as the '''Rich Client Platform'''.  
 +
:For more details, see the main [[Rich Client Platform|RCP page]].  
 
:Also note that Part 1 of the original [http://eclipse.org/whitepapers/eclipse-overview.pdf Eclipse whitepaper] also applies, and is a good high-level overview of what is available in the Rich Client Platform. Although it speaks of the Eclipse IDE (which is itself an RCP application), almost all of the functionality described in Part 1 is available in the RCP. Exceptions are the Workspace model and Team support, which are components in the IDE, not the RCP. Part 2's discussion of JDT is specific to the Eclipse IDE, however it is a good illustration of how an application would be structured on top of the RCP.
 
:Also note that Part 1 of the original [http://eclipse.org/whitepapers/eclipse-overview.pdf Eclipse whitepaper] also applies, and is a good high-level overview of what is available in the Rich Client Platform. Although it speaks of the Eclipse IDE (which is itself an RCP application), almost all of the functionality described in Part 1 is available in the RCP. Exceptions are the Workspace model and Team support, which are components in the IDE, not the RCP. Part 2's discussion of JDT is specific to the Eclipse IDE, however it is a good illustration of how an application would be structured on top of the RCP.
  
==Why should I build my application on the Eclipse Rich Client Platform?==
+
== Why should I build my application on the Eclipse Rich Client Platform? ==
:Many people that have built, or are building, RCP applications state that the main value they get from using RCP is that it allows them to quickly build a professional-looking application, with native look-and-feel, on multiple platforms, allowing them to focus on their value-add.  They appreciate that the components that form RCP are of high quality, are actively maintained, and are open source.  They often discover after the initial adoption of RCP that there are many other Eclipse components available for reuse (e.g. Help UI, Update Manager, Cheat Sheets, Intro, etc.).  Several have also discovered that the inherent extensibility of Eclipse allows them to build not only a closed-form product, but also an open-ended platform (like the Eclipse IDE) in their own domain.
+
  
:For a nice description of the benefits of RCP, see [http://eclipsercp.org/book/chapters/RCP_Foreward2.pdf Jeff Norris' forward on NASA/JPL's use of RCP], a free excerpt from the [[RCP Book]].
+
:Many people that have built, or are building, RCP applications state that the main value they get from using RCP is that it allows them to quickly build a professional-looking application, with native look-and-feel, on multiple platforms, allowing them to focus on their value-add. They appreciate that the components that form RCP are of high quality, are actively maintained, and are open source. They often discover after the initial adoption of RCP that there are many other Eclipse components available for reuse (e.g. Help UI, Update Manager, Cheat Sheets, Intro, etc.). Several have also discovered that the inherent extensibility of Eclipse allows them to build not only a closed-form product, but also an open-ended platform (like the Eclipse IDE) in their own domain.
 +
 
 +
:For a nice description of the benefits of RCP, see [http://web.archive.org/web/20100307050224/eclipsercp.org/book/chapters/RCP_Foreward2.pdf Jeff Norris' forward on NASA/JPL's use of RCP] (archived link), a free excerpt from the [[RCP Book]].
  
 
:See also the case studies available on the [http://www.eclipse.org/community/rcp.php RCP Community page].
 
:See also the case studies available on the [http://www.eclipse.org/community/rcp.php RCP Community page].
  
==What is included in the Rich Client Platform?==
+
== What is included in the Rich Client Platform? ==
 +
 
 
:The Eclipse Rich Client Platform consists of the following components:
 
:The Eclipse Rich Client Platform consists of the following components:
<table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2">
 
<tr><th>Component<br>
 
      </th>
 
      <th>Description<br>
 
      </th>
 
      <th>Plug-ins<br>
 
      </th>
 
      <th>Documentation<br>
 
      </th>
 
    </tr>
 
    <tr>
 
      <td>Eclipse Runtime<br>
 
      </td>
 
      <td>Provides the foundational support for plug-ins, extension points and extensions (among other facilities).&nbsp; The Eclipse runtime is built on top of the [http://osgi.org/osgi_technology OSGi framework].
 
      </td>
 
      <td>org.eclipse.core.runtime<br>
 
org.eclipse.osgi<br>
 
org.eclipse.osgi.services</td>
 
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/main.html Platform Core home page]<br>
 
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/runtime.htm Runtime overview]<br>
 
Article: [http://eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html Notes on the Eclipse Plug-in Architecture]<br>
 
      </td>
 
    </tr>
 
    <tr>
 
      <td>SWT<br>
 
      </td>
 
      <td>The Standard Widget Toolkit. SWT is designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented
 
      </td>
 
      <td>org.eclipse.swt<br>
 
+ platform-specific fragments<br>
 
      </td>
 
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/main.html Platform SWT home page]<br>
 
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/swt.htm SWT]<br>
 
[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/SWT_Resources.html Getting Started]<br>
 
[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/faq.html SWT FAQ]<br>
 
[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets SWT code snippets]<br>
 
[http://eclipse.org/articles/main.html#SWT SWT Articles]
 
      </td>
 
    </tr>
 
    <tr>
 
      <td>JFace<br>
 
      </td>
 
      <td>A UI framework, layered on top of SWT, for handling many common UI programming tasks.
 
      </td>
 
      <td>org.eclipse.jface
 
      </td>
 
      <td>[[JFace]]
 
      </td>
 
    </tr>
 
    <tr>
 
      <td>Workbench</td>
 
      <td>The Workbench builds on top of the Runtime, SWT and JFace to provide a highly scalable, open-ended, multi-window environment for managing views, editors, perspectives (task-oriented layouts), actions, wizards, preference pages, and more. <br>
 
The Workbench is sometimes called the Generic Workbench, to distinguish it from the IDE Workbench facilities defined in the org.eclipse.ui.ide plug-in.
 
      </td>
 
      <td>org.eclipse.ui<br>
 
org.eclipse.ui.workbench
 
      </td>
 
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/main.html Platform UI home page]<br>
 
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench.htm Plugging into the workbench],[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/dialogs.htm  Dialogs and wizards], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/wrkAdv.htm Advanced workbench concepts]<br>
 
[http://eclipse.org/articles/main.html#ui Workbench and JFace Articles]<br>
 
  
      </td>
+
{| style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"
    </tr>
+
|-
    <tr>
+
! Component<br>  
      <td>
+
! Description<br>  
Other prerequisites for the Workbench
+
! Plug-ins<br>  
      </td>
+
! Documentation<br>  
      <td>Support for XML expressions language, commands, and help core content model.<br>
+
|-
      </td>
+
| Eclipse Runtime<br>  
      <td>org.eclipse.core.expressions<br>
+
| Provides the foundational support for plug-ins, extension points and extensions (among other facilities).&nbsp; The Eclipse runtime is built on top of the [http://osgi.org/osgi_technology OSGi framework].
org.eclipse.core.commands<br>
+
| org.eclipse.core.runtime<br>  
org.eclipse.help
+
org.eclipse.osgi<br>  
      </td>
+
org.eclipse.osgi.services
      <td><br>
+
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/main.html Platform Core home page]<br>  
      </td>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/runtime.htm Runtime overview]<br> Article: [http://eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html Notes on the Eclipse Plug-in Architecture]<br>  
    </tr>
+
    </table>
+
  
Note that as of Eclipse 3.3M6, org.eclipse.help requires [[#What_is_ICU4J_and_is_it_required.3F|com.ibm.icu]] which takes a sizeable amount of footprint (that [[#What_is_ICU4J_and_is_it_required.3F|can be reduced]]). [https://bugs.eclipse.org/bugs/show_bug.cgi?id=183761 Bug 183761] has been filed to investigate removing this dependency from org.eclipse.help.
+
|-
 +
| SWT<br>
 +
| The Standard Widget Toolkit. SWT is designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented
 +
| org.eclipse.swt<br>
 +
+ platform-specific fragments<br>
  
==What is the disk footprint for the Rich Client Platform?==
+
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/main.html Platform SWT home page]<br>
:As of Eclipse 3.1.1, the combined disk footprint for the Rich Client Platform, including the above plug-ins, startup.jar and the eclipse.exe executable, is about 6.6 Meg.
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/swt.htm SWT]<br> [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/SWT_Resources.html Getting Started]<br> [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/faq.html SWT FAQ]<br> [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets SWT code snippets]<br> [http://eclipse.org/articles/main.html#SWT SWT Articles]
  
:As of Eclipse 3.3M6, the disk footprint is about 12 Meg - with the bulk taken by SWT (2 MB), ui.workbench (4 MB) and ICU4J (4 MB). The ICU4J dependency can be [[#What_is_ICU4J_and_is_it_required.3F|reduced to about 100 K]].
+
|-
 +
| JFace<br>
 +
| A UI framework, layered on top of SWT, for handling many common UI programming tasks.
 +
| org.eclipse.jface
 +
| [[JFace]]
 +
|-
 +
| Workbench
 +
| The Workbench builds on top of the Runtime, SWT and JFace to provide a highly scalable, open-ended, multi-window environment for managing views, editors, perspectives (task-oriented layouts), actions, wizards, preference pages, and more. <br>
 +
The Workbench is sometimes called the Generic Workbench, to distinguish it from the IDE Workbench facilities defined in the org.eclipse.ui.ide plug-in.
 +
 
 +
| org.eclipse.ui<br>
 +
org.eclipse.ui.workbench  
 +
 
 +
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/main.html Platform UI home page]<br>
 +
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench.htm Plugging into the workbench],[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/dialogs.htm Dialogs and wizards], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/wrkAdv.htm Advanced workbench concepts]<br> [http://eclipse.org/articles/main.html#ui Workbench and JFace Articles]<br>
 +
 
 +
|-
 +
|
 +
Other prerequisites for the Workbench
 +
 
 +
| Support for XML expressions language, commands, and help core content model.<br>
 +
| org.eclipse.core.expressions<br>
 +
org.eclipse.core.commands<br> org.eclipse.help
 +
 
 +
| <br>
 +
|}
 +
 
 +
Note that as of Eclipse 3.3M6, org.eclipse.help requires [[#What_is_ICU4J_and_is_it_required.3F|com.ibm.icu]] which takes a sizeable amount of footprint (that [[#What_is_ICU4J_and_is_it_required.3F|can be reduced]]). [https://bugs.eclipse.org/bugs/show_bug.cgi?id=183761 Bug 183761] has been filed to investigate removing this dependency from org.eclipse.help.
 +
 
 +
== What is the disk footprint for the Rich Client Platform? ==
 +
 
 +
:As of Eclipse 3.7, the disk footprint is about 20 Meg.
  
 
:If footprint is most important, using [http://www.eclipse.org/ercp/ eRCP] might be an option. This is a stripped-down version (eSWT, eJface, eWorkbench) originally designed for embedded devices, but also running on Windows desktop. Its footprint is just under 4 MB and it runs on low-profile JVMs.
 
:If footprint is most important, using [http://www.eclipse.org/ercp/ eRCP] might be an option. This is a stripped-down version (eSWT, eJface, eWorkbench) originally designed for embedded devices, but also running on Windows desktop. Its footprint is just under 4 MB and it runs on low-profile JVMs.
  
==Is the resources plug-in (org.eclipse.core.resources) considered part of the Rich Client Platform?==
+
== Is the resources plug-in (org.eclipse.core.resources) considered part of the Rich Client Platform? ==
 +
 
 
:No. The workspace resource model provided by the org.eclipse.core.resources plug-in is not considered part of the Rich Client Platform. While this is the underlying data model for the Eclipse IDE, the RCP makes no assumptions about the underlying data model of the application being built. The data model could just as well be files in the local filesystem, a remote database, an RDF data store, or anything else. If it makes sense for the application, '''org.eclipse.core.resources''' can be included and used as the application's data model, but this is not required. Much effort was put into Eclipse 3.0 to remove the dependencies on '''org.eclipse.core.resources''' from the generic workbench. Any resource dependencies (for example, the New Project, Folder and File wizards, and the Resource Navigator, Tasks and Problems views), were considered IDE-specific and factored out into the IDE plugin ('''org.eclipse.ui.ide''').
 
:No. The workspace resource model provided by the org.eclipse.core.resources plug-in is not considered part of the Rich Client Platform. While this is the underlying data model for the Eclipse IDE, the RCP makes no assumptions about the underlying data model of the application being built. The data model could just as well be files in the local filesystem, a remote database, an RDF data store, or anything else. If it makes sense for the application, '''org.eclipse.core.resources''' can be included and used as the application's data model, but this is not required. Much effort was put into Eclipse 3.0 to remove the dependencies on '''org.eclipse.core.resources''' from the generic workbench. Any resource dependencies (for example, the New Project, Folder and File wizards, and the Resource Navigator, Tasks and Problems views), were considered IDE-specific and factored out into the IDE plugin ('''org.eclipse.ui.ide''').
 
 
  
==Is the IDE plug-in (org.eclipse.ui.ide) considered part of the Rich Client Platform?==
+
<br>
:No.  The '''org.eclipse.ui.ide''' plug-in is layered on top of the generic workbench ('''org.eclipse.ui''') and adds IDE-specific views, preference pages and other extensions. The IDE uses the workspace resource model as its underlying data model. :The org.eclipse.ui.ide plug-in, and the extensions defined within it, are not part of the Rich Client Platform, but they can be used in a resource- (and workspace-)based RCP application.
+
  
Prior to Eclipse 3.3, the '''org.eclipse.ui.ide''' was not designed to be reused in other RCP applications because it also defined the application for the Eclipse IDE, which instantiates the generic workbench, configuring it with IDE-specific menu and toolbar items. As of Eclipse 3.3, the application definition has been moved to a new plug-in '''org.eclipse.ui.ide.application'''.
+
== Is the IDE plug-in (org.eclipse.ui.ide) considered part of the Rich Client Platform? ==
 +
 
 +
:No. The '''org.eclipse.ui.ide''' plug-in is layered on top of the generic workbench ('''org.eclipse.ui''') and adds IDE-specific views, preference pages and other extensions. The IDE uses the workspace resource model as its underlying data model.&nbsp;:The org.eclipse.ui.ide plug-in, and the extensions defined within it, are not part of the Rich Client Platform, but they can be used in a resource- (and workspace-)based RCP application.
 +
 
 +
Prior to Eclipse 3.3, the '''org.eclipse.ui.ide''' was not designed to be reused in other RCP applications because it also defined the application for the Eclipse IDE, which instantiates the generic workbench, configuring it with IDE-specific menu and toolbar items. As of Eclipse 3.3, the application definition has been moved to a new plug-in '''org.eclipse.ui.ide.application'''.  
 +
 
 +
== What other Eclipse components can be used in constructing RCP applications? ==
  
==What other Eclipse components can be used in constructing RCP applications?==
 
 
:Here is a list of some of the reusable components in the broader Eclipse codebase that can be incorporated into RCP applications.
 
:Here is a list of some of the reusable components in the broader Eclipse codebase that can be incorporated into RCP applications.
  
<table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2">
+
{| style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2"
    <tr>
+
|-
      <th>Component<br>
+
! Component<br>  
      </th>
+
! Description<br>  
      <th>Description<br>
+
! Plug-ins<br>  
      </th>
+
! Documentation<br>  
      <th>Plug-ins<br>
+
|-
      </th>
+
| Help<br>  
      <th>Documentation<br>
+
| Web-app-based Help UI, with support for dynamic content.<br>  
      </th>
+
| org.apache.lucene<br>  
    </tr>
+
org.eclipse.help.appserver<br> org.eclipse.help.base<br> org.eclipse.help.ui<br> org.eclipse.help.webapp<br> org.eclipse.tomcat<br>  
    <tr>
+
org.eclipse.ui.forms
      <td>Help<br>
+
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-help-home/main.html Platform Help home page]<br>  
      </td>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/help.htm Plugging in help]<br>  
      <td>Web-app-based Help UI, with support for dynamic content.<br>
+
      </td>
+
      <td>org.apache.lucene<br>
+
org.eclipse.help.appserver<br>
+
org.eclipse.help.base<br>
+
org.eclipse.help.ui<br>
+
org.eclipse.help.webapp<br>
+
org.eclipse.tomcat<br>
+
org.eclipse.ui.forms</td>
+
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-help-home/main.html Platform Help home page]<br>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/help.htm Plugging in help]<br>
+
      </td>
+
    </tr>
+
    <tr>
+
      <td>Update Manager<br>
+
      </td>
+
      <td>Allows users to discover and
+
install updated versions of products and extensions.</td>
+
      <td>org.eclipse.update.configurator<br>
+
org.eclipse.update.core<br>
+
org.eclipse.update.scheduler<br>
+
org.eclipse.update.ui<br>
+
+ platform-specific fragments<br>
+
      </td>
+
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-update-home/main.html Platform Update home page]<br>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_update.htm Updating a product or extension]<br>
+
      </td>
+
    </tr>
+
    <tr>
+
      <td>Text<br>
+
      </td>
+
      <td>Framework for building high-function text editors.<br>
+
      </td>
+
      <td>org.eclipse.text<br>
+
org.eclipse.jface.text<br>
+
org.eclipse.workbench.texteditor</td>
+
      <td>[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/main.html Platform Text home page]<br>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/editors_jface.htm Text editors and platform text]<br>
+
      </td>
+
    </tr>
+
    <tr>
+
      <td>Forms<br>
+
      </td>
+
      <td>Flat look control library and multi-page editor framework (used in PDE editors).<br>
+
      </td>
+
      <td>org.eclipse.ui.forms</td>
+
      <td>Article: [http://www.eclipse.org/articles/Article-Forms/article.html Eclipse Forms: Rich UI for the Rich Client]</td>
+
    </tr>
+
    <tr>
+
      <td>Welcome Page (aka Intro)</td>
+
      <td>Initial welcome experience and guided assistance.<br>
+
      </td>
+
      <td>org.eclipse.ui.intro<br>
+
      </td>
+
      <td>Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench_advext_intro.htm Intro support]</td>
+
    </tr>
+
    <tr>
+
      <td>Cheat Sheets<br>
+
      </td>
+
      <td>A Cheat Sheet guides the user through a long-running, multi-step task.<br>
+
      </td>
+
      <td>org.eclipse.ui.cheatsheets<br>
+
      </td>
+
      <td>Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench_advext_cheatsheets.htm Cheat Sheets]</td>
+
    </tr>
+
    <tr>
+
      <td>Resources<br>
+
      </td>
+
      <td>Workspace resource model, with managed projects, folders and files.<br>
+
      </td>
+
      <td>org.eclipse.core.resources<br>
+
      </td>
+
      <td>[http://www.eclipse.org/eclipse/platform-core/ Platform Core home page]<br>
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/resInt.htm Resources overview]</td>
+
    </tr>
+
    <tr>
+
      <td>Console</td>
+
      <td>Extensible console view.<br>
+
      </td>
+
      <td>org.eclipse.ui.console<br>
+
      </td>
+
      <td>Javadoc: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/console/package-summary.html org.eclipse.ui.console], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/console/actions/package-summary.html org.eclipse.ui.console.actions]</td>
+
    </tr>
+
    <tr>
+
      <td>Outline and Properties views</td>
+
      <td>Outline and Properties views<br>
+
      </td>
+
      <td>org.eclipse.ui.views<br>
+
      </td>
+
      <td>TBD</td>
+
    </tr>
+
    <tr>
+
      <td>Graphical Editing Framework (GEF)</td>
+
      <td>Framework for building graphical editors. Includes Draw2D, a vector graphics framework.<br>
+
      </td>
+
      <td>org.eclipse.draw2d<br>
+
org.eclipse.gef<br>
+
      </td>
+
      <td>[http://www.eclipse.org/gef GEF home page]<br>
+
[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/gef-home/overview.html?cvsroot=Tools_Project Overview], [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/gef-home/developer/faq.html?cvsroot=Tools_Project FAQ]<br>
+
      </td>
+
    </tr>
+
    <tr>
+
      <td>Eclipse Modeling Framework (EMF) and Service Data Objects (SDO)</td>
+
      <td>EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model.&nbsp;
+
SDO is a framework that simplifies and unifies data application development in a service oriented architecture (SOA).</td>
+
      <td>[http://dev.eclipse.org/viewcvs/indextools.cgi/org.eclipse.emf/plugins/ EMF plug-in list from CVS]<br>
+
      </td>
+
      <td>[http://www.eclipse.org/emf/ EMF home page]<br>
+
Overviews:[http://www.eclipse.org/modeling/emf/docs/#overviews EMF, EMF Edit, EMF Validation ...], [http://www-106.ibm.com/developerworks/java/library/j-sdo/ SDO]</td>
+
    </tr>
+
</table>
+
  
==How do I get started with RCP?==
+
|-
:The [[Rich Client Platform#Tutorials|Eclipse RCP tutorials]] are a good starting points.  See also the [[Rich Client Platform#examples|examples]] and the [[Rich Client Platform#help|suggested help topics]].
+
| Update Manager<br>
 +
| Allows users to discover and install updated versions of products and extensions.
 +
| org.eclipse.update.configurator<br>
 +
org.eclipse.update.core<br> org.eclipse.update.scheduler<br> org.eclipse.update.ui<br> + platform-specific fragments<br>
  
==What is the recommended target platform setup?  Or: How can I build and run my RCP app against a different version of the Eclipse base?==
+
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-update-home/main.html Platform Update home page]<br>
:With the default setup of the Eclipse SDK, plug-ins are developed against the same plug-in configuration used by the IDE itself.  However, it is possible to configure the IDE to build, run and deploy against a different version of the eclipse base, via the Plug-in Development > Target Platform preference page.  Configuring the target platform is highly recommended in order to avoid introducing unwanted dependencies on IDE plug-ins into your RCP app.
+
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_update.htm Updating a product or extension]<br>  
:For more details, see the [http://help.eclipse.org/ganymede/topic/org.eclipse.pde.doc.user/guide/tools/preference_pages/target_platform.htm "Target Platform Preferences"] help topic in the PDE Guide.  The tutorial in the [[RCP Book]] also walks you through this process.
+
:For a recommended setup, use the following steps.  We assume the Eclipse SDK (aka the IDE) is already installed, e.g. in c:\eclipse.
+
:# Go to the [http://download.eclipse.org/eclipse/downloads/ Platform downloads page].
+
:# Pick the build you want to use as your RCP target (e.g. the 3.2 M6 milestone build).
+
:# In the RCP SDK section (not the Eclipse SDK, Platform SDK, or RCP Binary sections) download the RCP SDK for your platform. This contains just the base RCP plug-ins for that platform.
+
:# Extract it to a different directory than the IDE's (e.g. c:\eclipse-RCP-SDK).
+
:# Optionally, if you want to deploy to other platforms, download the Delta Pack (the link is at the bottom of the RCP SDK section).  This contains the platform-specific plug-ins for all platforms. Extract it to the same location as the RCP SDK (say OK to any prompts to overwrite files).
+
:# Run the IDE (e.g. c:\eclipse\eclipse.exe).
+
:# Go to Window > Preferences > Plugin-Development > Target Platform, and configure the location to be the eclipse subdirectory of the RCP SDK install (e.g. c:\eclipse-RCP-SDK\eclipse).  Note: if you type or paste the path, you'll need to press the Reload button.
+
:# The list of plug-ins on the Plug-ins tab should update to show the RCP SDK plug-ins; other plug-ins like those for JDT and PDE should not appear.
+
:Now, any plug-in projects in your workspace will build and run against the RCP SDK plug-ins rather than the IDE's.
+
:If you are developing against the same version as the Eclipse SDK, there is new support in since 3.2 M5 that simplifies setting up the Target Platform for RCP development, and makes it easier to incrementally include other plug-ins from the SDK build.
+
:# Go to Window > Preferences > Plugin-Development > Target Platform.
+
:# In the "Pre-defined Targets" section at the bottom, choose one of the "Base RCP" entries, e.g. "Base RCP (with Source)" and press the "Load Target" button.
+
:# The list of plug-ins on the Plug-ins tab still shows all SDK plug-ins, but only the RCP base plug-ins are checked; other plug-ins like those for JDT and PDE should not be checked.  Only checked plug-ins constitute your target.  Unchecked plug-ins are ignored.
+
:PDE currently supports two versions back for plug-in development.  That is, with Eclipse 3.2 you can develop 3.0 plugins and launch 3.0 systems, but not 2.1 or earlier.
+
  
==Will an RCP application inherit the Eclipse IDE look?==
+
|-
:By default, RCP apps use the same presentation as the IDE, but with different defaults (e.g. tabs are square rather than curvy). However, other presentation implementations are available. For example, the R2.1 presentation available in the IDE can also be used by RCP apps; it is provided in the <code>org.eclipse.ui.presentations.r21</code> plug-in.
+
| Text<br>
:For instructions on how to deploy the R2.1 presentation, see [[RCP Custom Look and Feel]].
+
| Framework for building high-function text editors.<br>
:The default presentation of views and editors, and the overall window layout, is also configurable in several ways. See the following entries for more details.
+
| org.eclipse.text<br>
 +
org.eclipse.jface.text<br>  
 +
org.eclipse.workbench.texteditor
 +
| [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/main.html Platform Text home page]<br>
 +
Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/editors_jface.htm Text editors and platform text]<br>
  
==How can I change the window icon in my application?==
+
|-
:[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def.htm Define a product] via the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def_extpt.htm products extension point] and specify the <code>windowImages</code> property to refer to two image files, a 16x16 one and a 32x32 one.
+
| Forms<br>
:It is best to specify both, since a 16x16 icon is typically used in the window trim, and a 32x32 icon is typically used in the OS's application switcher (e.g. Alt+Tab on Windows). If only one is specified, it is scaled up or down as needed, which can result in poor quality.
+
| Flat look control library and multi-page editor framework (used in PDE editors).<br>
 +
| org.eclipse.ui.forms
 +
| Article: [http://www.eclipse.org/articles/Article-Forms/article.html Eclipse Forms: Rich UI for the Rich Client]
 +
|-
 +
| Welcome Page (aka Intro)
 +
| Initial welcome experience and guided assistance.<br>
 +
| org.eclipse.ui.intro<br>
 +
| Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench_advext_intro.htm Intro support]
 +
|-
 +
| Cheat Sheets<br>
 +
| A Cheat Sheet guides the user through a long-running, multi-step task.<br>
 +
| org.eclipse.ui.cheatsheets<br>
 +
| Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/workbench_advext_cheatsheets.htm Cheat Sheets]
 +
|-
 +
| Resources<br>
 +
| Workspace resource model, with managed projects, folders and files.<br>
 +
| org.eclipse.core.resources<br>
 +
| [http://www.eclipse.org/eclipse/platform-core/ Platform Core home page]<br> Dev guide: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/resInt.htm Resources overview]
 +
|-
 +
| Console
 +
| Extensible console view.<br>
 +
| org.eclipse.ui.console<br>
 +
| Javadoc: [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/console/package-summary.html org.eclipse.ui.console], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/console/actions/package-summary.html org.eclipse.ui.console.actions]
 +
|-
 +
| Outline and Properties views
 +
| Outline and Properties views<br>
 +
| org.eclipse.ui.views<br>
 +
| TBD
 +
|-
 +
| Graphical Editing Framework (GEF)
 +
| Framework for building graphical editors. Includes Draw2D, a vector graphics framework.<br>
 +
| org.eclipse.draw2d<br>
 +
org.eclipse.gef<br>
 +
 
 +
| [http://www.eclipse.org/gef GEF home page]<br>
 +
[http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/gef-home/overview.html?cvsroot=Tools_Project Overview], [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/gef-home/developer/faq.html?cvsroot=Tools_Project FAQ]<br>
 +
 
 +
|-
 +
| Eclipse Modeling Framework (EMF) and Service Data Objects (SDO)
 +
| EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model.&nbsp; SDO is a framework that simplifies and unifies data application development in a service oriented architecture (SOA).
 +
| [http://dev.eclipse.org/viewcvs/indextools.cgi/org.eclipse.emf/plugins/ EMF plug-in list from CVS]<br>
 +
| [http://www.eclipse.org/emf/ EMF home page]<br> Overviews:[http://www.eclipse.org/modeling/emf/docs/#overviews EMF, EMF Edit, EMF Validation ...], [http://www-106.ibm.com/developerworks/java/library/j-sdo/ SDO]
 +
|}
 +
 
 +
== How do I get started with RCP? ==
 +
 
 +
:The [[Rich Client Platform#Tutorials|Eclipse RCP tutorials]] are a good starting points. See also the [[Rich Client Platform#examples|examples]] and the [[Rich Client Platform#help|suggested help topics]].
 +
 
 +
== What is the recommended target platform setup? Or: How can I build and run my RCP app against a different version of the Eclipse base? ==
 +
 
 +
:With the default setup of the Eclipse SDK, plug-ins are developed against the same plug-in configuration used by the IDE itself. However, it is possible to configure the IDE to build, run and deploy against a different version of the eclipse base, via the Plug-in Development &gt; Target Platform preference page. Configuring the target platform is highly recommended in order to avoid introducing unwanted dependencies on IDE plug-ins into your RCP app.
 +
:For more details, see the [http://help.eclipse.org/ganymede/topic/org.eclipse.pde.doc.user/guide/tools/preference_pages/target_platform.htm "Target Platform Preferences"] help topic in the PDE Guide. The tutorial in the [[RCP Book]] also walks you through this process.
 +
:For a recommended setup, use the following steps. We assume the Eclipse SDK (aka the IDE) is already installed, e.g. in c:\eclipse.
 +
:#Go to the [http://download.eclipse.org/eclipse/downloads/ Platform downloads page].
 +
:#Pick the build you want to use as your RCP target (e.g. the 3.2 M6 milestone build).
 +
:#In the RCP SDK section (not the Eclipse SDK, Platform SDK, or RCP Binary sections) download the RCP SDK for your platform. This contains just the base RCP plug-ins for that platform.
 +
:#Extract it to a different directory than the IDE's (e.g. c:\eclipse-RCP-SDK).
 +
:#Optionally, if you want to deploy to other platforms, download the Delta Pack (the link is at the bottom of the RCP SDK section). This contains the platform-specific plug-ins for all platforms. Extract it to the same location as the RCP SDK (say OK to any prompts to overwrite files).
 +
:#Run the IDE (e.g. c:\eclipse\eclipse.exe).
 +
:#Go to Window &gt; Preferences &gt; Plugin-Development &gt; Target Platform, and configure the location to be the eclipse subdirectory of the RCP SDK install (e.g. c:\eclipse-RCP-SDK\eclipse). Note: if you type or paste the path, you'll need to press the Reload button.
 +
:#The list of plug-ins on the Plug-ins tab should update to show the RCP SDK plug-ins; other plug-ins like those for JDT and PDE should not appear.
 +
:Now, any plug-in projects in your workspace will build and run against the RCP SDK plug-ins rather than the IDE's.
 +
:If you are developing against the same version as the Eclipse SDK, there is new support in since 3.2 M5 that simplifies setting up the Target Platform for RCP development, and makes it easier to incrementally include other plug-ins from the SDK build.
 +
:#Go to Window &gt; Preferences &gt; Plugin-Development &gt; Target Platform.
 +
:#In the "Pre-defined Targets" section at the bottom, choose one of the "Base RCP" entries, e.g. "Base RCP (with Source)" and press the "Load Target" button.
 +
:#The list of plug-ins on the Plug-ins tab still shows all SDK plug-ins, but only the RCP base plug-ins are checked; other plug-ins like those for JDT and PDE should not be checked. Only checked plug-ins constitute your target. Unchecked plug-ins are ignored.
 +
:PDE currently supports two versions back for plug-in development. That is, with Eclipse 3.2 you can develop 3.0 plugins and launch 3.0 systems, but not 2.1 or earlier.
 +
 
 +
== Will an RCP application inherit the Eclipse IDE look? ==
 +
 
 +
:By default, RCP apps use the same presentation as the IDE, but with different defaults (e.g. tabs are square rather than curvy). However, other presentation implementations are available. For example, the R2.1 presentation available in the IDE can also be used by RCP apps; it is provided in the <code>org.eclipse.ui.presentations.r21</code> plug-in.
 +
:For instructions on how to deploy the R2.1 presentation, see [[RCP Custom Look and Feel]].
 +
:The default presentation of views and editors, and the overall window layout, is also configurable in several ways. See the following entries for more details.
 +
 
 +
{{note | The Presentation layer has been deprecated in Eclipse 4.x in favour of the more powerful [[Eclipse4/RCP/CSS|CSS styling feature]].}}
 +
 
 +
== How can I change the window icon in my application? ==
 +
 
 +
:[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def.htm Define a product] via the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def_extpt.htm products extension point] and specify the <code>windowImages</code> property to refer to two image files, a 16x16 one and a 32x32 one.  
 +
:It is best to specify both, since a 16x16 icon is typically used in the window trim, and a 32x32 icon is typically used in the OS's application switcher (e.g. Alt+Tab on Windows). If only one is specified, it is scaled up or down as needed, which can result in poor quality.  
 
:For example, the [[RCP Browser Example|Browser Example]] has the following in its plugin.xml:
 
:For example, the [[RCP Browser Example|Browser Example]] has the following in its plugin.xml:
 +
 
<source lang="xml">
 
<source lang="xml">
 
<extension point="org.eclipse.core.runtime.products" id="product">
 
<extension point="org.eclipse.core.runtime.products" id="product">
Line 289: Line 227:
 
   </product>
 
   </product>
 
</extension>
 
</extension>
</source>
+
</source>  
 
+
 
 
:For more details, see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article.
 
:For more details, see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article.
  
==How can I change the default UI settings for the perspective bar location, fast view bar location, etc?==
+
== How can I change the embedded app icon in my application? ==
:Several UI settings such as the perspective bar location, fast view bar location, traditional vs. curvy tabs, etc., are controlled by preferences on the UI plug-in. These have default values defined by the generic workbench. However, the product can override these default values using the product preference customization mechanism.
+
 
 +
This can be customized via the product file which is used for the export.
 +
 
 +
== How can I change the default UI settings for the perspective bar location, fast view bar location, etc? ==
 +
 
 +
:Several UI settings such as the perspective bar location, fast view bar location, traditional vs. curvy tabs, etc., are controlled by preferences on the UI plug-in. These have default values defined by the generic workbench. However, the product can override these default values using the product preference customization mechanism.  
 
:[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def.htm Define a product] via the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def_extpt.htm products extension point] and add the following property:
 
:[http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def.htm Define a product] via the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_def_extpt.htm products extension point] and add the following property:
 +
 
<source lang="xml">
 
<source lang="xml">
 
<property
 
<property
 
   name="preferenceCustomization"
 
   name="preferenceCustomization"
 
   value="plugin_customization.ini"/>
 
   value="plugin_customization.ini"/>
</source>
+
</source>  
 +
 
 
:Then create a file called <code>plugin_customization.ini</code>, in the same directory as the <code>plugin.xml</code> file, with contents of the form:
 
:Then create a file called <code>plugin_customization.ini</code>, in the same directory as the <code>plugin.xml</code> file, with contents of the form:
 +
 
<source lang="xml">
 
<source lang="xml">
 
<pluginId>/<preferenceName>=<preferenceValue>
 
<pluginId>/<preferenceName>=<preferenceValue>
</source>
+
</source>  
 +
 
 
:For example, to show the perspective bar and fast view bar on the left, and to use curvy tabs, add the following to the <code>plugin_customization.ini</code> file:
 
:For example, to show the perspective bar and fast view bar on the left, and to use curvy tabs, add the following to the <code>plugin_customization.ini</code> file:
<pre>
+
<pre>org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
+
 
org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
 
org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
 
org.eclipse.ui/initialFastViewBarLocation=left
 
org.eclipse.ui/initialFastViewBarLocation=left
 
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
 
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
</pre>
+
</pre>  
:For a list of public preferences available on the UI plug-in and their valid values, see the interface [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IWorkbenchPreferenceConstants.html org.eclipse.ui.IWorkbenchPreferenceConstants].
+
:For a list of public preferences available on the UI plug-in and their valid values, see the interface [http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IWorkbenchPreferenceConstants.html org.eclipse.ui.IWorkbenchPreferenceConstants].  
:For more details, see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article and the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_configproduct.htm Customizing a product] section in Help.
+
:For more details, see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article and the [http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/product_configproduct.htm Customizing a product] section in Help.
 +
 
 +
== How can I get action set menus to appear in the right order, between my app's main menus? ==
  
==How can I get action set menus to appear in the right order, between my app's main menus?==
 
 
:When adding main menus to the menu manager in your WorkbenchAdvisor's fillActionBars method, add an "additions" group marker where you'd like action sets to appear.
 
:When adding main menus to the menu manager in your WorkbenchAdvisor's fillActionBars method, add an "additions" group marker where you'd like action sets to appear.
  
Line 322: Line 269:
 
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
 
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
 
menuBar.add(helpMenu);
 
menuBar.add(helpMenu);
</source>
+
</source>  
 +
 
 +
== Can multiple instances of the same view be made to appear at the same time? ==
  
==Can multiple instances of the same view be made to appear at the same time?==
+
:Yes. See IWorkbenchPage.showView(String primaryId, String secondaryId, int mode).  
:Yes. See IWorkbenchPage.showView(String primaryId, String secondaryId, int mode).
+
:The &lt;view&gt; element in the plugin.xml must also specify allowMultiple="true".  
:The <view> element in the plugin.xml must also specify allowMultiple="true".
+
:Be sure to use a different <code>secondaryId</code> for each instance, otherwise <code>showView</code> will find any existing view with the same primaryId and secondaryId rather than showing a new one.  
:Be sure to use a different <code>secondaryId</code> for each instance, otherwise <code>showView</code> will find any existing view with the same primaryId and secondaryId rather than showing a new one.
+
:To pass instance-specific data to the view, you will need to cast the resulting IViewPart down to the concrete view class and call your own setData method.  
:To pass instance-specific data to the view, you will need to cast the resulting IViewPart down to the concrete view class and call your own setData method.
+
 
:Note that views with a secondaryId will not match placeholders specifying just the primaryId. In a perspective factory, placeholders can be added for multi-instance views using the format <code>primaryId + ':' + secondaryId</code>, where '*' wildcards are supported.
 
:Note that views with a secondaryId will not match placeholders specifying just the primaryId. In a perspective factory, placeholders can be added for multi-instance views using the format <code>primaryId + ':' + secondaryId</code>, where '*' wildcards are supported.
  
==How can I deploy my RCP app?==
+
== How can I deploy my RCP app? ==
:[[Rich Client Platform#tutorials|Part 1 of Ed Burnette's RCP tutorial]] discusses this in the section entitled '''Running it outside of Eclipse'''.  In Eclipse 3.1, there is also a product export wizard to simplify this process.
+
  
==When I try running, nothing happens, or it complains that the application could not be found in the registry, or that other plug-ins are missing. How can I track the problem down?==
+
:[http://www.vogella.de/articles/EclipseRCP/article.html Lars Vogel's RCP tutorial] discusses this in the section entitled ''Products and Branding''.
:Try running first from within Eclipse using the Runtime Workbench (3.0 and 3.0.1) or Eclipse Application (3.1) launch configuration (Run > Debug...). Ensure that the application's plug-in(s) and all its prerequisites are selected in the Plug-ins tab. The easiest way is to select "Choose plug-ins and fragments to launch from the list", press Deselect All, check off the application's plug-in(s), and press Add Required Plug-ins. In 3.1, there is also a Validate Plug-in Set button to check that all prerequisites have been satisfied, without having to launch first. On the Main tab, be sure that the correct product or application is selected (using a product is preferred -- see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article).
+
  
:When running a deployed RCP application (not running from within Eclipse), ensure that the config.ini file in the configuration directory points to the correct product or application extension via the eclipse.product or eclipse.application entry (using a product is preferred -- see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article). Either all plug-ins need to be specified in the osgi.bundles entry of the config.ini, or the '''org.eclipse.update.configurator''' plug-in should be included to discover all available plug-ins the first time the application is run.
+
== When I try running, nothing happens, or it complains that the application could not be found in the registry, or that other plug-ins are missing. How can I track the problem down? ==
 +
 
 +
:Try running first from within Eclipse using the Runtime Workbench (3.0 and 3.0.1) or Eclipse Application (3.1) launch configuration (Run &gt; Debug...). Ensure that the application's plug-in(s) and all its prerequisites are selected in the Plug-ins tab. The easiest way is to select "Choose plug-ins and fragments to launch from the list", press Deselect All, check off the application's plug-in(s), and press Add Required Plug-ins. In 3.1, there is also a Validate Plug-in Set button to check that all prerequisites have been satisfied, without having to launch first. On the Main tab, be sure that the correct product or application is selected (using a product is preferred -- see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article).
 +
 
 +
:When running a deployed RCP application (not running from within Eclipse), ensure that the config.ini file in the configuration directory points to the correct product or application extension via the eclipse.product or eclipse.application entry (using a product is preferred -- see the [http://eclipse.org/articles/Article-Branding/branding-your-application.html Branding Your Application] article). Either all plug-ins need to be specified in the osgi.bundles entry of the config.ini, or the '''org.eclipse.update.configurator''' plug-in should be included to discover all available plug-ins the first time the application is run.
  
 
:If eclipse fails silently, look in the configuration and/or workspace directories for a .log file. If you use the eclipse.exe launcher (or equivalent on other platforms) it will tell you where to find any relevant log file.
 
:If eclipse fails silently, look in the configuration and/or workspace directories for a .log file. If you use the eclipse.exe launcher (or equivalent on other platforms) it will tell you where to find any relevant log file.
  
 
:Try adding -consolelog, -debug and -clean to the command line (as program arguments, not VM arguments). For example, to run the browser example with an explicitly specified product:
 
:Try adding -consolelog, -debug and -clean to the command line (as program arguments, not VM arguments). For example, to run the browser example with an explicitly specified product:
<pre>
+
<pre>d:\j2sdk1.4.2_01\bin\java org.eclipse.core.launcher.Main -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
d:\j2sdk1.4.2_01\bin\java org.eclipse.core.launcher.Main -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
+
</pre>  
</pre>
+
 
:or
 
:or
<pre>
+
<pre>eclipse -vm d:\j2sdk1.4.2_01\bin\java -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
eclipse -vm d:\j2sdk1.4.2_01\bin\java -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
+
</pre>  
</pre>
+
:-consolelog causes any log entries to be sent to the console as well (to get a console window, be sure to use java as the VM instead of javaw).  
:-consolelog causes any log entries to be sent to the console as well (to get a console window, be sure to use java as the VM instead of javaw).
+
:-debug causes Eclipse to log extra information about plug-in dependency problems (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=75648 here] for more background).  
:-debug causes Eclipse to log extra information about plug-in dependency problems (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=75648 here] for more background).
+
 
:-clean forces Eclipse to re-read all the plugin.xml files rather than using its cached representation of the plug-in registry.
 
:-clean forces Eclipse to re-read all the plugin.xml files rather than using its cached representation of the plug-in registry.
 
+
 
 
:While these options are helpful for debugging, note that there is a performance penalty for -debug and -clean, so it is not recommended that they be used in the final product.
 
:While these options are helpful for debugging, note that there is a performance penalty for -debug and -clean, so it is not recommended that they be used in the final product.
  
:For other troubleshooting hints, see the <b>Troubleshooting</b> section of the [http://eclipse.org/articles/Article-RCP-1/tutorial1.html RCP Tutorial, part 1].
+
:For other troubleshooting hints, see the '''Troubleshooting''' section of the [http://eclipse.org/articles/Article-RCP-1/tutorial1.html RCP Tutorial, part 1].
 +
 
 +
== My own RCP plug-ins are contributed by a feature. Why is the update manager complaining that my configuration is invalid? ==
 +
 
 +
:If you're using a feature only for the plug-ins you write, the update manager does not check dependencies on "orphan" plug-ins (i.e. plug-ins not contributed by a feature) so the configuration appears invalid. You will need to either:
 +
:*include all the plug-ins (yours and the RCP plug-ins) into your feature, or
 +
:*create another feature for the RCP plug-ins.
 +
 
 +
== Are editors tied to the workspace resource model or to the broader notion of files? ==
  
==My own RCP plug-ins are contributed by a feature. Why is the update manager complaining that my configuration is invalid?==
+
:No. The concept of an editor in the workbench and the corresponding types (IEditorPart, EditorPart, IEditorInput) are not tied to the workspace resource model, or even to the notion of files (whether in the workspace or the file system). Editors can be used for any kind of model, and can be textual or graphical.
:If you're using a feature only for the plug-ins you write, the update manager does not check dependencies on "orphan" plug-ins (i.e. plug-ins not contributed by a feature) so the configuration appears invalid. You will need to either:
+
:* include all the plug-ins (yours and the RCP plug-ins) into your feature, or
+
:* create another feature for the RCP plug-ins.
+
  
==Are editors tied to the workspace resource model or to the broader notion of files?==
+
:The Text component provides support for text editors. See the entry for the Text component in the [[#otherComponents|list of optional components]] above. See also the [[Rich Client Platform#Examples|RCP text editor example]].
:No.  The concept of an editor in the workbench and the corresponding types (IEditorPart, EditorPart, IEditorInput) are not tied to the workspace resource model, or even to the notion of files (whether in the workspace or the file system).  Editors can be used for any kind of model, and can be textual or graphical.  
+
  
:The Text component provides support for text editors. See the entry for the Text component in the [[#otherComponents | list of optional components]] above. See also the [[Rich Client Platform#Examples|RCP text editor example]].
+
:Eugene Ostroukhov has published [http://www.jroller.com/page/Zhou/20040215#eclipse_editors_not_tied_to a useful blog entry] describing how to create a non-file-based editor that connects to a database. See also [http://www.jroller.com/page/Zhou/20040414#update_on_custom_editor_inputs this update].
  
:Eugene Ostroukhov has published [http://www.jroller.com/page/Zhou/20040215#eclipse_editors_not_tied_to a useful blog entry] describing how to create a non-file-based editor that connects to a database.  See also [http://www.jroller.com/page/Zhou/20040414#update_on_custom_editor_inputs this update].
+
== How can I integrate my existing Swing components into an RCP application? ==
  
==How can I integrate my existing Swing components into an RCP application?==
+
:See [http://www.eclipse.org/swt/faq.php#swinginswt this SWT FAQ entry]. Note, however, that the SWT_AWT bridge does not currently work on all platforms, e.g. Mac ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=67384 bug 67384]).  
:See [http://www.eclipse.org/swt/faq.php#swinginswt this SWT FAQ entry]. Note, however, that the SWT_AWT bridge does not currently work on all platforms, e.g. Mac ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=67384 bug 67384]).
+
:See also the EclipseZone discussion [http://www.eclipsezone.com/eclipse/forums/t45697.html "Integrating Swing into Eclipse RCPs"].  
:See also the EclipseZone discussion [http://www.eclipsezone.com/eclipse/forums/t45697.html "Integrating Swing into Eclipse RCPs"].
+
 
:Also take a look at [http://swingwt.sourceforge.net/ SwingWT], an SWT-based implementation of the Swing API.
 
:Also take a look at [http://swingwt.sourceforge.net/ SwingWT], an SWT-based implementation of the Swing API.
  
==How do I get my app to use Windows XP themes?==
+
== How do I get my app to use Windows XP themes? ==
:See [http://www.eclipse.org/swt/faq.php#xpthemes this SWT FAQ entry].  Note that the manifest file must have the name javaw.exe.manifest or java.exe.manifest, not eclipse.exe.manifest (since eclipse.exe only launches the splash screen and then invokes the Java VM).  The manifest file must be in the jre\bin folder for the VM you use to launch Eclipse.
+
  
==How can I define key bindings for commands?==
+
:See [http://www.eclipse.org/swt/faq.php#xpthemes this SWT FAQ entry]. Note that the manifest file must have the name javaw.exe.manifest or java.exe.manifest, not eclipse.exe.manifest (since eclipse.exe only launches the splash screen and then invokes the Java VM). The manifest file must be in the jre\bin folder for the VM you use to launch Eclipse.
  
As of 3.3, the preferred means of binding keys is to use commands, handlers, and contexts. See
+
== How can I define key bindings for commands? ==
[[Platform_Command_Framework#KeyBindings]] for the extension points.
+
  
There are some wrinkles for the RCP case. See [http://www.vogella.de/articles/EclipseCommands/article.html#keybinding Keybindings for Eclipse Commands ] for a tutorial.
+
As of 3.3, the preferred means of binding keys is to use commands, handlers, and contexts. See [[Platform Command Framework#KeyBindings]] for the extension points.
 +
 
 +
There are some wrinkles for the RCP case. See [http://www.vogella.de/articles/EclipseCommands/article.html#keybinding Keybindings for Eclipse Commands ] for a tutorial.  
  
 
The key binding system is designed with the general idea that it is under the control of the user, not the program. If you want to control key bindings in an RCP application, you have to decide whether to expose the preference system or whether to be inflexible.  
 
The key binding system is designed with the general idea that it is under the control of the user, not the program. If you want to control key bindings in an RCP application, you have to decide whether to expose the preference system or whether to be inflexible.  
  
To begin with, note that each org.eclipse.ui.binding is a member of a scheme. Unless you interact with the preference system, or replace the BindingService with your own class, you must put all your bindings in org.eclipse.ui.defaultAcceleratorConfiguration. If you put them in some other scheme, you will find that here is no simple API to activate your scheme.
+
To begin with, note that each org.eclipse.ui.binding is a member of a scheme. Unless you interact with the preference system, or replace the BindingService with your own class, you must put all your bindings in org.eclipse.ui.defaultAcceleratorConfiguration. If you put them in some other scheme, you will find that here is no simple API to activate your scheme.  
  
The other obscure detail you will want is context management. If you want some commands (and thus bindings) to be active only in some parts, you will want to associate a context with your part. In createPartControl, write something like:
+
The other obscure detail you will want is context management. If you want some commands (and thus bindings) to be active only in some parts, you will want to associate a context with your part. In createPartControl, write something like:  
  
<source lang='Java'>
+
<source lang="Java">
 
IContextService contextService = (IContextService) getSite()
 
IContextService contextService = (IContextService) getSite()
 
.getService(IContextService.class);
 
.getService(IContextService.class);
 
contextService.activateContext(CONTEXT_ID);
 
contextService.activateContext(CONTEXT_ID);
</source>
+
</source>  
 +
 
 +
At the lowest level, you can obtain the IBindingService has no 'set' functions, and BindingService is a final class in an internal package. So, if you want to get complete control, you would have to create your own implementation of IBindingService that wraps the standards one.
  
At the lowest level, you can obtain the IBindingService has no 'set' functions, and BindingService is a final class in an internal package. So, if you want to get complete control, you would have to create your own implementation of IBindingService that wraps the standards one.
+
== How can I get my views and editors to coordinate with each other? ==
  
==How can I get my views and editors to coordinate with each other?==
+
:See the article [http://www-128.ibm.com/developerworks/java/library/os-ecllink/index.html "Make your Eclipse applications richer with view linking"] by Chinmay Pandit.  
:See the article [http://www-128.ibm.com/developerworks/java/library/os-ecllink/index.html "Make your Eclipse applications richer with view linking"] by Chinmay Pandit.
+
:You can also track part activation and other lifecycle using [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartService.html IPartService], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartListener.html IPartListener] and [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartListener2.html IPartListener2].  
:You can also track part activation and other lifecycle using [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartService.html IPartService], [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartListener.html IPartListener] and [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IPartListener2.html IPartListener2].
+
 
:To track part lifecycle from within an existing view or editor, use the part service on the part's containing IWorkbenchPage:
 
:To track part lifecycle from within an existing view or editor, use the part service on the part's containing IWorkbenchPage:
  
 
<source lang="java">
 
<source lang="java">
 
getSite().getPage().addPartListener(listener);
 
getSite().getPage().addPartListener(listener);
</source>
+
</source>  
  
 
:From outside the page (e.g. from an action added to the window in the ActionBarAdvisor), use the part service on the IWorkbenchWindow:
 
:From outside the page (e.g. from an action added to the window in the ActionBarAdvisor), use the part service on the IWorkbenchWindow:
Line 412: Line 364:
 
IWorkbenchWindow window = actionBarAdvisor.getActionBarConfigurer().getWindowConfigurer().getWindow();
 
IWorkbenchWindow window = actionBarAdvisor.getActionBarConfigurer().getWindowConfigurer().getWindow();
 
window.getPartService().addPartListener(listener);
 
window.getPartService().addPartListener(listener);
</source>
+
</source>  
  
 
:Be sure to remove the part listener in the appropriate dispose method.
 
:Be sure to remove the part listener in the appropriate dispose method.
  
==Which plug-ins are needed for the Eclipse Help system?==
+
== Which plug-ins are needed for the Eclipse Help system? ==
:See [[#What_other_Eclipse_components_can_be_used_in_constructing_RCP_applications.3F|"What other Eclipse components can be used in constructing RCP applications?"]]. Be sure to include the '''org.eclipse.tomcat''' plug-in since the dependency on it is indirect. The '''org.eclipse.help.ui''' plug-in requires the '''org.eclipse.help.appserver''' plug-in, which defines the '''org.eclipse.help.appserver.server''' extension point. The '''org.eclipse.tomcat''' plug-in adds an extension to this extension point. So although '''org.eclipse.tomcat''' is required, it's not found by adding all prerequisites of '''org.eclipse.help.ui''', and needs to be added manually.
+
 
:See also section 8 of the [http://www.eclipsecon.org/2005/presentations/EclipseCon2005_Tutorial8.pdf "Developing Eclipse Rich Client Applications" tutorial] from EclipseCon 2005.
+
:See [[#What_other_Eclipse_components_can_be_used_in_constructing_RCP_applications.3F|"What other Eclipse components can be used in constructing RCP applications?"]]. Be sure to include the '''org.eclipse.tomcat''' plug-in since the dependency on it is indirect. The '''org.eclipse.help.ui''' plug-in requires the '''org.eclipse.help.appserver''' plug-in, which defines the '''org.eclipse.help.appserver.server''' extension point. The '''org.eclipse.tomcat''' plug-in adds an extension to this extension point. So although '''org.eclipse.tomcat''' is required, it's not found by adding all prerequisites of '''org.eclipse.help.ui''', and needs to be added manually.  
:See also the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/help.htm "Plugging in help"] help topic.
+
:See also section 8 of the [http://www.eclipsecon.org/2005/presentations/EclipseCon2005_Tutorial8.pdf "Developing Eclipse Rich Client Applications" tutorial] from EclipseCon 2005.  
 +
:See also the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/help.htm "Plugging in help"] help topic.  
 
:See also the "Adding Help" chapter in the [[RCP Book]].
 
:See also the "Adding Help" chapter in the [[RCP Book]].
  
==How can I add the Eclipse Update Manager to my application?==
+
== How can I add the Eclipse Update Manager to my application? ==
:See section 9 of the [http://www.eclipsecon.org/2005/presentations/EclipseCon2005_Tutorial8.pdf "Developing Eclipse Rich Client Applications" tutorial] from EclipseCon 2005.
+
 
:See also the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_update.htm "Updating a product or extension"] help topic.
+
:See section 9 of the [http://www.eclipsecon.org/2005/presentations/EclipseCon2005_Tutorial8.pdf "Developing Eclipse Rich Client Applications" tutorial] from EclipseCon 2005.  
 +
:See also the [http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/guide/product_update.htm "Updating a product or extension"] help topic.  
 
:See also the "Adding Update" chapter of the [[RCP Book]].
 
:See also the "Adding Update" chapter of the [[RCP Book]].
  
==What is ICU4J and is it required?==
+
== How can I add the Eclipse p2 to my application? ==
:[[ICU4J]] is a set of Java libraries that provides more comprehensive support for Unicode, software globalization, and internationalization. In order to provide this functionality to the Eclipse community, ICU4J was added to the Eclipse platform in 3.2. You will see it in the build as a plug-in named com.ibm.icu.
+
 
:The ICU4J plug-in has a non-negligable footprint of ~3M, which is a significant fraction of the RCP base footprint. If reduced footprint is more important for your application than the enhancements provided by ICU4J, it can be replaced with a plug-in that is about 100KB in size and that simply calls through to the java.* packages (default JDK implementation) of the most commonly used classes and APIs in ICU4J.
+
:See the tutorial [http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_Application "Adding Self-Update to an RCP Application"] at the p2 Wiki.
 +
 
 +
== What is ICU4J and is it required? ==
 +
 
 +
:[[ICU4J]] is a set of Java libraries that provides more comprehensive support for Unicode, software globalization, and internationalization. In order to provide this functionality to the Eclipse community, ICU4J was added to the Eclipse platform in 3.2. You will see it in the build as a plug-in named com.ibm.icu.  
 +
:The ICU4J plug-in has a non-negligable footprint of ~3M, which is a significant fraction of the RCP base footprint. If reduced footprint is more important for your application than the enhancements provided by ICU4J, it can be replaced with a plug-in that is about 100KB in size and that simply calls through to the java.* packages (default JDK implementation) of the most commonly used classes and APIs in ICU4J.  
 
:For more details, see the [[ICU4J]] page.
 
:For more details, see the [[ICU4J]] page.
  
==How to bundle the JRE's for Windows and for Linux in my RCP application?==
+
== How to bundle the JRE's for Windows and for Linux in my RCP application? ==
 +
 
 
:I edited the build.properties of my product's "Feature", and I put the lines bellow:
 
:I edited the build.properties of my product's "Feature", and I put the lines bellow:
 +
 
   bin.includes = feature.xml
 
   bin.includes = feature.xml
  root.linux.gtk.x86=jre_linux/
+
root.linux.gtk.x86=jre_linux/
  root.linux.gtk.x86.permissions.755=jre_linux/
+
root.linux.gtk.x86.permissions.755=jre_linux/
  root.win32.win32.x86=jre_win/
+
root.win32.win32.x86=jre_win/
:The second line <code>root.linux.gtk.x86=jre_linux/</code>, tells the builder to take the contents of the "jre_linux/" directory and copy it to the root of my distribution.  
+
 
 +
:The second line <code>root.linux.gtk.x86=jre_linux/</code>, tells the builder to take the contents of the "jre_linux/" directory and copy it to the root of my distribution.
  
 
:The third line <code>root.linux.gtk.x86.permissions.755=jre_linux/</code> applies the chmod 755 over all the files under jre_linux/ after they are copied to the destination directory. Without it the java executable cannot be run, since it is chmod'ed to 644 (no execution permission).
 
:The third line <code>root.linux.gtk.x86.permissions.755=jre_linux/</code> applies the chmod 755 over all the files under jre_linux/ after they are copied to the destination directory. Without it the java executable cannot be run, since it is chmod'ed to 644 (no execution permission).
Line 446: Line 408:
 
   root.linux.gtk.x86.permissions.755=jre/bin/java
 
   root.linux.gtk.x86.permissions.755=jre/bin/java
  
(only) the jre/bin/java executable is being set +x. Could someone check this, please?
+
(only) the jre/bin/java executable is being set +x. Could someone check this, please?  
  
 
:TIP: the contents of the <code>jre_linux/</code> directory is a single directory called <code>jre</code>. Inside this directory are the jre's subdirectories "bin", "lib", etc. Calling it "jre" is extremely important because the launcher executable, at the absence of the <code>-vm path_to_java_executable</code> option will search by default for the java executable at the directory <code>./jre/bin</code>, being this directory relative from the directory where the executable was installed.
 
:TIP: the contents of the <code>jre_linux/</code> directory is a single directory called <code>jre</code>. Inside this directory are the jre's subdirectories "bin", "lib", etc. Calling it "jre" is extremely important because the launcher executable, at the absence of the <code>-vm path_to_java_executable</code> option will search by default for the java executable at the directory <code>./jre/bin</code>, being this directory relative from the directory where the executable was installed.
Line 454: Line 416:
 
:More options for the build.properties file can be found at http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm
 
:More options for the build.properties file can be found at http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm
  
[[Category:FAQ]][[Category:RCP]]
+
== How to add menu item, command and handler? ==
 +
 
 +
* Add dependency: MANIFEST.MF -> Dependencies tab -> Add -> ''org.eclipse.ui''
 +
* Add extension point org.eclipse.ui.menus: plugin.xml -> Extension -> Add -> ''org.eclipse.ui.menus''
 +
** Right-click -> New -> menuContribution
 +
*** Enter locationURI: menu:file
 +
**** Right click -> New -> command
 +
**** Enter commandId: '''''sampleCommand'''''
 +
**** Enter label: Sample Menu Item
 +
* Add extension point org.eclipse.ui.commands: plugin.xml -> Extensions -> Add -> ''org.eclipse.ui.commands''
 +
** Right-click -> New -> command
 +
*** Enter id: '''''sampleCommand'''''
 +
*** Enter label: Sample Command
 +
* Add extension point org.eclipse.ui.handlers: plugin.xml -> Extensions -> Add -> ''org.eclipse.ui.handlers''
 +
** Right-click -> New -> handler
 +
*** Enter commandId: '''''sampleCommand'''''
 +
*** Enter class: sample.SampleHandler
 +
*** Click class link and create class
 +
*** Provide sample implementation of the handler class implementing ''org.eclipse.core.commands.IHandler'' or extending ''org.eclipse.core.commands.AbstractHandler''
 +
 
 +
MANIFEST.MF
 +
 
 +
  Manifest-Version: 1.0
 +
  Bundle-ManifestVersion: 2
 +
  Bundle-Name: Sample Handler
 +
  Bundle-SymbolicName: sample;singleton:=true
 +
  Bundle-Version: 1.0.0.qualifier
 +
  Bundle-Vendor: sample
 +
  Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 +
  Require-Bundle: org.eclipse.ui
 +
 
 +
plugin.xml
 +
 
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<?eclipse version="3.4"?>
 +
<plugin>
 +
  <extension
 +
        point="org.eclipse.ui.menus">
 +
      <menuContribution
 +
            locationURI="menu:file">
 +
        <command
 +
              commandId="sampleCommand"
 +
              label="Sample Menu Item"
 +
              style="push">
 +
        </command>
 +
      </menuContribution>
 +
  </extension>
 +
  <extension
 +
        point="org.eclipse.ui.commands">
 +
      <command
 +
            id="sampleCommand"
 +
            name="Sample Command">
 +
      </command>
 +
  </extension>
 +
  <extension
 +
        point="org.eclipse.ui.handlers">
 +
      <handler
 +
            class="sample.SampleHandler"
 +
            commandId="sampleCommand">
 +
      </handler>
 +
  </extension>
 +
</plugin>
 +
</source>
 +
 
 +
Handler – sample implementation showing a message
 +
 
 +
<source lang="java">
 +
package sample;
 +
 +
import org.eclipse.core.commands.AbstractHandler;
 +
import org.eclipse.core.commands.ExecutionEvent;
 +
import org.eclipse.core.commands.ExecutionException;
 +
import org.eclipse.jface.dialogs.MessageDialog;
 +
import org.eclipse.swt.widgets.Display;
 +
 +
public class SampleHandler extends AbstractHandler {
 +
 +
@Override
 +
public Object execute(ExecutionEvent event) throws ExecutionException {
 +
MessageDialog.openInformation(Display.getDefault().getActiveShell(),
 +
"Sample Handler", "Sample Handler");
 +
return null;
 +
}
 +
}
 +
</source>
 +
 
 +
== How can I show line numbers by default in my RCP application? ==
 +
 
 +
Add the following line to your plugin_customization.ini file:
 +
<source lang="xml">
 +
org.eclipse.ui.editors/lineNumberRuler=true
 +
</source>
 +
[[Category:FAQ]] [[Category:RCP]]

Latest revision as of 21:32, 8 February 2013

RCP
Home
How to Contribute
FAQ
Eclipse Rich Client Platform FAQ 

The following are Frequently Asked Questions (FAQs) about the Eclipse Rich Client Platform. For relevant tutorials, help topics, newsgroups, examples, and other resources, see the main RCP page.

For general Eclipse FAQs, which address many RCP issues, see The Official Eclipse FAQs. For Eclipse 4, see the Eclipse 4 RCP FAQ.

Contents

What is the Eclipse Rich Client Platform?

While the Eclipse platform is designed to serve as an open tools platform, it is architected so that its components could be used to build just about any client application. The minimal set of plug-ins needed to build a rich client application is collectively known as the Rich Client Platform.
For more details, see the main RCP page.
Also note that Part 1 of the original Eclipse whitepaper also applies, and is a good high-level overview of what is available in the Rich Client Platform. Although it speaks of the Eclipse IDE (which is itself an RCP application), almost all of the functionality described in Part 1 is available in the RCP. Exceptions are the Workspace model and Team support, which are components in the IDE, not the RCP. Part 2's discussion of JDT is specific to the Eclipse IDE, however it is a good illustration of how an application would be structured on top of the RCP.

Why should I build my application on the Eclipse Rich Client Platform?

Many people that have built, or are building, RCP applications state that the main value they get from using RCP is that it allows them to quickly build a professional-looking application, with native look-and-feel, on multiple platforms, allowing them to focus on their value-add. They appreciate that the components that form RCP are of high quality, are actively maintained, and are open source. They often discover after the initial adoption of RCP that there are many other Eclipse components available for reuse (e.g. Help UI, Update Manager, Cheat Sheets, Intro, etc.). Several have also discovered that the inherent extensibility of Eclipse allows them to build not only a closed-form product, but also an open-ended platform (like the Eclipse IDE) in their own domain.
For a nice description of the benefits of RCP, see Jeff Norris' forward on NASA/JPL's use of RCP (archived link), a free excerpt from the RCP Book.
See also the case studies available on the RCP Community page.

What is included in the Rich Client Platform?

The Eclipse Rich Client Platform consists of the following components:
Component
Description
Plug-ins
Documentation
Eclipse Runtime
Provides the foundational support for plug-ins, extension points and extensions (among other facilities).  The Eclipse runtime is built on top of the OSGi framework. org.eclipse.core.runtime

org.eclipse.osgi
org.eclipse.osgi.services

Platform Core home page

Dev guide: Runtime overview
Article: Notes on the Eclipse Plug-in Architecture

SWT
The Standard Widget Toolkit. SWT is designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented org.eclipse.swt

+ platform-specific fragments

Platform SWT home page

Dev guide: SWT
Getting Started
SWT FAQ
SWT code snippets
SWT Articles

JFace
A UI framework, layered on top of SWT, for handling many common UI programming tasks. org.eclipse.jface JFace
Workbench The Workbench builds on top of the Runtime, SWT and JFace to provide a highly scalable, open-ended, multi-window environment for managing views, editors, perspectives (task-oriented layouts), actions, wizards, preference pages, and more.

The Workbench is sometimes called the Generic Workbench, to distinguish it from the IDE Workbench facilities defined in the org.eclipse.ui.ide plug-in.

org.eclipse.ui

org.eclipse.ui.workbench

Platform UI home page

Dev guide: Plugging into the workbench,Dialogs and wizards, Advanced workbench concepts
Workbench and JFace Articles

Other prerequisites for the Workbench

Support for XML expressions language, commands, and help core content model.
org.eclipse.core.expressions

org.eclipse.core.commands
org.eclipse.help


Note that as of Eclipse 3.3M6, org.eclipse.help requires com.ibm.icu which takes a sizeable amount of footprint (that can be reduced). Bug 183761 has been filed to investigate removing this dependency from org.eclipse.help.

What is the disk footprint for the Rich Client Platform?

As of Eclipse 3.7, the disk footprint is about 20 Meg.
If footprint is most important, using eRCP might be an option. This is a stripped-down version (eSWT, eJface, eWorkbench) originally designed for embedded devices, but also running on Windows desktop. Its footprint is just under 4 MB and it runs on low-profile JVMs.

Is the resources plug-in (org.eclipse.core.resources) considered part of the Rich Client Platform?

No. The workspace resource model provided by the org.eclipse.core.resources plug-in is not considered part of the Rich Client Platform. While this is the underlying data model for the Eclipse IDE, the RCP makes no assumptions about the underlying data model of the application being built. The data model could just as well be files in the local filesystem, a remote database, an RDF data store, or anything else. If it makes sense for the application, org.eclipse.core.resources can be included and used as the application's data model, but this is not required. Much effort was put into Eclipse 3.0 to remove the dependencies on org.eclipse.core.resources from the generic workbench. Any resource dependencies (for example, the New Project, Folder and File wizards, and the Resource Navigator, Tasks and Problems views), were considered IDE-specific and factored out into the IDE plugin (org.eclipse.ui.ide).


Is the IDE plug-in (org.eclipse.ui.ide) considered part of the Rich Client Platform?

No. The org.eclipse.ui.ide plug-in is layered on top of the generic workbench (org.eclipse.ui) and adds IDE-specific views, preference pages and other extensions. The IDE uses the workspace resource model as its underlying data model. :The org.eclipse.ui.ide plug-in, and the extensions defined within it, are not part of the Rich Client Platform, but they can be used in a resource- (and workspace-)based RCP application.

Prior to Eclipse 3.3, the org.eclipse.ui.ide was not designed to be reused in other RCP applications because it also defined the application for the Eclipse IDE, which instantiates the generic workbench, configuring it with IDE-specific menu and toolbar items. As of Eclipse 3.3, the application definition has been moved to a new plug-in org.eclipse.ui.ide.application.

What other Eclipse components can be used in constructing RCP applications?

Here is a list of some of the reusable components in the broader Eclipse codebase that can be incorporated into RCP applications.
Component
Description
Plug-ins
Documentation
Help
Web-app-based Help UI, with support for dynamic content.
org.apache.lucene

org.eclipse.help.appserver
org.eclipse.help.base
org.eclipse.help.ui
org.eclipse.help.webapp
org.eclipse.tomcat
org.eclipse.ui.forms

Platform Help home page

Dev guide: Plugging in help

Update Manager
Allows users to discover and install updated versions of products and extensions. org.eclipse.update.configurator

org.eclipse.update.core
org.eclipse.update.scheduler
org.eclipse.update.ui
+ platform-specific fragments

Platform Update home page

Dev guide: Updating a product or extension

Text
Framework for building high-function text editors.
org.eclipse.text

org.eclipse.jface.text
org.eclipse.workbench.texteditor

Platform Text home page

Dev guide: Text editors and platform text

Forms
Flat look control library and multi-page editor framework (used in PDE editors).
org.eclipse.ui.forms Article: Eclipse Forms: Rich UI for the Rich Client
Welcome Page (aka Intro) Initial welcome experience and guided assistance.
org.eclipse.ui.intro
Dev guide: Intro support
Cheat Sheets
A Cheat Sheet guides the user through a long-running, multi-step task.
org.eclipse.ui.cheatsheets
Dev guide: Cheat Sheets
Resources
Workspace resource model, with managed projects, folders and files.
org.eclipse.core.resources
Platform Core home page
Dev guide: Resources overview
Console Extensible console view.
org.eclipse.ui.console
Javadoc: org.eclipse.ui.console, org.eclipse.ui.console.actions
Outline and Properties views Outline and Properties views
org.eclipse.ui.views
TBD
Graphical Editing Framework (GEF) Framework for building graphical editors. Includes Draw2D, a vector graphics framework.
org.eclipse.draw2d

org.eclipse.gef

GEF home page

Overview, FAQ

Eclipse Modeling Framework (EMF) and Service Data Objects (SDO) EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model.  SDO is a framework that simplifies and unifies data application development in a service oriented architecture (SOA). EMF plug-in list from CVS
EMF home page
Overviews:EMF, EMF Edit, EMF Validation ..., SDO

How do I get started with RCP?

The Eclipse RCP tutorials are a good starting points. See also the examples and the suggested help topics.

What is the recommended target platform setup? Or: How can I build and run my RCP app against a different version of the Eclipse base?

With the default setup of the Eclipse SDK, plug-ins are developed against the same plug-in configuration used by the IDE itself. However, it is possible to configure the IDE to build, run and deploy against a different version of the eclipse base, via the Plug-in Development > Target Platform preference page. Configuring the target platform is highly recommended in order to avoid introducing unwanted dependencies on IDE plug-ins into your RCP app.
For more details, see the "Target Platform Preferences" help topic in the PDE Guide. The tutorial in the RCP Book also walks you through this process.
For a recommended setup, use the following steps. We assume the Eclipse SDK (aka the IDE) is already installed, e.g. in c:\eclipse.
  1. Go to the Platform downloads page.
  2. Pick the build you want to use as your RCP target (e.g. the 3.2 M6 milestone build).
  3. In the RCP SDK section (not the Eclipse SDK, Platform SDK, or RCP Binary sections) download the RCP SDK for your platform. This contains just the base RCP plug-ins for that platform.
  4. Extract it to a different directory than the IDE's (e.g. c:\eclipse-RCP-SDK).
  5. Optionally, if you want to deploy to other platforms, download the Delta Pack (the link is at the bottom of the RCP SDK section). This contains the platform-specific plug-ins for all platforms. Extract it to the same location as the RCP SDK (say OK to any prompts to overwrite files).
  6. Run the IDE (e.g. c:\eclipse\eclipse.exe).
  7. Go to Window > Preferences > Plugin-Development > Target Platform, and configure the location to be the eclipse subdirectory of the RCP SDK install (e.g. c:\eclipse-RCP-SDK\eclipse). Note: if you type or paste the path, you'll need to press the Reload button.
  8. The list of plug-ins on the Plug-ins tab should update to show the RCP SDK plug-ins; other plug-ins like those for JDT and PDE should not appear.
Now, any plug-in projects in your workspace will build and run against the RCP SDK plug-ins rather than the IDE's.
If you are developing against the same version as the Eclipse SDK, there is new support in since 3.2 M5 that simplifies setting up the Target Platform for RCP development, and makes it easier to incrementally include other plug-ins from the SDK build.
  1. Go to Window > Preferences > Plugin-Development > Target Platform.
  2. In the "Pre-defined Targets" section at the bottom, choose one of the "Base RCP" entries, e.g. "Base RCP (with Source)" and press the "Load Target" button.
  3. The list of plug-ins on the Plug-ins tab still shows all SDK plug-ins, but only the RCP base plug-ins are checked; other plug-ins like those for JDT and PDE should not be checked. Only checked plug-ins constitute your target. Unchecked plug-ins are ignored.
PDE currently supports two versions back for plug-in development. That is, with Eclipse 3.2 you can develop 3.0 plugins and launch 3.0 systems, but not 2.1 or earlier.

Will an RCP application inherit the Eclipse IDE look?

By default, RCP apps use the same presentation as the IDE, but with different defaults (e.g. tabs are square rather than curvy). However, other presentation implementations are available. For example, the R2.1 presentation available in the IDE can also be used by RCP apps; it is provided in the org.eclipse.ui.presentations.r21 plug-in.
For instructions on how to deploy the R2.1 presentation, see RCP Custom Look and Feel.
The default presentation of views and editors, and the overall window layout, is also configurable in several ways. See the following entries for more details.
Note.png
The Presentation layer has been deprecated in Eclipse 4.x in favour of the more powerful CSS styling feature.


How can I change the window icon in my application?

Define a product via the products extension point and specify the windowImages property to refer to two image files, a 16x16 one and a 32x32 one.
It is best to specify both, since a 16x16 icon is typically used in the window trim, and a 32x32 icon is typically used in the OS's application switcher (e.g. Alt+Tab on Windows). If only one is specified, it is scaled up or down as needed, which can result in poor quality.
For example, the Browser Example has the following in its plugin.xml:
<extension point="org.eclipse.core.runtime.products" id="product">
  <product
    name="%productName"
    application="org.eclipse.ui.examples.rcp.browser.app">
    <property
      name="windowImages"
      value="icons/eclipse.gif,icons/eclipse32.gif"/>
    ...
  </product>
</extension>
For more details, see the Branding Your Application article.

How can I change the embedded app icon in my application?

This can be customized via the product file which is used for the export.

How can I change the default UI settings for the perspective bar location, fast view bar location, etc?

Several UI settings such as the perspective bar location, fast view bar location, traditional vs. curvy tabs, etc., are controlled by preferences on the UI plug-in. These have default values defined by the generic workbench. However, the product can override these default values using the product preference customization mechanism.
Define a product via the products extension point and add the following property:
<property
  name="preferenceCustomization"
  value="plugin_customization.ini"/>
Then create a file called plugin_customization.ini, in the same directory as the plugin.xml file, with contents of the form:
<pluginId>/<preferenceName>=<preferenceValue>
For example, to show the perspective bar and fast view bar on the left, and to use curvy tabs, add the following to the plugin_customization.ini file:
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left
org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
org.eclipse.ui/initialFastViewBarLocation=left
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
For a list of public preferences available on the UI plug-in and their valid values, see the interface org.eclipse.ui.IWorkbenchPreferenceConstants.
For more details, see the Branding Your Application article and the Customizing a product section in Help.

How can I get action set menus to appear in the right order, between my app's main menus?

When adding main menus to the menu manager in your WorkbenchAdvisor's fillActionBars method, add an "additions" group marker where you'd like action sets to appear.
menuBar.add(fileMenu);
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(helpMenu);

Can multiple instances of the same view be made to appear at the same time?

Yes. See IWorkbenchPage.showView(String primaryId, String secondaryId, int mode).
The <view> element in the plugin.xml must also specify allowMultiple="true".
Be sure to use a different secondaryId for each instance, otherwise showView will find any existing view with the same primaryId and secondaryId rather than showing a new one.
To pass instance-specific data to the view, you will need to cast the resulting IViewPart down to the concrete view class and call your own setData method.
Note that views with a secondaryId will not match placeholders specifying just the primaryId. In a perspective factory, placeholders can be added for multi-instance views using the format primaryId + ':' + secondaryId, where '*' wildcards are supported.

How can I deploy my RCP app?

Lars Vogel's RCP tutorial discusses this in the section entitled Products and Branding.

When I try running, nothing happens, or it complains that the application could not be found in the registry, or that other plug-ins are missing. How can I track the problem down?

Try running first from within Eclipse using the Runtime Workbench (3.0 and 3.0.1) or Eclipse Application (3.1) launch configuration (Run > Debug...). Ensure that the application's plug-in(s) and all its prerequisites are selected in the Plug-ins tab. The easiest way is to select "Choose plug-ins and fragments to launch from the list", press Deselect All, check off the application's plug-in(s), and press Add Required Plug-ins. In 3.1, there is also a Validate Plug-in Set button to check that all prerequisites have been satisfied, without having to launch first. On the Main tab, be sure that the correct product or application is selected (using a product is preferred -- see the Branding Your Application article).
When running a deployed RCP application (not running from within Eclipse), ensure that the config.ini file in the configuration directory points to the correct product or application extension via the eclipse.product or eclipse.application entry (using a product is preferred -- see the Branding Your Application article). Either all plug-ins need to be specified in the osgi.bundles entry of the config.ini, or the org.eclipse.update.configurator plug-in should be included to discover all available plug-ins the first time the application is run.
If eclipse fails silently, look in the configuration and/or workspace directories for a .log file. If you use the eclipse.exe launcher (or equivalent on other platforms) it will tell you where to find any relevant log file.
Try adding -consolelog, -debug and -clean to the command line (as program arguments, not VM arguments). For example, to run the browser example with an explicitly specified product:
d:\j2sdk1.4.2_01\bin\java org.eclipse.core.launcher.Main -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
or
eclipse -vm d:\j2sdk1.4.2_01\bin\java -product org.eclipse.ui.examples.rcp.browser.product -consolelog -clean -debug
-consolelog causes any log entries to be sent to the console as well (to get a console window, be sure to use java as the VM instead of javaw).
-debug causes Eclipse to log extra information about plug-in dependency problems (see here for more background).
-clean forces Eclipse to re-read all the plugin.xml files rather than using its cached representation of the plug-in registry.
While these options are helpful for debugging, note that there is a performance penalty for -debug and -clean, so it is not recommended that they be used in the final product.
For other troubleshooting hints, see the Troubleshooting section of the RCP Tutorial, part 1.

My own RCP plug-ins are contributed by a feature. Why is the update manager complaining that my configuration is invalid?

If you're using a feature only for the plug-ins you write, the update manager does not check dependencies on "orphan" plug-ins (i.e. plug-ins not contributed by a feature) so the configuration appears invalid. You will need to either:
  • include all the plug-ins (yours and the RCP plug-ins) into your feature, or
  • create another feature for the RCP plug-ins.

Are editors tied to the workspace resource model or to the broader notion of files?

No. The concept of an editor in the workbench and the corresponding types (IEditorPart, EditorPart, IEditorInput) are not tied to the workspace resource model, or even to the notion of files (whether in the workspace or the file system). Editors can be used for any kind of model, and can be textual or graphical.
The Text component provides support for text editors. See the entry for the Text component in the list of optional components above. See also the RCP text editor example.
Eugene Ostroukhov has published a useful blog entry describing how to create a non-file-based editor that connects to a database. See also this update.

How can I integrate my existing Swing components into an RCP application?

See this SWT FAQ entry. Note, however, that the SWT_AWT bridge does not currently work on all platforms, e.g. Mac (bug 67384).
See also the EclipseZone discussion "Integrating Swing into Eclipse RCPs".
Also take a look at SwingWT, an SWT-based implementation of the Swing API.

How do I get my app to use Windows XP themes?

See this SWT FAQ entry. Note that the manifest file must have the name javaw.exe.manifest or java.exe.manifest, not eclipse.exe.manifest (since eclipse.exe only launches the splash screen and then invokes the Java VM). The manifest file must be in the jre\bin folder for the VM you use to launch Eclipse.

How can I define key bindings for commands?

As of 3.3, the preferred means of binding keys is to use commands, handlers, and contexts. See Platform Command Framework#KeyBindings for the extension points.

There are some wrinkles for the RCP case. See Keybindings for Eclipse Commands for a tutorial.

The key binding system is designed with the general idea that it is under the control of the user, not the program. If you want to control key bindings in an RCP application, you have to decide whether to expose the preference system or whether to be inflexible.

To begin with, note that each org.eclipse.ui.binding is a member of a scheme. Unless you interact with the preference system, or replace the BindingService with your own class, you must put all your bindings in org.eclipse.ui.defaultAcceleratorConfiguration. If you put them in some other scheme, you will find that here is no simple API to activate your scheme.

The other obscure detail you will want is context management. If you want some commands (and thus bindings) to be active only in some parts, you will want to associate a context with your part. In createPartControl, write something like:

	IContextService contextService = (IContextService) getSite()
		.getService(IContextService.class);
	contextService.activateContext(CONTEXT_ID);

At the lowest level, you can obtain the IBindingService has no 'set' functions, and BindingService is a final class in an internal package. So, if you want to get complete control, you would have to create your own implementation of IBindingService that wraps the standards one.

How can I get my views and editors to coordinate with each other?

See the article "Make your Eclipse applications richer with view linking" by Chinmay Pandit.
You can also track part activation and other lifecycle using IPartService, IPartListener and IPartListener2.
To track part lifecycle from within an existing view or editor, use the part service on the part's containing IWorkbenchPage:
getSite().getPage().addPartListener(listener);
From outside the page (e.g. from an action added to the window in the ActionBarAdvisor), use the part service on the IWorkbenchWindow:
IWorkbenchWindow window = actionBarAdvisor.getActionBarConfigurer().getWindowConfigurer().getWindow();
window.getPartService().addPartListener(listener);
Be sure to remove the part listener in the appropriate dispose method.

Which plug-ins are needed for the Eclipse Help system?

See "What other Eclipse components can be used in constructing RCP applications?". Be sure to include the org.eclipse.tomcat plug-in since the dependency on it is indirect. The org.eclipse.help.ui plug-in requires the org.eclipse.help.appserver plug-in, which defines the org.eclipse.help.appserver.server extension point. The org.eclipse.tomcat plug-in adds an extension to this extension point. So although org.eclipse.tomcat is required, it's not found by adding all prerequisites of org.eclipse.help.ui, and needs to be added manually.
See also section 8 of the "Developing Eclipse Rich Client Applications" tutorial from EclipseCon 2005.
See also the "Plugging in help" help topic.
See also the "Adding Help" chapter in the RCP Book.

How can I add the Eclipse Update Manager to my application?

See section 9 of the "Developing Eclipse Rich Client Applications" tutorial from EclipseCon 2005.
See also the "Updating a product or extension" help topic.
See also the "Adding Update" chapter of the RCP Book.

How can I add the Eclipse p2 to my application?

See the tutorial "Adding Self-Update to an RCP Application" at the p2 Wiki.

What is ICU4J and is it required?

ICU4J is a set of Java libraries that provides more comprehensive support for Unicode, software globalization, and internationalization. In order to provide this functionality to the Eclipse community, ICU4J was added to the Eclipse platform in 3.2. You will see it in the build as a plug-in named com.ibm.icu.
The ICU4J plug-in has a non-negligable footprint of ~3M, which is a significant fraction of the RCP base footprint. If reduced footprint is more important for your application than the enhancements provided by ICU4J, it can be replaced with a plug-in that is about 100KB in size and that simply calls through to the java.* packages (default JDK implementation) of the most commonly used classes and APIs in ICU4J.
For more details, see the ICU4J page.

How to bundle the JRE's for Windows and for Linux in my RCP application?

I edited the build.properties of my product's "Feature", and I put the lines bellow:
 bin.includes = feature.xml
root.linux.gtk.x86=jre_linux/
root.linux.gtk.x86.permissions.755=jre_linux/
root.win32.win32.x86=jre_win/
The second line root.linux.gtk.x86=jre_linux/, tells the builder to take the contents of the "jre_linux/" directory and copy it to the root of my distribution.
The third line root.linux.gtk.x86.permissions.755=jre_linux/ applies the chmod 755 over all the files under jre_linux/ after they are copied to the destination directory. Without it the java executable cannot be run, since it is chmod'ed to 644 (no execution permission).
Note: The above permissions line didn't work for me. Maybe this is because root.linux.gtk.x86 has already been set to jre_linux/ in the line before? When I change it to
 root.linux.gtk.x86.permissions.755=jre/bin/java

(only) the jre/bin/java executable is being set +x. Could someone check this, please?

TIP: the contents of the jre_linux/ directory is a single directory called jre. Inside this directory are the jre's subdirectories "bin", "lib", etc. Calling it "jre" is extremely important because the launcher executable, at the absence of the -vm path_to_java_executable option will search by default for the java executable at the directory ./jre/bin, being this directory relative from the directory where the executable was installed.
Conclusion: With this configuration the "jre/" directory tree is copied to the root of my distribution and the java executable at jre/bin/java is run by default, even if my system has other java's on its $PATH. And it wasn't necessary to set any "-vm path" to the launcher.
More options for the build.properties file can be found at http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm

How to add menu item, command and handler?

  • Add dependency: MANIFEST.MF -> Dependencies tab -> Add -> org.eclipse.ui
  • Add extension point org.eclipse.ui.menus: plugin.xml -> Extension -> Add -> org.eclipse.ui.menus
    • Right-click -> New -> menuContribution
      • Enter locationURI: menu:file
        • Right click -> New -> command
        • Enter commandId: sampleCommand
        • Enter label: Sample Menu Item
  • Add extension point org.eclipse.ui.commands: plugin.xml -> Extensions -> Add -> org.eclipse.ui.commands
    • Right-click -> New -> command
      • Enter id: sampleCommand
      • Enter label: Sample Command
  • Add extension point org.eclipse.ui.handlers: plugin.xml -> Extensions -> Add -> org.eclipse.ui.handlers
    • Right-click -> New -> handler
      • Enter commandId: sampleCommand
      • Enter class: sample.SampleHandler
      • Click class link and create class
      • Provide sample implementation of the handler class implementing org.eclipse.core.commands.IHandler or extending org.eclipse.core.commands.AbstractHandler

MANIFEST.MF

 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Sample Handler
 Bundle-SymbolicName: sample;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Vendor: sample
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.ui

plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="menu:file">
         <command
               commandId="sampleCommand"
               label="Sample Menu Item"
               style="push">
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            id="sampleCommand"
            name="Sample Command">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="sample.SampleHandler"
            commandId="sampleCommand">
      </handler>
   </extension>
</plugin>

Handler – sample implementation showing a message

package sample;
 
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
 
public class SampleHandler extends AbstractHandler {
 
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		MessageDialog.openInformation(Display.getDefault().getActiveShell(),
				"Sample Handler", "Sample Handler");
		return null;
	}
}

How can I show line numbers by default in my RCP application?

Add the following line to your plugin_customization.ini file:

org.eclipse.ui.editors/lineNumberRuler=true