public void setDocument(IDocument doc) { if (getDocument() instanceof IStructuredDocument) { RegionParser parser = ((IStructuredDocument) getDocument()).getParser(); if (parser instanceof StructuredDocumentRegionParser) { ((StructuredDocumentRegionParser) parser) .removeStructuredDocumentRegionHandler(fResetHandler); } } super.setDocument(doc); IReconcilingStrategy validatorStrategy = getValidatorStrategy(); if (validatorStrategy != null) { validatorStrategy.setDocument(doc); } if (fSemanticHighlightingStrategy != null) { fSemanticHighlightingStrategy.setDocument(doc); } fSpellcheckStrategy = null; if (fFoldingStrategy != null) { fFoldingStrategy.uninstall(); } fFoldingStrategy = null; if (getDocument() instanceof IStructuredDocument) { RegionParser parser = ((IStructuredDocument) doc).getParser(); if (parser instanceof StructuredDocumentRegionParser) { ((StructuredDocumentRegionParser) parser).addStructuredDocumentRegionHandler(fResetHandler); } } }
/** @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall() */ public void uninstall() { if (isInstalled()) { IReconcilingStrategy validatorStrategy = getValidatorStrategy(); if (validatorStrategy != null) { if (validatorStrategy instanceof IReleasable) ((IReleasable) validatorStrategy).release(); } if (fSpellcheckStrategy != null) { fSpellcheckStrategy.setDocument(null); fSpellcheckStrategy = null; } fReconcileListeners = new ISourceReconcilingListener[0]; if (getDocument() instanceof IStructuredDocument) { RegionParser parser = ((IStructuredDocument) getDocument()).getParser(); if (parser instanceof StructuredDocumentRegionParser) { ((StructuredDocumentRegionParser) parser) .removeStructuredDocumentRegionHandler(fResetHandler); } } } super.uninstall(); }
public void setDocument(IDocument doc) { super.setDocument(doc); IReconcilingStrategy validatorStrategy = getValidatorStrategy(); if (validatorStrategy != null) { validatorStrategy.setDocument(doc); } if (fSemanticHighlightingStrategy != null) { fSemanticHighlightingStrategy.setDocument(doc); } fSpellcheckStrategy = null; if (fFoldingStrategy != null) { fFoldingStrategy.uninstall(); } fFoldingStrategy = null; }
protected IReconcilingStrategy getSpellcheckStrategy() { if (fSpellcheckStrategy == null && getDocument() != null) { String contentTypeId = getContentType(getDocument()); if (contentTypeId == null) { contentTypeId = IContentTypeManager.CT_TEXT; } if (getTextViewer() instanceof ISourceViewer) { ISourceViewer viewer = (ISourceViewer) getTextViewer(); fSpellcheckStrategy = new SpellcheckStrategy(viewer, contentTypeId); fSpellcheckStrategy.setDocument(getDocument()); } } return fSpellcheckStrategy; }
/** @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall() */ public void uninstall() { if (isInstalled()) { IReconcilingStrategy validatorStrategy = getValidatorStrategy(); if (validatorStrategy != null) { if (validatorStrategy instanceof IReleasable) ((IReleasable) validatorStrategy).release(); } if (fSpellcheckStrategy != null) { fSpellcheckStrategy.setDocument(null); fSpellcheckStrategy = null; } fReconcileListeners = new ISourceReconcilingListener[0]; } super.uninstall(); }
protected void handleInputDocumentChanged(IDocument oldInput, IDocument newInput) { if (shouldInstallCompletionListener) { ContentAssistantFacade facade = ((ISourceViewerExtension4) textViewer).getContentAssistantFacade(); if (facade != null) { facade.addCompletionListener(documentListener); } shouldInstallCompletionListener = false; } if (oldInput instanceof IXtextDocument) { ((IXtextDocument) oldInput).removeXtextDocumentContentObserver(documentListener); } if (newInput instanceof IXtextDocument) { ((IXtextDocument) newInput).addXtextDocumentContentObserver(documentListener); final IXtextDocument document = XtextDocumentUtil.get(textViewer); strategy.setDocument(document); if (!initalProcessDone && strategy instanceof IReconcilingStrategyExtension) { initalProcessDone = true; IReconcilingStrategyExtension reconcilingStrategyExtension = (IReconcilingStrategyExtension) strategy; reconcilingStrategyExtension.initialReconcile(); } } }
public void setSemanticHighlightingStrategy(IReconcilingStrategy semanticHighlightingStrategy) { fSemanticHighlightingStrategy = semanticHighlightingStrategy; fSemanticHighlightingStrategy.setDocument(getDocument()); }