Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2015-10-27 11:22:53 +0000
committerBrian de Alwis2015-10-27 11:22:53 +0000
commitb8f2b42b006e867f71838f223807b198db716967 (patch)
treee4dae3bbdb75e422265d209552ba8dbd7e587868
parent0f1063e7a18523b7e695bbfa338533eb8bada726 (diff)
downloadeclipse.platform.ui-b8f2b42b006e867f71838f223807b198db716967.tar.gz
eclipse.platform.ui-b8f2b42b006e867f71838f223807b198db716967.tar.xz
eclipse.platform.ui-b8f2b42b006e867f71838f223807b198db716967.zip
Revert "Bug 413952 - Updating workbench context by WorkbenchConfigurer added"I20151027-0800
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java9
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java2
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java19
3 files changed, 15 insertions, 15 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
index 6a30ddb1c98..48415ab7891 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
@@ -86,12 +86,9 @@ public class ResourceHandler implements IModelResourceHandler {
*
*/
final private boolean deltaRestore;
+ final private boolean saveAndRestore;
final private boolean clearPersistedState;
- @Inject
- @Named(IWorkbench.PERSIST_STATE)
- private boolean saveAndRestore;
-
/**
* Constructor.
*
@@ -100,8 +97,10 @@ public class ResourceHandler implements IModelResourceHandler {
* @param deltaRestore
*/
@Inject
- public ResourceHandler(@Named(IWorkbench.CLEAR_PERSISTED_STATE) boolean clearPersistedState,
+ public ResourceHandler(@Named(IWorkbench.PERSIST_STATE) boolean saveAndRestore,
+ @Named(IWorkbench.CLEAR_PERSISTED_STATE) boolean clearPersistedState,
@Named(E4Workbench.DELTA_RESTORE) boolean deltaRestore) {
+ this.saveAndRestore = saveAndRestore;
this.clearPersistedState = clearPersistedState;
this.deltaRestore = deltaRestore;
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
index d26536ca576..6036d306005 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
@@ -3177,7 +3177,7 @@ UIEvents.Context.TOPIC_CONTEXT,
/* package */
WorkbenchConfigurer getWorkbenchConfigurer() {
if (workbenchConfigurer == null) {
- workbenchConfigurer = ContextInjectionFactory.make(WorkbenchConfigurer.class, e4Context);
+ workbenchConfigurer = new WorkbenchConfigurer();
}
return workbenchConfigurer;
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
index 648a8b4ab7f..e07dc53aad5 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchConfigurer.java
@@ -12,10 +12,8 @@ package org.eclipse.ui.internal;
import java.util.HashMap;
import java.util.Map;
-import javax.inject.Inject;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.WindowManager;
import org.eclipse.ui.IMemento;
@@ -49,6 +47,12 @@ public final class WorkbenchConfigurer implements IWorkbenchConfigurer {
private Map extraData = new HashMap();
/**
+ * Indicates whether workbench state should be saved on close and
+ * restored on subsequent open.
+ */
+ private boolean saveAndRestore = false;
+
+ /**
* Indicates whether the workbench is being force to close. During
* an emergency close, no interaction with the user should be done.
*/
@@ -64,9 +68,6 @@ public final class WorkbenchConfigurer implements IWorkbenchConfigurer {
*/
private boolean exitOnLastWindowClose = true;
- @Inject
- private IEclipseContext e4Context;
-
/**
* Creates a new workbench configurer.
* <p>
@@ -74,7 +75,7 @@ public final class WorkbenchConfigurer implements IWorkbenchConfigurer {
* only via {@link WorkbenchAdvisor#initialize WorkbenchAdvisor.initialize}
* </p>
*/
- /* package */ WorkbenchConfigurer() {
+ /* package */WorkbenchConfigurer() {
super();
}
@@ -109,13 +110,13 @@ public final class WorkbenchConfigurer implements IWorkbenchConfigurer {
@Override
public boolean getSaveAndRestore() {
- return (boolean) e4Context.get(org.eclipse.e4.ui.workbench.IWorkbench.PERSIST_STATE);
+ return saveAndRestore;
}
@Override
public void setSaveAndRestore(boolean enabled) {
- e4Context.set(org.eclipse.e4.ui.workbench.IWorkbench.PERSIST_STATE, enabled);
- }
+ saveAndRestore = enabled;
+ }
@Override
public Object getData(String key) {

Back to the top