mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 206301: MPE - CEditor features not available (toggle breakpoints/typing preferences)
This commit is contained in:
parent
5b7ebd2927
commit
f7f62c4ee4
2 changed files with 10 additions and 1 deletions
|
@ -28,6 +28,7 @@ import org.eclipse.jface.text.TextUtilities;
|
||||||
import org.eclipse.jface.text.rules.FastPartitioner;
|
import org.eclipse.jface.text.rules.FastPartitioner;
|
||||||
import org.eclipse.ui.IEditorPart;
|
import org.eclipse.ui.IEditorPart;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
|
import org.eclipse.ui.part.MultiPageEditorPart;
|
||||||
import org.eclipse.ui.texteditor.ITextEditorExtension3;
|
import org.eclipse.ui.texteditor.ITextEditorExtension3;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
|
@ -1169,6 +1170,9 @@ public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
|
||||||
IWorkbenchPage page = CUIPlugin.getActivePage();
|
IWorkbenchPage page = CUIPlugin.getActivePage();
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
IEditorPart part = page.getActiveEditor();
|
IEditorPart part = page.getActiveEditor();
|
||||||
|
if (part instanceof MultiPageEditorPart) {
|
||||||
|
part= (IEditorPart)part.getAdapter(ITextEditorExtension3.class);
|
||||||
|
}
|
||||||
if (part instanceof ITextEditorExtension3) {
|
if (part instanceof ITextEditorExtension3) {
|
||||||
ITextEditorExtension3 extension = (ITextEditorExtension3) part;
|
ITextEditorExtension3 extension = (ITextEditorExtension3) part;
|
||||||
return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
|
return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 IBM Corporation and others.
|
* Copyright (c) 2000, 2007 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
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Sergey Prigogin, Google
|
* Sergey Prigogin, Google
|
||||||
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.text;
|
package org.eclipse.cdt.internal.ui.text;
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ import org.eclipse.jface.text.TextUtilities;
|
||||||
|
|
||||||
import org.eclipse.ui.IEditorPart;
|
import org.eclipse.ui.IEditorPart;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
|
import org.eclipse.ui.part.MultiPageEditorPart;
|
||||||
import org.eclipse.ui.texteditor.ITextEditorExtension3;
|
import org.eclipse.ui.texteditor.ITextEditorExtension3;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
|
@ -160,6 +162,9 @@ public class CStringAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy
|
||||||
IWorkbenchPage page= CUIPlugin.getActivePage();
|
IWorkbenchPage page= CUIPlugin.getActivePage();
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
IEditorPart part= page.getActiveEditor();
|
IEditorPart part= page.getActiveEditor();
|
||||||
|
if (part instanceof MultiPageEditorPart) {
|
||||||
|
part= (IEditorPart)part.getAdapter(ITextEditorExtension3.class);
|
||||||
|
}
|
||||||
if (part instanceof ITextEditorExtension3) {
|
if (part instanceof ITextEditorExtension3) {
|
||||||
ITextEditorExtension3 extension= (ITextEditorExtension3) part;
|
ITextEditorExtension3 extension= (ITextEditorExtension3) part;
|
||||||
return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
|
return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue