Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-04-13 05:27:34 -0400
committerTom Schindl2013-04-13 05:27:34 -0400
commit6e22b184c222d77405d7cf575a0b646bc744e25f (patch)
tree2e78beac10f716ef03effe4ad14e2e8e9a9f941e /bundles/runtime/org.eclipse.fx.core
parent10b3f0298d777f8d994a3009f9484bc78d939d6b (diff)
downloadorg.eclipse.efxclipse-6e22b184c222d77405d7cf575a0b646bc744e25f.tar.gz
org.eclipse.efxclipse-6e22b184c222d77405d7cf575a0b646bc744e25f.tar.xz
org.eclipse.efxclipse-6e22b184c222d77405d7cf575a0b646bc744e25f.zip
initial checkin
Diffstat (limited to 'bundles/runtime/org.eclipse.fx.core')
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/.classpath7
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/.gitignore2
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/.project33
-rw-r--r--bundles/runtime/org.eclipse.fx.core/.settings/org.eclipse.jdt.core.prefs7
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF13
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/OSGI-INF/jlogger.xml7
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/OSGI-INF/l10n/bundle.properties3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/build.properties5
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/pom.xml34
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Callback.java15
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/JUtilLoggerFactory.java329
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Log.java27
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Logger.java255
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/LoggerFactory.java15
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/update/UpdateService.java71
15 files changed, 823 insertions, 0 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core/.classpath b/bundles/runtime/org.eclipse.fx.core/.classpath
new file mode 100755
index 000000000..b1dabee38
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/runtime/org.eclipse.fx.core/.gitignore b/bundles/runtime/org.eclipse.fx.core/.gitignore
new file mode 100755
index 000000000..4dc009173
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/.gitignore
@@ -0,0 +1,2 @@
+/target
+/bin
diff --git a/bundles/runtime/org.eclipse.fx.core/.project b/bundles/runtime/org.eclipse.fx.core/.project
new file mode 100755
index 000000000..37d3210a6
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/runtime/org.eclipse.fx.core/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f42de363a
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF
new file mode 100755
index 000000000..79e797d63
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.fx.core
+Bundle-Version: 0.8.1.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Import-Package: javax.inject;version="1.0.0"
+Export-Package: org.eclipse.fx.core,
+ org.eclipse.fx.core.log,
+ org.eclipse.fx.core.update
+Bundle-Vendor: %Bundle-Vendor
+Service-Component: OSGI-INF/jlogger.xml
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/runtime/org.eclipse.fx.core/OSGI-INF/jlogger.xml b/bundles/runtime/org.eclipse.fx.core/OSGI-INF/jlogger.xml
new file mode 100755
index 000000000..654c5999c
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/OSGI-INF/jlogger.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.core.jlogger">
+ <implementation class="org.eclipse.fx.core.log.JUtilLoggerFactory"/>
+ <service>
+ <provide interface="org.eclipse.fx.core.log.LoggerFactory"/>
+ </service>
+</scr:component>
diff --git a/bundles/runtime/org.eclipse.fx.core/OSGI-INF/l10n/bundle.properties b/bundles/runtime/org.eclipse.fx.core/OSGI-INF/l10n/bundle.properties
new file mode 100755
index 000000000..bc7dd5b3a
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.fx.core
+Bundle-Vendor = BestSolution.at
+Bundle-Name = Core (=none UI) components \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.core/build.properties b/bundles/runtime/org.eclipse.fx.core/build.properties
new file mode 100755
index 000000000..4ab6e2638
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/build.properties
@@ -0,0 +1,5 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
+source.. = src/
diff --git a/bundles/runtime/org.eclipse.fx.core/pom.xml b/bundles/runtime/org.eclipse.fx.core/pom.xml
new file mode 100755
index 000000000..33580096f
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/pom.xml
@@ -0,0 +1,34 @@
+<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>
+ <name>e(fx)clipse - Runtime - Core</name>
+ <groupId>org.eclipse.fx.runtime</groupId>
+ <artifactId>org.eclipse.fx.core</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.fx</groupId>
+ <artifactId>releng</artifactId>
+ <relativePath>../../../releng/org.eclipse.fx.releng/pom.xml</relativePath>
+ <version>0.8.1-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Callback.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Callback.java
new file mode 100755
index 000000000..ae1ced883
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/Callback.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core;
+
+public interface Callback<T> {
+ public void call(T value);
+}
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/JUtilLoggerFactory.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/JUtilLoggerFactory.java
new file mode 100755
index 000000000..3241b1e96
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/JUtilLoggerFactory.java
@@ -0,0 +1,329 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.log;
+
+import javax.inject.Provider;
+
+public class JUtilLoggerFactory implements LoggerFactory, Provider<LoggerFactory> {
+
+ @Override
+ public LoggerFactory get() {
+ return this;
+ }
+
+ @Override
+ public Logger createLogger(String name) {
+ return new LoggerImpl(name);
+ }
+
+ static class LoggerImpl implements Logger {
+ private java.util.logging.Logger logger;
+
+ private String name;
+
+ public LoggerImpl(String name) {
+ this.name = name;
+ }
+
+ private java.util.logging.Logger getLogger() {
+ if( logger == null ) {
+ logger = java.util.logging.Logger.getLogger(name);
+ }
+ return logger;
+ }
+
+ private static java.util.logging.Level toLogLevel(Level level) {
+ switch (level) {
+ case TRACE:
+ return java.util.logging.Level.FINEST;
+ case DEBUG:
+ return java.util.logging.Level.FINE;
+ case INFO:
+ return java.util.logging.Level.INFO;
+ case WARNING:
+ return java.util.logging.Level.WARNING;
+ case ERROR:
+ return java.util.logging.Level.SEVERE;
+ case FATAL:
+ return java.util.logging.Level.SEVERE;
+ default:
+ return java.util.logging.Level.SEVERE;
+ }
+ }
+
+ private void logInternal(Level level, String message, Throwable t) {
+
+ java.util.logging.Level jlevel = toLogLevel(level);
+
+ StackTraceElement frame = null;
+ StackTraceElement[] e = Thread.currentThread().getStackTrace();
+ if (e.length > 2) {
+ for (int i = 2; i < e.length; i++) {
+ if (getClass().getName().equals(e[i].getClassName())) {
+ continue;
+ }
+ else {
+ frame = e[i];
+ break;
+ }
+ }
+ }
+
+ if (t == null) {
+ if (frame != null) {
+ getLogger().logp(jlevel, frame.getClassName(), frame.getMethodName(), message);
+ }
+ else {
+ getLogger().log(jlevel, message);
+ }
+ } else {
+ if (frame != null) {
+ getLogger().logp(jlevel, frame.getClassName(), frame.getMethodName(), message, t);
+ }
+ else {
+ getLogger().log(jlevel, message, t);
+ }
+ }
+
+ }
+
+ @Override
+ public void log(Level level, String message) {
+ if (!isEnabled(level)) {
+ return;
+ }
+ logInternal(level, message, null);
+ }
+
+ @Override
+ public void logf(Level level, String pattern, Throwable t, Object... args) {
+ if (!isEnabled(level)) {
+ return;
+ }
+ logInternal(level, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void logf(Level level, String pattern, Object... args) {
+ if (!isEnabled(level)) {
+ return;
+ }
+ logInternal(level, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void log(Level level, String message, Throwable t) {
+ if (!isEnabled(level)) {
+ return;
+ }
+ logInternal(level, message, t);
+ }
+
+ @Override
+ public void trace(String message) {
+ if (!isEnabled(Level.TRACE)) {
+ return;
+ }
+ logInternal(Level.TRACE, message, null);
+ }
+
+ @Override
+ public void trace(String message, Throwable t) {
+ if (!isEnabled(Level.TRACE)) {
+ return;
+ }
+ logInternal(Level.TRACE, message, t);
+ }
+
+ @Override
+ public void debug(String message) {
+ if (!isEnabled(Level.DEBUG)) {
+ return;
+ }
+ logInternal(Level.DEBUG, message, null);
+ }
+
+ @Override
+ public void debug(String message, Throwable t) {
+ if (!isEnabled(Level.DEBUG)) {
+ return;
+ }
+ log(Level.DEBUG, message, t);
+ }
+
+ @Override
+ public void info(String message) {
+ if (!isEnabled(Level.INFO)) {
+ return;
+ }
+ logInternal(Level.INFO, message, null);
+ }
+
+
+ @Override
+ public void info(String message, Throwable t) {
+ if (!isEnabled(Level.INFO)) {
+ return;
+ }
+ logInternal(Level.INFO, message, t);
+ }
+
+ @Override
+ public void warning(String message) {
+ if (!isEnabled(Level.WARNING)) {
+ return;
+ }
+ logInternal(Level.WARNING, message, null);
+ }
+
+ @Override
+ public void warning(String message, Throwable t) {
+ if (!isEnabled(Level.WARNING)) {
+ return;
+ }
+ logInternal(Level.WARNING, message, t);
+ }
+
+ @Override
+ public void error(String message) {
+ if (!isEnabled(Level.ERROR)) {
+ return;
+ }
+ logInternal(Level.ERROR, message, null);
+ }
+
+
+ @Override
+ public void error(String message, Throwable t) {
+ if (!isEnabled(Level.ERROR)) {
+ return;
+ }
+ logInternal(Level.ERROR, message, t);
+ }
+
+ @Override
+ public void fatal(String message) {
+ if (!isEnabled(Level.FATAL)) {
+ return;
+ }
+ logInternal(Level.FATAL, message, null);
+ }
+
+ @Override
+ public void fatal(String message, Throwable t) {
+ if (!isEnabled(Level.FATAL)) {
+ return;
+ }
+ logInternal(Level.FATAL, message, t);
+ }
+
+ @Override
+ public void tracef(String pattern, Object... args) {
+ if (!isEnabled(Level.TRACE)) {
+ return;
+ }
+ logInternal(Level.TRACE, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void tracef(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.TRACE)) {
+ return;
+ }
+ logInternal(Level.TRACE, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void debugf(String pattern, Object... args) {
+ if (!isEnabled(Level.DEBUG)) {
+ return;
+ }
+ logInternal(Level.DEBUG, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void debugf(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.DEBUG)) {
+ return;
+ }
+ logInternal(Level.DEBUG, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void infof(String pattern, Object... args) {
+ if (!isEnabled(Level.INFO)) {
+ return;
+ }
+ logInternal(Level.INFO, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void infof(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.INFO)) {
+ return;
+ }
+ logInternal(Level.INFO, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void warningf(String pattern, Object... args) {
+ if (!isEnabled(Level.WARNING)) {
+ return;
+ }
+ logInternal(Level.WARNING, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void warningf(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.WARNING)) {
+ return;
+ }
+ logInternal(Level.WARNING, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void errorf(String pattern, Object... args) {
+ if (!isEnabled(Level.ERROR)) {
+ return;
+ }
+ logInternal(Level.ERROR, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void errorf(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.ERROR)) {
+ return;
+ }
+ logInternal(Level.ERROR, String.format(pattern, args), t);
+ }
+
+ @Override
+ public void fatalf(String pattern, Object... args) {
+ if (!isEnabled(Level.FATAL)) {
+ return;
+ }
+ logInternal(Level.FATAL, String.format(pattern, args), null);
+ }
+
+ @Override
+ public void fatalf(String pattern, Throwable t, Object... args) {
+ if (!isEnabled(Level.FATAL)) {
+ return;
+ }
+ logInternal(Level.FATAL, String.format(pattern, args), t);
+ }
+
+ @Override
+ public boolean isEnabled(Level level) {
+ return getLogger().isLoggable(toLogLevel(level));
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Log.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Log.java
new file mode 100755
index 000000000..fb14543c1
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Log.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.log;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Qualifier
+@Documented
+@Target({ElementType.FIELD, ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Log {
+ String value() default "";
+}
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Logger.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Logger.java
new file mode 100755
index 000000000..729a98c5c
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/Logger.java
@@ -0,0 +1,255 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ * Christoph Caks <ccaks@bestsolution.at> - initial API and documentation
+ *******************************************************************************/
+package org.eclipse.fx.core.log;
+
+public interface Logger {
+
+ /**
+ * logs a message in the specified log level.
+ * @param level the Log Level
+ * @param message the message
+ */
+ public void log(Level level, String message);
+ /**
+ * logs a message and an exception in the specified log level
+ * @param level the Log Level
+ * @param message the message
+ * @param t the Exception
+ */
+ public void log(Level level, String message, Throwable t);
+
+ /**
+ * logs a formatted message in the specified log level.
+ * <p>
+ * For formatting {@link String#format(String, Object...)} is used.
+ * The following two method calls yield the same result, but the
+ * logf call allows the underlying implementation to prevent the formatting
+ * if the log level is disabled.
+ * <code><br>
+ * logf(Level.TRACE, "%5.3f", num);<br>
+ * log(Level.TRACE, String.format("%5.3", num));
+ * </code>
+ * </p>
+ * @see String#format(String, Object...)
+ * @param level the Log Level
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void logf(Level level, String pattern, Object...args);
+ public void logf(Level level, String pattern, Throwable t, Object...args);
+
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#TRACE}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void trace(String message);
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#DEBUG}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void debug(String message);
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#INFO}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void info(String message);
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#WARNING}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void warning(String message);
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#ERROR}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void error(String message);
+ /**
+ * convenience method for {@link #log(Level, String)} with {@link Level#FATAL}.
+ * @see #log(Level, String)
+ * @param message the message
+ */
+ public void fatal(String message);
+
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#TRACE}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void trace(String message, Throwable t);
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#DEBUG}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void debug(String message, Throwable t);
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#INFO}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void info(String message, Throwable t);
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#WARNING}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void warning(String message, Throwable t);
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#ERROR}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void error(String message, Throwable t);
+ /**
+ * convenience method for {@link #log(Level, String, Throwable)} with {@link Level#FATAL}.
+ * @see #log(Level, String, Throwable)
+ * @param message the message
+ * @param t the Exception
+ */
+ public void fatal(String message, Throwable t);
+
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#TRACE}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void tracef(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#DEBUG}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void debugf(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#INFO}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void infof(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#WARNING}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void warningf(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#ERROR}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void errorf(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Object..)} with {@link Level#FATAL}.
+ * @see #logf(Level, String, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param args the message arguments
+ */
+ public void fatalf(String pattern, Object...args);
+
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#TRACE}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void tracef(String pattern, Throwable t, Object...args);
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#DEBUG}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void debugf(String pattern, Throwable t, Object...args);
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#INFO}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void infof(String pattern, Throwable t, Object...args);
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#WARNING}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void warningf(String pattern, Throwable t, Object...args);
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#ERROR}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void errorf(String pattern, Throwable t, Object...args);
+ /**
+ * convenience method for {@link #logf(Level, String, Throwable, Object..)} with {@link Level#FATAL}.
+ * @see #logf(Level, String, Throwable, Object..)
+ * @see String#format(String, Object...)
+ * @param pattern the message format
+ * @param t the Exception
+ * @param args the message arguments
+ */
+ public void fatalf(String pattern, Throwable t, Object...args);
+
+ /**
+ * checks whether the given log level is enabled for this logger.
+ * @param level the log level to check against
+ * @return true if the log level is enabled
+ */
+ public boolean isEnabled(Level level);
+
+ public enum Level {
+ TRACE,
+ DEBUG,
+ INFO,
+ WARNING,
+ ERROR,
+ FATAL
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/LoggerFactory.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/LoggerFactory.java
new file mode 100755
index 000000000..610ffca15
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/log/LoggerFactory.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2012 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.log;
+
+public interface LoggerFactory {
+ public Logger createLogger(String name);
+}
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/update/UpdateService.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/update/UpdateService.java
new file mode 100755
index 000000000..170eb0242
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/update/UpdateService.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.update;
+
+import org.eclipse.fx.core.Callback;
+
+public interface UpdateService {
+ public void update(UpdateCheckData data, Callback<UpdateData> callback);
+ public void checkUpdate(Callback<UpdateCheckData> callback);
+
+ public enum State {
+ ERROR,
+ WARNING,
+ CANCEL,
+ OK
+ }
+
+ public static class ReturnValueImpl<V> implements ReturnValue<V> {
+ public final State state;
+ public final String message;
+ public final Throwable throwable;
+ public final V value;
+
+ public ReturnValueImpl(State state, String message, V value, Throwable throwable) {
+ this.state = state;
+ this.message = message;
+ this.throwable = throwable;
+ this.value = value;
+ }
+
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ public Throwable getThrowable() {
+ return throwable;
+ }
+
+ public State getState() {
+ return state;
+ }
+
+ public V getValue() {
+ return value;
+ }
+ }
+
+ interface ReturnValue<V> {
+ public State getState();
+ public String getMessage();
+ public V getValue();
+ public Throwable getThrowable();
+ }
+
+ interface UpdateCheckData extends ReturnValue<Boolean> {
+
+ }
+
+ interface UpdateData extends ReturnValue<Boolean> {
+
+ }
+}

Back to the top