1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Bug 372899 - A few changes needed to CEditor in order to implement

remote code folding in the Remote C Editor in ptp
This commit is contained in:
Michael Lindo 2012-03-01 16:34:21 -05:00 committed by Vivian Kong
parent 9ecb8e0c6e
commit dddeb4dbcc

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2011 IBM Corporation and others. * Copyright (c) 2005, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -2202,6 +2202,13 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
return CCorePlugin.SPACE.equals(option); return CCorePlugin.SPACE.equals(option);
} }
protected void uninstallProjectionModelUpdater() {
if (fProjectionModelUpdater != null) {
fProjectionModelUpdater.uninstall();
fProjectionModelUpdater = null;
}
}
/** /**
* @see org.eclipse.ui.IWorkbenchPart#dispose() * @see org.eclipse.ui.IWorkbenchPart#dispose()
*/ */
@ -2214,10 +2221,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
if (sourceViewer instanceof ITextViewerExtension) if (sourceViewer instanceof ITextViewerExtension)
((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(fBracketInserter); ((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(fBracketInserter);
if (fProjectionModelUpdater != null) { uninstallProjectionModelUpdater();
fProjectionModelUpdater.uninstall();
fProjectionModelUpdater = null;
}
if (fProjectionSupport != null) { if (fProjectionSupport != null) {
fProjectionSupport.dispose(); fProjectionSupport.dispose();
@ -2564,7 +2568,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
* Determines if folding is enabled. * Determines if folding is enabled.
* @return <code>true</code> if folding is enabled, <code>false</code> otherwise. * @return <code>true</code> if folding is enabled, <code>false</code> otherwise.
*/ */
boolean isFoldingEnabled() { protected boolean isFoldingEnabled() {
return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED); return CUIPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
} }