trouble restarting e4+javafx application [message #1717998] |
Fri, 18 December 2015 08:26  |
Eclipse User |
|
|
|
Hello everyone,
So I'm working on this project and I'm trying to add p2 update functionnality to an e4+javafx application. Everything works fine until the part where I need to restart my application to reflect the changes made to the application model. The application closes, and then simply doesn't restart.
I was able to link this issue to something (no idea what exactly) related to the tycho/maven I used to build my application. See, when I use the eclipse PDE build for the export, everything works fine, I'm able to restart a dummy sample app. I simply add a Main Menu the application model, then a Menu (named File) > then a handled MenuItem (named Restart), handled by some RestartHandler.java class looking like this
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.workbench.IWorkbench;
public class RestartHandler {
@Execute
public void execute(IWorkbench workbench) {
workbench.restart();
}
}
but the the same dummy app when generated by the tycho build will simply close and won't restart. I'm I missing something here? Any suggestions?
|
|
|
|
Re: trouble restarting e4+javafx application [message #1718000 is a reply to message #1717998] |
Fri, 18 December 2015 08:40   |
Eclipse User |
|
|
|
So when you export via tycho, how do you launch it? Via java -jar? Using
the javafx-packager generated .exe?
Tom
On 18.12.15 14:26, Paul Mira wrote:
> Hello everyone,
> So I'm working on this project and I'm trying to add p2 update
> functionnality to an e4+javafx application. Everything works fine until
> the part where I need to restart my application to reflect the changes
> made to the application model. The application closes, and then simply
> doesn't restart.
> I was able to link this issue to something (no idea what exactly)
> related to the tycho/maven I used to build my application. See, when I
> use the eclipse PDE build for the export, everything works fine, I'm
> able to restart a dummy sample app. I simply add a Main Menu the
> application model, then a Menu (named File) > then a handled MenuItem
> (named Restart), handled by some RestartHandler.java class looking like
> this
> import org.eclipse.e4.core.di.annotations.Execute;
> import org.eclipse.e4.ui.workbench.IWorkbench;
> public class RestartHandler {
> @Execute
> public void execute(IWorkbench workbench) {
> workbench.restart();
> }
> }
> but the the same dummy app when generated by the tycho build will simply
> close and won't restart. I'm I missing something here? Any suggestions?
|
|
|
|
|
|
|
Re: trouble restarting e4+javafx application [message #1718148 is a reply to message #1718061] |
Sun, 20 December 2015 13:37  |
Eclipse User |
|
|
|
Right now the exe it the one from Eclipse, which works fine on windows
but fails on OS-X because JavaFX does not get a hand on the event loop.
Tom
On 18.12.15 19:50, Paul Mira wrote:
> So thanks again everyone, I got a hunch from this Tom's advice Quote:
>> If you are targeting Linux & Windows just check the include native
>> launcher artifacts, fix the p2-repos in your tycho build to include
>> those natives, fix the platform-section and run tycho.
>
>
> which he gave here : https://www.eclipse.org/forums/index.php/t/1000801/
>
> so what I did precisely (for anyone interested) is configure my parent
> pom.xml (in the releng project) and changed the
> target-platform-configuration related plugin. So I replaced this
> <environments>
> <environment>
> <os>noenv</os>
> <ws>noenv</ws>
> <arch>noenv</arch>
> </environment>
> </environments>
> with this <environments>
> <environment>
> <os>win32</os>
> <ws>win32</ws>
> <arch>x86_64</arch>
> </environment>
> </environments>
> Then I did the same in the build.xml ant file (also in the releng
> project) and replaced /noenv/noenv/noenv by /win32/win32/x86_64 in the
> values of eclipse-app-dir property and equinox-launcher dir.
>
> Then I checked "The product includes native launcher artifacts" in the
> product config file.
> The tycho built app restarts just fine now.
> So now I guess my app uses "native launchers", and can't be used on a
> different system. Suits me fine at this point, but I think there should
> be a more multi-system solution to this.
|
|
|
Powered by
FUDForum. Page generated in 0.07472 seconds