summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorTom Schindl2013-03-11 11:56:03 (EDT)
committer Tom Schindl2013-03-11 12:05:28 (EDT)
commitd06f17d3dcea09095473d9916c4949537348b12c (patch)
treedfbd0e89bb08daf46f8e66c574e2783fb0ac566c
parentc7f1a7ce62f232ff968efcb7e0180d19e9a41eca (diff)
downloadeclipse.platform.ui-d06f17d3dcea09095473d9916c4949537348b12c.zip
eclipse.platform.ui-d06f17d3dcea09095473d9916c4949537348b12c.tar.gz
eclipse.platform.ui-d06f17d3dcea09095473d9916c4949537348b12c.tar.bz2
Bug 391186 - Add restart() to IWorkbenchrefs/changes/55/11055/2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java5
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java14
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java7
3 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
index b4019df..fb37281 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
@@ -169,6 +169,11 @@ public class E4Application implements IApplication {
}
saveModel();
workbench.close();
+
+ if (workbench.isRestart()) {
+ return EXIT_RESTART;
+ }
+
return EXIT_OK;
} finally {
if (display != null)
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
index a412d4a..0555eea 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
@@ -80,6 +80,8 @@ public class E4Workbench implements IWorkbench {
MApplication appModel = null;
private UIEventPublisher uiEventPublisher;
+ private boolean restart;
+
/**
* @return the {@link IEclipseContext} for the main application
*/
@@ -185,6 +187,18 @@ public class E4Workbench implements IWorkbench {
return true;
}
+ public boolean restart() {
+ this.restart = true;
+ return close();
+ }
+
+ /**
+ * @return <code>true</code> when the workbench should be restarted
+ */
+ public boolean isRestart() {
+ return restart;
+ }
+
/**
* @return a context that can be used to lookup OSGi services
*/
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java
index b5c538a..31bb85f 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/workbench/IWorkbench.java
@@ -103,4 +103,11 @@ public interface IWorkbench {
*/
public String getId();
+ /**
+ * restart the workbench
+ *
+ * @return <code>false</code> if the restart is aborted
+ */
+ public boolean restart();
+
}