Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Efxclipse/Tutorials/Tutorial2"
(→Create an Eclipse ViewPart) |
(→Create an Eclipse ViewPart) |
||
Line 4: | Line 4: | ||
<ol> | <ol> | ||
+ | <li>Setup a target platform | ||
+ | <ol> | ||
+ | <li>On first page select "Default: Default target for running platform"</li> | ||
+ | <li>Click on "Add..." and select "Software Site"</li> | ||
+ | <li>Point to the p2 repository at http://download.eclipse.org/efxclipse/runtime-nightly/site/</li> | ||
+ | <li>Expand the "FX Target" entry and select "RCP 3.x Target Platform Feature"</li> | ||
+ | <li><b>UNCHECK</b> "Include Required software"</li> | ||
+ | </ol></li> | ||
<li>File > New > Project ... <br /> | <li>File > New > Project ... <br /> | ||
[[Image:efxclipse_tut2_1.png]] | [[Image:efxclipse_tut2_1.png]] |
Revision as of 18:56, 19 November 2013
Create an Eclipse ViewPart
JavaFX allows you to embed JavaFX scenes into SWT UIs using the FXCanvas class. The following tutorial will guide you through the creation of a JavaFX-enabled ViewPart.
- Setup a target platform
- On first page select "Default: Default target for running platform"
- Click on "Add..." and select "Software Site"
- Point to the p2 repository at http://download.eclipse.org/efxclipse/runtime-nightly/site/
- Expand the "FX Target" entry and select "RCP 3.x Target Platform Feature"
- UNCHECK "Include Required software"
- File > New > Project ...
- Select "Plug-in Project" and click the "Next" button.
- Enter a project name and click the "Next" button.
- Make sure that "This plug-in will make contributions to the UI" is checked and deselect the RCP creation. Click "Next".
- Select the "JavaFX Eclipse 3.x ViewPart" template and click "Next".
- Keep the default settings and click "Finish".
- The result of the wizard is a new OSGi bundle with your ViewPart class.
- Implement your view by adding some JavaFX code to your ViewPart class.
- Launch an "inner Eclipse" by bringing up the context menu on your project and select Run As > Eclipse Application
- In the running application, bring up Quick Access (Ctrl+3) and enter "My Fx View". Select the presented choice to open your view.
- A view with your JavaFX content will be shown at the bottom.