[Eclipse]How to export eclipse rich client application?

来源:互联网 发布:windows 运行指令 编辑:程序博客网 时间:2024/05/20 07:15

It is interesting to create rich client application using eclipse platform. After you create your project using eclipse PDE, you would like to export your application as native application. In this recipe, i will show how i do it in my local environment.

First of all, we need to create  plugin to hook production and application extension point. In the plugin,xml, it should have following entry sets.

   <extension         id="product"         point="org.eclipse.core.runtime.products">      <product            application="org.eclipse.trader.platform.application"            name="RCP Product">         <property               name="aboutText"               value="RCP Mail template created by PDE">         </property>         <property               name="windowImages"               value="icons/sample2.gif">         </property>         <property               name="aboutImage"               value="product_lg.gif">         </property>         <property               name="appName"               value="RCP Product">         </property>      </product>   </extension>
<extension         id="application"         point="org.eclipse.core.runtime.applications">      <application>         <run               class="org.eclipse.trader.platform.Application">         </run>      </application>   </extension>
After those typical extension point, it is also necessary to include the common eclipse UI extension points: perspective, view, preference,commands, editor and etc. Your custom business logic can be build on those extension points.

Finally, product configuration has to be created to describe your rich client application and eclipse embeds "export" function to support product configuration file.It is easy to export your rich client application based on the product description.

<product name="RCP Product" id="org.eclipse.trader.platform.product" application="org.eclipse.trader.platform.application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">   <aboutInfo>      <image path="product_lg.gif"/>      <text>         RCP Mail template created by PDE      </text>   </aboutInfo>   <configIni use="default">   </configIni>   <launcherArgs>      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>   </launcherArgs>   <windowImages i16="icons/sample2.gif"/>   <plugins>      <plugin id="com.ibm.icu"/>      <plugin id="javax.annotation"/>      <plugin id="javax.inject"/>      <plugin id="org.apache.batik.css"/>      <plugin id="org.apache.batik.util"/>      <plugin id="org.apache.batik.util.gui"/>      <plugin id="org.eclipse.core.commands"/>      <plugin id="org.eclipse.core.contenttype"/>      <plugin id="org.eclipse.core.databinding"/>      <plugin id="org.eclipse.core.databinding.observable"/>      <plugin id="org.eclipse.core.databinding.property"/>      <plugin id="org.eclipse.core.expressions"/>      <plugin id="org.eclipse.core.jobs"/>      <plugin id="org.eclipse.core.runtime"/>      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>      <plugin id="org.eclipse.e4.core.commands"/>      <plugin id="org.eclipse.e4.core.contexts"/>      <plugin id="org.eclipse.e4.core.di"/>      <plugin id="org.eclipse.e4.core.di.extensions"/>      <plugin id="org.eclipse.e4.core.services"/>      <plugin id="org.eclipse.e4.ui.bindings"/>      <plugin id="org.eclipse.e4.ui.css.core"/>      <plugin id="org.eclipse.e4.ui.css.swt"/>      <plugin id="org.eclipse.e4.ui.css.swt.theme"/>      <plugin id="org.eclipse.e4.ui.di"/>      <plugin id="org.eclipse.e4.ui.model.workbench"/>      <plugin id="org.eclipse.e4.ui.services"/>      <plugin id="org.eclipse.e4.ui.widgets"/>      <plugin id="org.eclipse.e4.ui.workbench"/>      <plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>      <plugin id="org.eclipse.e4.ui.workbench.swt"/>      <plugin id="org.eclipse.e4.ui.workbench3"/>      <plugin id="org.eclipse.emf.common"/>      <plugin id="org.eclipse.emf.ecore"/>      <plugin id="org.eclipse.emf.ecore.change"/>      <plugin id="org.eclipse.emf.ecore.xmi"/>      <plugin id="org.eclipse.equinox.app"/>      <plugin id="org.eclipse.equinox.common"/>      <plugin id="org.eclipse.equinox.ds"/>      <plugin id="org.eclipse.equinox.event"/>      <plugin id="org.eclipse.equinox.preferences"/>      <plugin id="org.eclipse.equinox.registry"/>      <plugin id="org.eclipse.equinox.util"/>      <plugin id="org.eclipse.help"/>      <plugin id="org.eclipse.jface"/>      <plugin id="org.eclipse.jface.databinding"/>      <plugin id="org.eclipse.osgi"/>      <plugin id="org.eclipse.osgi.services"/>      <plugin id="org.eclipse.swt"/>      <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>      <plugin id="org.eclipse.trader.platform"/>      <plugin id="org.eclipse.ui"/>      <plugin id="org.eclipse.ui.workbench"/>      <plugin id="org.w3c.css.sac"/>      <plugin id="org.w3c.dom.smil"/>      <plugin id="org.w3c.dom.svg"/>   </plugins></product>