/* * @see ITextOperationTargetExtension#enableOperation(int, boolean) * @since 2.0 */ public void enableOperation(int operation, boolean enable) { switch (operation) { case CONTENTASSIST_PROPOSALS: case CONTENTASSIST_CONTEXT_INFORMATION: { if (fContentAssistant == null) return; if (enable) { if (!fContentAssistantInstalled) { fContentAssistant.install(this); fContentAssistantInstalled = true; } } else if (fContentAssistantInstalled) { fContentAssistant.uninstall(); fContentAssistantInstalled = false; } break; } case QUICK_ASSIST: { if (fQuickAssistAssistant == null) return; if (enable) { if (!fQuickAssistAssistantInstalled) { fQuickAssistAssistant.install(this); fQuickAssistAssistantInstalled = true; } } else if (fQuickAssistAssistantInstalled) { fQuickAssistAssistant.uninstall(); fQuickAssistAssistantInstalled = false; } } } }
/* * @see org.eclipse.jface.text.source.ISourceViewerExtension2#unconfigure() * @since 3.0 */ public void unconfigure() { clearRememberedSelection(); if (fPresentationReconciler != null) { fPresentationReconciler.uninstall(); fPresentationReconciler = null; } if (fReconciler != null) { fReconciler.uninstall(); fReconciler = null; } if (fContentAssistant != null) { fContentAssistant.uninstall(); fContentAssistantInstalled = false; fContentAssistant = null; if (fContentAssistantFacade != null) fContentAssistantFacade = null; } if (fQuickAssistAssistant != null) { fQuickAssistAssistant.uninstall(); fQuickAssistAssistantInstalled = false; fQuickAssistAssistant = null; } fContentFormatter = null; if (fInformationPresenter != null) { fInformationPresenter.uninstall(); fInformationPresenter = null; } fAutoIndentStrategies = null; fDoubleClickStrategies = null; fTextHovers = null; fIndentChars = null; fDefaultPrefixChars = null; if (fVerticalRulerHoveringController != null) { fVerticalRulerHoveringController.dispose(); fVerticalRulerHoveringController = null; } if (fOverviewRulerHoveringController != null) { fOverviewRulerHoveringController.dispose(); fOverviewRulerHoveringController = null; } if (fUndoManager != null) { fUndoManager.disconnect(); fUndoManager = null; } setHyperlinkDetectors(null, SWT.NONE); }