官术网_书友最值得收藏!

Time for action – installing the E4 tools

A model fragment needs to be created to add commands and handlers into an E4 plug-in or application. This can be created with the E4 tools that are part of the default Eclipse repository for Eclipse Mars and Eclipse Neon, or can be installed from the E4 page for Luna and below versions.

  1. Go to the Help | Install New Software… menu. For Eclipse Mars, Eclipse Neon and later, choose the http://download.eclipse.org/releases/neon/ site, substituting the platform name if necessary. For Eclipse Luna and below, choose the corresponding update site from the http://download.eclipse.org/e4/downloads/ page instead.
  2. Type e4 tools into the search box and select the Eclipse e4 Tools feature:
  3. Click on Finish to continue installing the tools and restart Eclipse when prompted.
  4. To verify that the tools have been installed correctly, select the com.packtpub.e4.clock.ui project, go to the File | New menu, and search for new model fragment. This should show an entry under Eclipse 4 | Model | New Model Fragment:
  5. Click on Next and choose the com.packtpub.e4.clock.ui as the container with fragment.e4xmi as the filename.
  6. The plugin.xml should have a new fragment entry:
    <extension
     id="com.packtpub.e4.clock.ui.fragment"
     point="org.eclipse.e4.workbench.model">
      <fragment uri="fragment.e4xmi"/>
    </extension>

What just happened?

The Eclipse E4 tools are used to create application fragments that allow E4 content to be created and hosted in a plug-in. The E4 tools have been present in the default update site since Eclipse Mars.

An E4 application fragment is stored in another XML file, linked to from the plugin.xml file. Although it is possible to have multiple fragments in a single plug-in, it's more common to have only a single fragment per plug-in. The default fragment name is fragment.e4xmi, but other names with the e4xmi extension can be used instead, provided that the reference from the plugin.xml points to the file.

主站蜘蛛池模板: 庆安县| 郎溪县| 肥城市| 象州县| 丹阳市| 张家界市| 定结县| 邢台县| 伊宁县| 佛学| 论坛| 瓦房店市| 冕宁县| 株洲市| 精河县| 郯城县| 承德县| 临海市| 乳山市| 禹州市| 武宣县| 耒阳市| 鹿泉市| 巴里| 霍山县| 凉城县| 武宁县| 抚松县| 分宜县| 蓬莱市| 牙克石市| 平原县| 九江市| 多伦县| 扎囊县| 永胜县| 凭祥市| 周宁县| 灵璧县| 西丰县| 合水县|