Author: mareshkau
Date: 2008-01-21 06:55:05 -0500 (Mon, 21 Jan 2008)
New Revision: 5825
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1479, comments from Snjezana Peco was adjusted
for VpeController.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-01-21
11:26:17 UTC (rev 5824)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-01-21
11:55:05 UTC (rev 5825)
@@ -54,6 +54,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -331,6 +332,17 @@
//FIX Fox JBIDE-1479 added by Max Areshkau
public void notifyChanged(final INodeNotifier notifier, final int eventType,final
Object feature,final Object oldValue,final Object newValue, final int pos) {
+ //start job when we modify file in ui thread, without this code
+ //changes will be applied with 1 second delay
+ Display display = null;
+ if (PlatformUI.isWorkbenchRunning())
+ display= PlatformUI.getWorkbench().getDisplay();
+
+ if (display != null && (Thread.currentThread() == display.getThread()))
{
+ notifyChangedInUiThread(notifier, eventType, feature, oldValue, newValue, pos);
+ return;
+ }
+ //start job when we modify file in non ui thread
if(job!=null) {
job.cancel();
}