Author: scabanovich
Date: 2009-12-18 11:24:22 -0500 (Fri, 18 Dec 2009)
New Revision: 19467
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5446
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2009-12-18
16:10:52 UTC (rev 19466)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2009-12-18
16:24:22 UTC (rev 19467)
@@ -41,6 +41,8 @@
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.part.MultiPageEditorSite;
import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.IDocumentProviderExtension;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
@@ -811,6 +813,25 @@
IFile file = ((IFileEditorInput)input).getFile();
if(file.isSynchronized(IResource.DEPTH_ZERO)) return;
f.updateChildFile(o, file.getLocation().toFile());
+ if(textEditor instanceof ITextEditor) {
+ IDocumentProvider provider = ((ITextEditor)textEditor).getDocumentProvider();
+ if(provider instanceof IDocumentProviderExtension) {
+ IDocumentProviderExtension extension= (IDocumentProviderExtension) provider;
+ try {
+ extension.synchronize(input);
+ } catch (CoreException e) {
+ ModelUIPlugin.getDefault().logError(e);
+ }
+ }
+ } else {
+ try {
+ file.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ } catch (CoreException e) {
+ ModelUIPlugin.getDefault().logError(e);
+ }
+ }
+ f.setModified(false);
+ firePropertyChange(ITextEditor.PROP_DIRTY);
}
}