Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Java 17 and Maven libraries #1

Open
wants to merge 6 commits into
base: fx
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated to e(fx)clipse 3.6.0 and Java 11
  • Loading branch information
fipro78 committed Nov 15, 2019
commit 98784ee1fc39f20e782d97f14dea16667aea858e
8 changes: 8 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-pomless</artifactId>
<version>1.5.1</version>
</extension>
</extensions>
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# e4-cookbook-basic-recipe
The basic recipe of the Eclipse RCP cookbook extended for integrating JavaFX.

The blog post for the basic recipe can be found here: https://blog.codecentric.de/en/2015/02/eclipse-rcp-cookbook-basic-recipe/
The blog post for the basic recipe can be found here:\
https://blog.codecentric.de/en/2015/02/eclipse-rcp-cookbook-basic-recipe/

The blog post for the JavaFX integration can be found here: https://blog.codecentric.de/en/2015/04/add-javafx-controls-swt-eclipse-4-application-eclipse-rcp-cookbook/
The original blog post for the JavaFX integration can be found here:\
https://blog.codecentric.de/en/2015/04/add-javafx-controls-swt-eclipse-4-application-eclipse-rcp-cookbook/

The updated blog post for the current version of the JavaFX integration can be found here:\
http://blog.vogella.com/2019/11/15/add-javafx-controls-to-a-swt-eclipse-4-application-eclipse-rcp-cookbook-update/
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
import org.eclipse.swt.widgets.Text;
import org.fipro.eclipse.tutorial.inverter.helper.StringInverter;

import javafx.animation.ParallelTransition;
import javafx.animation.RotateTransition;
import javafx.animation.ScaleTransition;
import javafx.embed.swt.FXCanvas;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.util.Duration;

public class InverterPart {

@PostConstruct
Expand All @@ -36,22 +45,57 @@ public void postConstruct(Composite parent) {
outputLabel.setText("Inverted String:");
GridDataFactory.fillDefaults().applyTo(outputLabel);

final Text output = new Text(parent, SWT.READ_ONLY | SWT.WRAP);
GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(output);
// add FXCanvas for adding JavaFX controls to the UI
FXCanvas canvas = new FXCanvas(parent, SWT.NONE);
GridDataFactory
.fillDefaults()
.grab(true, true)
.span(3, 1)
.applyTo(canvas);

// create the root layout pane
BorderPane layout = new BorderPane();

// create a Scene instance
// set the layout container as root
// set the background fill to the background color of the shell
Scene scene = new Scene(layout, Color.rgb(
parent.getShell().getBackground().getRed(),
parent.getShell().getBackground().getGreen(),
parent.getShell().getBackground().getBlue()));

// set the Scene to the FXCanvas
canvas.setScene(scene);

javafx.scene.control.Label output = new javafx.scene.control.Label();
layout.setCenter(output);

RotateTransition rotateTransition = new RotateTransition(Duration.seconds(1), output);
rotateTransition.setByAngle(360);

ScaleTransition scaleTransition = new ScaleTransition(Duration.seconds(1), output);
scaleTransition.setFromX(1.0);
scaleTransition.setFromY(1.0);
scaleTransition.setToX(4.0);
scaleTransition.setToY(4.0);

ParallelTransition parallelTransition = new ParallelTransition(rotateTransition, scaleTransition);

button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
output.setText(StringInverter.invert(input.getText()));
parallelTransition.play();
}
});

input.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.CR
|| e.keyCode == SWT.KEYPAD_CR) {
output.setText(StringInverter.invert(input.getText()));
parallelTransition.play();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="E4 RCP Tutorial App" uid="org.fipro.eclipse.tutorial" id="org.fipro.eclipse.tutorial.app.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0" useFeatures="true" includeLaunchers="true">

<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-clearPersistedState
</programArgs>
<vmArgs>-Dosgi.framework.extensions=org.eclipse.fx.osgi
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>

<launcher>
<win useIco="false">
<bmp/>
</win>
</launcher>

<vm>
</vm>

<plugins>
</plugins>

<features>
<feature id="org.eclipse.e4.rcp"/>
<feature id="org.eclipse.emf.ecore"/>
<feature id="org.eclipse.emf.common"/>
<feature id="org.eclipse.fx.runtime.min.feature" installMode="root"/>
<feature id="org.fipro.eclipse.tutorial.feature" installMode="root"/>
<feature id="openjfx.media.feature" installMode="root"/>
<feature id="openjfx.standard.feature" installMode="root"/>
<feature id="openjfx.swing.feature" installMode="root"/>
<feature id="openjfx.swt.feature" installMode="root"/>
<feature id="openjfx.web.feature" installMode="root"/>
</features>

<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

</product>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<launcherArgs>
<programArgs>-clearPersistedState
</programArgs>
<vmArgs>-Dosgi.framework.extensions=org.eclipse.fx.osgi
</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>
Expand All @@ -29,16 +31,25 @@
<feature id="org.eclipse.e4.rcp"/>
<feature id="org.eclipse.emf.ecore"/>
<feature id="org.eclipse.emf.common"/>
<feature id="org.eclipse.fx.target.rcp4.feature" installMode="root"/>
<feature id="org.eclipse.equinox.p2.core.feature" installMode="root"/>
<feature id="org.eclipse.ecf.core.feature" installMode="root"/>
<feature id="org.eclipse.ecf.filetransfer.feature" installMode="root"/>
<feature id="org.eclipse.emf.edit" installMode="root"/>
<feature id="org.fipro.eclipse.tutorial.feature" installMode="root"/>
<feature id="openjfx.media.feature" installMode="root"/>
<feature id="openjfx.standard.feature" installMode="root"/>
<feature id="openjfx.swing.feature" installMode="root"/>
<feature id="openjfx.swt.feature" installMode="root"/>
<feature id="openjfx.web.feature" installMode="root"/>
</features>

<configurations>
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.p2.reconciler.dropins" autoStart="true" startLevel="0" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

</product>
</product>
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="E4 Cookbook Target Platform" sequenceNumber="1568034040">
<target name="E4 Cookbook Target Platform" sequenceNumber="1573476999">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.8.400.v20190515-0925"/>
<unit id="org.eclipse.sdk.feature.group" version="4.12.0.v20190605-1801"/>
<unit id="org.eclipse.equinox.p2.core.feature.feature.group" version="1.6.200.v20190516-1504"/>
<unit id="org.eclipse.emf.edit.feature.group" version="2.15.0.v20190528-0725"/>
<repository location="http://download.eclipse.org/releases/2019-06"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.fx.runtime.min.feature.feature.group" version="3.6.0.201907240103"/>
<unit id="org.eclipse.fx.target.rcp4.feature.feature.group" version="3.6.0.201907240201"/>
<repository location="http://download.eclipse.org/efxclipse/runtime-released/3.6.0/site"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="openjfx.media.feature.feature.group" version="11.0.0.201901231300"/>
<unit id="openjfx.standard.feature.feature.group" version="11.0.0.201901231300"/>
<unit id="openjfx.swing.feature.feature.group" version="11.0.0.201901231300"/>
<unit id="openjfx.swt.feature.feature.group" version="11.0.0.201901231300"/>
<unit id="openjfx.web.feature.feature.group" version="11.0.0.201901231300"/>
<repository location="http://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/"/>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ target "E4 Cookbook Target Platform"
with source requirements

location "http://download.eclipse.org/releases/2019-06" {
org.eclipse.equinox.executable.feature.group
org.eclipse.sdk.feature.group
org.eclipse.equinox.executable.feature.group
org.eclipse.sdk.feature.group
org.eclipse.equinox.p2.core.feature.feature.group
org.eclipse.emf.edit.feature.group
}

location "http://download.eclipse.org/efxclipse/runtime-released/3.6.0/site" {
org.eclipse.fx.runtime.min.feature.feature.group
org.eclipse.fx.target.rcp4.feature.feature.group
}

// only needed for Java 11 with OpenJFX 11
location "http://downloads.efxclipse.bestsolution.at/p2-repos/openjfx-11/repository/" {
openjfx.media.feature.feature.group
openjfx.standard.feature.feature.group
openjfx.swing.feature.feature.group
openjfx.swt.feature.feature.group
openjfx.web.feature.feature.group
}
121 changes: 121 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.fipro.eclipse.tutorial</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>

<packaging>pom</packaging>

<modules>
<module>org.fipro.eclipse.tutorial.target</module>
<module>org.fipro.eclipse.tutorial.inverter</module>
<module>org.fipro.eclipse.tutorial.app</module>
<module>org.fipro.eclipse.tutorial.feature</module>
<module>org.fipro.eclipse.tutorial.product</module>
</modules>

<properties>
<tycho-version>1.5.1</tycho-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>org.fipro.eclipse.tutorial</groupId>
<artifactId>org.fipro.eclipse.tutorial.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
</artifact>
</target>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<!-- Additional configuration to compile with Java 8 -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<encoding>UTF-8</encoding>
<extraClasspathElements>
<extraClasspathElement>
<groupId>com.oracle</groupId>
<artifactId>javafx</artifactId>
<version>8.0.0-SNAPSHOT</version>
<systemPath>${JAVA_HOME}/jre/lib/jfxswt.jar</systemPath>
<scope>system</scope>
</extraClasspathElement>
</extraClasspathElements>
</configuration>
</plugin>

<!-- Additional configuration to compile with Java 11 -->
<!--
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<encoding>UTF-8</encoding>
<extraClasspathElements>
<extraClasspathElement>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</extraClasspathElement>
<extraClasspathElement>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swt</artifactId>
<version>11.0.2</version>
<systemPath>${JAVAFX_HOME}/lib/javafx-swt.jar</systemPath>
<scope>system</scope>
</extraClasspathElement>
</extraClasspathElements>
</configuration>
</plugin>
-->

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>