Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2007-11-15 15:01:34 +0000
committerDani Megert2007-11-15 15:01:34 +0000
commit29311ab441d67b124521274e86cf9881f2456c02 (patch)
tree2c74f634b27cffe8ca28c50642587435e9d38da9
parent2a72f45fb7425f07fe595a0210ff07497116e264 (diff)
downloadeclipse.platform.text-R3_3_maintenance.tar.gz
eclipse.platform.text-R3_3_maintenance.tar.xz
eclipse.platform.text-R3_3_maintenance.zip
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 602a24842..59c27e9ce 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -345,15 +345,17 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
Runnable r= new Runnable() {
public void run() {
enableSanityChecking(true);
- if (isStateValidated && fValidator != null) {
- ISourceViewer viewer= fSourceViewer;
- if (viewer != null) {
- StyledText textWidget= viewer.getTextWidget();
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.removeVerifyListener(fValidator);
- fValidator= null;
- enableStateValidation(false);
+ if (isStateValidated) {
+ if (fValidator != null) {
+ ISourceViewer viewer= fSourceViewer;
+ if (viewer != null) {
+ StyledText textWidget= viewer.getTextWidget();
+ if (textWidget != null && !textWidget.isDisposed())
+ textWidget.removeVerifyListener(fValidator);
+ fValidator= null;
+ }
}
+ enableStateValidation(false);
} else if (!isStateValidated && fValidator == null) {
ISourceViewer viewer= fSourceViewer;
if (viewer != null) {
@@ -3786,8 +3788,9 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
*/
private void initializeSourceViewer(IEditorInput input) {
- IAnnotationModel model= getDocumentProvider().getAnnotationModel(input);
- IDocument document= getDocumentProvider().getDocument(input);
+ IDocumentProvider documentProvider= getDocumentProvider();
+ IAnnotationModel model= documentProvider.getAnnotationModel(input);
+ IDocument document= documentProvider.getDocument(input);
if (document != null) {
fSourceViewer.setDocument(document, model);
@@ -3796,8 +3799,12 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
if (fElementStateListener instanceof IElementStateListenerExtension) {
+ boolean isStateValidated= false;
+ if (documentProvider instanceof IDocumentProviderExtension)
+ isStateValidated= ((IDocumentProviderExtension)documentProvider).isStateValidated(input);
+
IElementStateListenerExtension extension= (IElementStateListenerExtension) fElementStateListener;
- extension.elementStateValidationChanged(input, false);
+ extension.elementStateValidationChanged(input, isStateValidated);
}
if (fInitialCaret == null)

Back to the top