Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Javafx part on e4 RCP
Javafx part on e4 RCP [message #1748674] Sat, 26 November 2016 14:43 Go to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
Hi,

I want to develop an Eclipse 4 RCP with only one editor built on javafx.

I tried the http://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4 to check that I succeed to run javafx on eclipse 4. It works.
I tried to create a pure E4 application without javafx. It works.

I added in the part code the following :

    private Scene createScene() {
        Group group = new Group();
        Scene scene = new Scene(group);
        Button button = new Button("JFX Button");
        group.getChildren().add(button);
        return scene;
    }

	@PostConstruct
	public void createComposite(Composite parent) {
		parent.setLayout(new FillLayout());

		FXCanvas canvas = new FXCanvas(parent, SWT.NONE);

		Scene scene = createScene();
        canvas.setScene(scene);
	}


and tried to run the product :

!ENTRY org.eclipse.e4.ui.workbench 4 0 2016-11-26 15:21:13.096
!MESSAGE Unable to create class 'test.parts.SamplePart' from bundle '120'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javafx/scene/Parent


I tried to include jfxrt in the build path with no success.
I tried multiple Target Platform with no success.

Where am i wrong?

In case it can be useful, here is my MANIFEST file :

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: Test;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: javax.inject;bundle-version="0.0.0",
 org.eclipse.core.runtime;bundle-version="0.0.0",
 org.eclipse.swt;bundle-version="0.0.0",
 org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0",
 org.eclipse.jface;bundle-version="0.0.0",
 org.eclipse.e4.ui.services;bundle-version="0.0.0",
 org.eclipse.e4.ui.workbench;bundle-version="0.0.0",
 org.eclipse.e4.core.di;bundle-version="0.0.0",
 org.eclipse.e4.ui.di;bundle-version="0.0.0",
 org.eclipse.e4.core.contexts;bundle-version="0.0.0",
 org.eclipse.fx.javafx;bundle-version="2.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 


Thx

Franc'
Re: Javafx part on e4 RCP [message #1748715 is a reply to message #1748674] Sun, 27 November 2016 18:51 Go to previous messageGo to next message
Dieter Engelhardt is currently offline Dieter EngelhardtFriend
Messages: 18
Registered: June 2016
Junior Member
Did you add -Dorg.osgi.framework.bundle.parent=ext to your VM-Aguments?
Re: Javafx part on e4 RCP [message #1748804 is a reply to message #1748715] Mon, 28 November 2016 19:27 Go to previous messageGo to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
Adding -Dorg.osgi.framework.bundle.parent=ext to VM arguments did not change anything but after some research following parameter make it work:

-Dosgi.framework.extensions=org.eclipse.fx.osgi
Re: Javafx part on e4 RCP [message #1748832 is a reply to message #1748804] Tue, 29 November 2016 08:15 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2452
Registered: July 2012
Senior Member
-Dosgi.framework.extensions=org.eclipse.fx.osgi is used in e(fx)clipse 1.x

-Dorg.osgi.framework.bundle.parent=ext is for e(fx)clipse 2.x

So it depends on which version of e(fx)clipse you are using.
Re: Javafx part on e4 RCP [message #1748889 is a reply to message #1748674] Tue, 29 November 2016 19:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
No Dirk if you embed yourself into an e4 swt application this is still needed the reason is that we need to load the swtfx.jar dynamically Smile
Re: Javafx part on e4 RCP [message #1748891 is a reply to message #1748674] Tue, 29 November 2016 19:41 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
You contradict yourself because the tutorial you reference talks about the a pure e4 on javafx app but your code shows swt so I'm not sure what you want to create
- e4 on swt and embed some javafx
- a pure modern e4 on javafx

app
Re: Javafx part on e4 RCP [message #1748894 is a reply to message #1748891] Tue, 29 November 2016 20:13 Go to previous messageGo to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
"I want to develop an Eclipse 4 RCP with only one editor built on javafx."
--> e4 on swt and embed some javafx

I just said that before embedding javafx into e4 on swt, I tried both :
- a pure modern e4 on javafx (from your tutorial)
- a pure swt e4
to check my environment (java 8 + e(fx)clipse etc.)

I do not fully understand how it works right know but I will with practice.

Thanks for your support.
Re: Javafx part on e4 RCP [message #1748897 is a reply to message #1748894] Tue, 29 November 2016 20:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
Ok if you start from scratch why do you mix swt and javafx. What is the reason you want to use swt? If you don't have any legacy code I'd go pure SWT or pure JavaFX but not mix both if not absolutely needed
Re: Javafx part on e4 RCP [message #1748919 is a reply to message #1748889] Wed, 30 November 2016 07:48 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2452
Registered: July 2012
Senior Member
Thomas Schindl wrote on Tue, 29 November 2016 20:37
No Dirk if you embed yourself into an e4 swt application this is still needed the reason is that we need to load the swtfx.jar dynamically Smile


Ah, good to know Smile

Then my old blog post is still valid: https://blog.codecentric.de/en/2015/04/add-javafx-controls-swt-eclipse-4-application-eclipse-rcp-cookbook/
Re: Javafx part on e4 RCP [message #1748923 is a reply to message #1748919] Wed, 30 November 2016 08:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
Right the only thing we don't require anymore is to add the javafx.* imports. The adapter-hook now works as a last resort lookup with the default class lookup fails.
Re: Javafx part on e4 RCP [message #1748958 is a reply to message #1748923] Wed, 30 November 2016 13:45 Go to previous messageGo to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
I did not go full javafx because I though that I would have to re-implement some views for things which already exists.

For example, when extending wizards etc.

Am I wrong?
Re: Javafx part on e4 RCP [message #1749001 is a reply to message #1748958] Wed, 30 November 2016 23:15 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
So do you have already swt code? If not then don't mix go swt or go javafx. What are the views available you want to reuse? Anyways don't mix toolkits Smile
Re: Javafx part on e4 RCP [message #1749021 is a reply to message #1749001] Thu, 01 December 2016 08:46 Go to previous messageGo to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
No I just start my project so I have no swt code.

I though that by switching to javafx renderer, I was going to limit the capabilities of the eclipse framework and would have to implement some ui which are already available.

For example, I saw that eclipse framework provides WizardDialog which can be extending.

So my question is, will it be more work to do a custom wizard from scratch in a swt based e4 application or in javafx?
Re: Javafx part on e4 RCP [message #1749022 is a reply to message #1749001] Thu, 01 December 2016 08:47 Go to previous messageGo to next message
Francois Trap is currently offline Francois TrapFriend
Messages: 6
Registered: November 2016
Junior Member
No I just start my project so I have no swt code.

I though that by switching to javafx renderer, I was going to limit the capabilities of the eclipse framework and would have to implement some ui which are already available.

For example, I saw that eclipse framework provides WizardDialog which can be extending.

So my question is, will it be more work to do a custom wizard from scratch in a swt based e4 application or in javafx?
Re: Javafx part on e4 RCP [message #1749263 is a reply to message #1749022] Sun, 04 December 2016 21:18 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6347
Registered: July 2009
Senior Member
Right e(fx)clipse does not yet have a wizard dialog but there are other javafx libs could just include - e.g. http://controlsfx.bitbucket.org/org/controlsfx/dialog/Wizard.html
Previous Topic:Change Update URL at runtime
Next Topic:Is it possible to drag a window/view out of workbench if the application is written in JavaFX?
Goto Forum:
  


Current Time: Fri Aug 18 05:42:38 GMT 2017

Powered by FUDForum. Page generated in 0.05656 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software