Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 229570 Details for
Bug 405356
[Workbench] Auto-save not re-enabled when preference set from 0 to X
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
A patch
0001-Bug-405356.patch (text/plain), 5.04 KB, created by
Snjezana Peco
on 2013-04-10 11:36:23 EDT
(
hide
)
Description:
A patch
Filename:
MIME Type:
Creator:
Snjezana Peco
Created:
2013-04-10 11:36:23 EDT
Size:
5.04 KB
patch
obsolete
>From aa58904a8b201f7e1b3445ab3cb452c9b16fe83a Mon Sep 17 00:00:00 2001 >From: Snjezana Peco <snjezana.peco@redhat.com> >Date: Wed, 10 Apr 2013 17:24:12 +0200 >Subject: [PATCH] Bug 405356 > >--- > .../eclipse/ui/internal/IPreferenceConstants.java | 2 + > .../org/eclipse/ui/internal/Workbench.java | 59 ++++++++++++++++------ > .../internal/WorkbenchPreferenceInitializer.java | 4 +- > 3 files changed, 47 insertions(+), 18 deletions(-) > >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java >index 2d40a81..0b0ff91 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java >@@ -246,4 +246,6 @@ public interface IPreferenceConstants { > */ > public static final String WORKBENCH_SAVE_INTERVAL = "WORKBENCH_SAVE_INTERVAL"; //$NON-NLS-1$ > >+ public static final int DEFAULT_WORBENCH_SAVE_INTERVAL = 120000; >+ > } >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 b1b66a5..15818f5 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 >@@ -441,6 +441,8 @@ public final class Workbench extends EventManager implements IWorkbench { > > private Job autoSaveJob; > >+ private boolean autoSaveRunning = true; >+ > /** > * Creates a new workbench. > * >@@ -1034,6 +1036,7 @@ public final class Workbench extends EventManager implements IWorkbench { > if(autoSaveJob != null) { > autoSaveJob.cancel(); > autoSaveJob = null; >+ autoSaveRunning = false; > } > > boolean closeEditors = !force >@@ -2677,24 +2680,48 @@ UIEvents.Context.TOPIC_CONTEXT, > }; > e4Context.set(PartRenderingEngine.EARLY_STARTUP_HOOK, earlyStartup); > // start workspace auto-save >- final int millisecondInterval = getAutoSaveJobTime(); >- if (millisecondInterval > 0) { >- autoSaveJob = new WorkbenchJob("Workbench Auto-Save Job") { //$NON-NLS-1$ >- @Override >- public IStatus runInUIThread(IProgressMonitor monitor) { >- final int nextDelay = getAutoSaveJobTime(); >- persist(false); >- monitor.done(); >- // repeat >- if (nextDelay > 0) { >- this.schedule(nextDelay); >+ Thread autoSaveThread = new Thread(new Runnable() { >+ >+ public void run() { >+ while (autoSaveRunning) { >+ if (autoSaveJob != null) { >+ autoSaveJob.cancel(); >+ } >+ final int millisecondInterval = getAutoSaveJobTime(); >+ if (millisecondInterval > 0) { >+ autoSaveJob = new WorkbenchJob("Workbench Auto-Save Job") { //$NON-NLS-1$ >+ @Override >+ public IStatus runInUIThread(IProgressMonitor monitor) { >+ persist(false); >+ monitor.done(); >+ return Status.OK_STATUS; >+ } >+ }; >+ autoSaveJob.setSystem(true); >+ try { >+ Thread.sleep(millisecondInterval); >+ } catch (InterruptedException e) { >+ String msg = "Exception in Workbench.runUI"; //$NON-NLS-1$ >+ WorkbenchPlugin.log(msg, new Status(IStatus.INFO, >+ WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); >+ } >+ autoSaveJob.schedule(); >+ >+ } else { >+ try { >+ Thread.sleep(IPreferenceConstants.DEFAULT_WORBENCH_SAVE_INTERVAL); >+ } catch (InterruptedException e) { >+ String msg = "Exception in Workbench.runUI"; //$NON-NLS-1$ >+ WorkbenchPlugin.log(msg, new Status(IStatus.INFO, >+ WorkbenchPlugin.PI_WORKBENCH, 1, msg, e)); >+ } > } >- return Status.OK_STATUS; >+ > } >- }; >- autoSaveJob.setSystem(true); >- autoSaveJob.schedule(millisecondInterval); >- } >+ } >+ }, "Workbench Auto-Save Thread"); //$NON-NLS-1$ >+ >+ autoSaveThread.start(); > > // WWinPluginAction.refreshActionList(); > >diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java >index 031b4f8..9ae7216 100644 >--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java >+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java >@@ -65,8 +65,8 @@ public class WorkbenchPreferenceInitializer extends > // node. It works because the default-default is false. > node.putBoolean(IWorkbenchPreferenceConstants.DISABLE_OPEN_EDITOR_IN_PLACE, false); > >- // 5 minute workbench save interval >- node.putInt(IPreferenceConstants.WORKBENCH_SAVE_INTERVAL, 5); >+ // 0 minute workbench save interval >+ node.putInt(IPreferenceConstants.WORKBENCH_SAVE_INTERVAL, 0); > > node.putBoolean(IPreferenceConstants.USE_IPERSISTABLE_EDITORS, true); > >-- >1.8.1.msysgit.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 405356
: 229570