Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-03-24 15:28:43 +0000
committerTom Schindl2014-03-24 15:28:43 +0000
commit995b5e3f5b0772a4728525dabdcfa7d5213a22b3 (patch)
treef558226ee71355ad208d7d34aad3a06a98fbca3a /bundles
parent60f272fec22a90b65f68e843269589998dde92be (diff)
downloadorg.eclipse.efxclipse-995b5e3f5b0772a4728525dabdcfa7d5213a22b3.tar.gz
org.eclipse.efxclipse-995b5e3f5b0772a4728525dabdcfa7d5213a22b3.tar.xz
org.eclipse.efxclipse-995b5e3f5b0772a4728525dabdcfa7d5213a22b3.zip
improved javadoc
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/runtime/org.eclipse.fx.osgi.util/.settings/org.eclipse.jdt.core.prefs2
-rwxr-xr-xbundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/AbstractJFXApplication.java73
2 files changed, 52 insertions, 23 deletions
diff --git a/bundles/runtime/org.eclipse.fx.osgi.util/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.osgi.util/.settings/org.eclipse.jdt.core.prefs
index 5671530f4..8d88004d6 100755
--- a/bundles/runtime/org.eclipse.fx.osgi.util/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/runtime/org.eclipse.fx.osgi.util/.settings/org.eclipse.jdt.core.prefs
@@ -50,7 +50,7 @@ org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
diff --git a/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/AbstractJFXApplication.java b/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/AbstractJFXApplication.java
index 3194f5f42..a33720236 100755
--- a/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/AbstractJFXApplication.java
+++ b/bundles/runtime/org.eclipse.fx.osgi.util/src/org/eclipse/fx/osgi/util/AbstractJFXApplication.java
@@ -19,6 +19,7 @@ import javafx.stage.Stage;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.fx.core.databinding.JFXRealm;
+import org.eclipse.jdt.annotation.NonNull;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
@@ -31,59 +32,65 @@ import org.osgi.service.event.EventAdmin;
*/
public abstract class AbstractJFXApplication implements IApplication {
static AbstractJFXApplication SELF;
-
+
IApplicationContext applicationContext;
Object returnValue;
EventAdmin eventAdmin;
-
+
/**
* Dummy class for bootstrap
*/
public static class JFXApp extends Application {
private AbstractJFXApplication osgiApp = SELF;
private IApplicationContext applicationContext;
-
+
@Override
public void start(final Stage primaryStage) throws Exception {
this.applicationContext = this.osgiApp.applicationContext;
-
+
JFXRealm.createDefault();
- this.osgiApp.jfxStart(this.applicationContext,JFXApp.this,primaryStage);
-
- if( this.osgiApp.eventAdmin != null ) {
+ this.osgiApp.jfxStart(this.applicationContext, JFXApp.this,
+ primaryStage);
+
+ if (this.osgiApp.eventAdmin != null) {
Map<String, Object> map = new HashMap<String, Object>();
-// map.put("name", value);
- this.osgiApp.eventAdmin.sendEvent(new Event("efxapp/applicationLaunched", map)); //$NON-NLS-1$
+ // map.put("name", value);
+ this.osgiApp.eventAdmin.sendEvent(new Event(
+ "efxapp/applicationLaunched", map)); //$NON-NLS-1$
}
}
-
+
@Override
public void stop() throws Exception {
super.stop();
this.osgiApp.returnValue = this.osgiApp.jfxStop();
}
}
-
+
@Override
public final Object start(IApplicationContext context) throws Exception {
SELF = this;
this.applicationContext = context;
this.applicationContext.applicationRunning();
-
+
Bundle b = FrameworkUtil.getBundle(AbstractJFXApplication.class);
BundleContext bundleContext = b.getBundleContext();
- ServiceReference<EventAdmin> ref = bundleContext.getServiceReference(EventAdmin.class);
- if( ref != null ) {
+ ServiceReference<EventAdmin> ref = bundleContext
+ .getServiceReference(EventAdmin.class);
+ if (ref != null) {
this.eventAdmin = bundleContext.getService(ref);
}
-
- // Looks like OS-X wants to have the context class loader to locate FX-Classes
- Thread.currentThread().setContextClassLoader(Application.class.getClassLoader());
-
+
+ // Looks like OS-X wants to have the context class loader to locate
+ // FX-Classes
+ Thread.currentThread().setContextClassLoader(
+ Application.class.getClassLoader());
+
Application.launch(JFXApp.class);
-
+
try {
- return this.returnValue == null ? IApplication.EXIT_OK : this.returnValue;
+ return this.returnValue == null ? IApplication.EXIT_OK
+ : this.returnValue;
} finally {
this.returnValue = null;
}
@@ -94,8 +101,30 @@ public abstract class AbstractJFXApplication implements IApplication {
// Nothing
}
- protected abstract void jfxStart(IApplicationContext applicationContext, Application jfxApplication, Stage primaryStage);
-
+ /**
+ * Method called when OSGi & JavaFX are fully initialized
+ * {@link Application#start(Stage)}
+ *
+ * @param applicationContext
+ * the application context
+ * @param jfxApplication
+ * the javafx application instance
+ * @param primaryStage
+ * @see IApplication#start(IApplicationContext)
+ * @see Application#start(Stage)
+ */
+ protected abstract void jfxStart(
+ @NonNull IApplicationContext applicationContext,
+ @NonNull Application jfxApplication, @NonNull Stage primaryStage);
+
+ /**
+ * Method called when the javafx application is shutdown
+ * {@link Application#stop()}
+ *
+ * @return the return status for the OSGi application see {@link IApplication#start(IApplicationContext)}
+ * @see IApplication#start(IApplicationContext)
+ * @see Application#stop()
+ */
@SuppressWarnings("static-method")
protected Object jfxStop() {
return IApplication.EXIT_OK;

Back to the top