Using JavaFX 2.0 in an Eclipse view [message #781628] |
Sat, 21 January 2012 16:24  |
Eclipse User |
|
|
|
Hello,
my goal is to create a simple Eclipse view with some graphics in it
(imagine a simple UML diagram) using JavaFx 2.0. I'm using Eclipse 3.6
and Java 1.6.
First I created a plugin project with a view from the Eclipse examples.
Then I modified the SampleViev.createPartControl(Composite parent)
of the generated view class to look like this:
public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.EMBEDDED);
FXCanvas fxPanel = new FXCanvas(composite.getShell(), SWT.NONE);
Group group = new Group();
Scene scene = new Scene(group);
Button button = new Button("JFX Button");
group.getChildren().add(button);
fxPanel.setScene(scene);
}
I did manage to set the build path to be able to compile this, but didn't
manage to make it run. I just can't figure out how to set up the runtime
classpath. The assumption is that the user has JavaFX 2.0 installed, so I wouldn't
like to include the JavaFX libs into the plugin, I just want to use what is
already there on the users box.
Could you please advise on how to set up my plugin to use the already
existing JavaFX installation? Or am I going in the wrong direction, and
I should incorporate the JavaFX library into my plugin (if yes then how)?
Thanks.
|
|
|
Re: Using JavaFX 2.0 in an Eclipse view [message #781798 is a reply to message #781628] |
Sun, 22 January 2012 04:39   |
Eclipse User |
|
|
|
Hi,
Well you need to make yourself familiar with OSGi - modifying the build
path is not an option!
You have 3 possibilities:
a) bundle the fx-libraries with your plugin and adjust your MANIFEST.MF
b) repackage them and add a dependency
c) enhance the OSGi classloader to locate the libs on the filesystem
Now haveing told you those technical things I could simply pointed you
to http://www.efxclipse.org/ which provides you solution c) and
hopefully soon b) as well. It currently has set the lowest version to
3.7.0. Is there a reason it must run on 3.6.0?
Tom
Am 21.01.12 22:24, schrieb Balint Torok:
> Hello,
>
> my goal is to create a simple Eclipse view with some graphics in it
> (imagine a simple UML diagram) using JavaFx 2.0. I'm using Eclipse 3.6
> and Java 1.6.
>
> First I created a plugin project with a view from the Eclipse examples.
> Then I modified the SampleViev.createPartControl(Composite parent)
> of the generated view class to look like this:
>
>
> public void createPartControl(Composite parent) {
> Composite composite = new Composite(parent, SWT.EMBEDDED);
> FXCanvas fxPanel = new FXCanvas(composite.getShell(),
> SWT.NONE); Group group = new Group();
> Scene scene = new Scene(group);
> Button button = new Button("JFX Button");
> group.getChildren().add(button);
> fxPanel.setScene(scene);
> }
>
>
> I did manage to set the build path to be able to compile this, but didn't
> manage to make it run. I just can't figure out how to set up the runtime
> classpath. The assumption is that the user has JavaFX 2.0 installed, so
> I wouldn't
> like to include the JavaFX libs into the plugin, I just want to use what is
> already there on the users box.
>
> Could you please advise on how to set up my plugin to use the already
> existing JavaFX installation? Or am I going in the wrong direction, and
> I should incorporate the JavaFX library into my plugin (if yes then how)?
>
> Thanks.
|
|
|
|
|
|
|
|
|
Re: Using JavaFX 2.0 in an Eclipse view [message #788126 is a reply to message #782735] |
Wed, 01 February 2012 06:30  |
Eclipse User |
|
|
|
I've released 0.0.12 but it looks like its not working on 3.6 because I
need to get access to the classloader of the SWT-Bundle to use the
SWT-Integration and this API is new to 3.7.
One could get it to work probably using the Swing-AWT-Bridge because
there one does not need to the SWT-Bundle-Classloader.
If you need a solution soon I can only offer you to contract me for some
hours (~ 4 hours) to implement it and release an intermediate update-site.
Tom
Am 24.01.12 11:22, schrieb Balint Torok:
> Marvelous. I can hardly wait for it :)
>
> Thanks Tom
>
> Kind Regards Balint
|
|
|
Powered by
FUDForum. Page generated in 1.11739 seconds