diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java index d4af8d1c0df..f2f1456d4ba 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java @@ -1076,6 +1076,11 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext) */ public boolean show(ShowInContext context) { + ISelection selection= context.getSelection(); + if (selection != null) { + selectReveal(selection); + return true; + } IEditorInput input = (IEditorInput) context.getInput(); if (input != null) { IResource res = (IResource) input.getAdapter(IResource.class); @@ -1084,11 +1089,6 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha return true; } } - ISelection selection= context.getSelection(); - if (selection != null) { - selectReveal(selection); - return true; - } return false; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index e59b872e0fa..2ef264c6417 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -95,7 +95,6 @@ import org.eclipse.jface.text.source.projection.ProjectionViewer; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; @@ -170,7 +169,6 @@ import org.eclipse.cdt.ui.IWorkingCopyManager; import org.eclipse.cdt.ui.PreferenceConstants; import org.eclipse.cdt.ui.actions.GenerateActionGroup; import org.eclipse.cdt.ui.actions.OpenViewActionGroup; -import org.eclipse.cdt.ui.actions.ShowInCViewAction; import org.eclipse.cdt.ui.text.ICPartitions; import org.eclipse.cdt.ui.text.folding.ICFoldingStructureProvider; @@ -236,12 +234,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR switch (operation) { case CONTENTASSIST_PROPOSALS: -// long time= CODE_ASSIST_DEBUG ? System.currentTimeMillis() : 0; String msg= fContentAssistant.showPossibleCompletions(); -// if (CODE_ASSIST_DEBUG) { -// long delta= System.currentTimeMillis() - time; -// System.err.println("Code Assist (total): " + delta); //$NON-NLS-1$ -// } setStatusLineErrorMessage(msg); return; case QUICK_ASSIST: @@ -1468,13 +1461,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR /** Generate action group filling the "Source" submenu */ private GenerateActionGroup fGenerateActionGroup; - /** Action which shows selected element in CView. */ - private ShowInCViewAction fShowInCViewAction; - - /** Activity Listeners **/ - protected ISelectionChangedListener fStatusLineClearer; - protected ISelectionChangedListener fSelectionUpdateListener; - /** Pairs of brackets, used to match. */ protected final static char[] BRACKETS = { '{', '}', '(', ')', '[', ']', '<', '>' }; @@ -2106,17 +2092,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR fCEditorErrorTickUpdater = null; } - if (fSelectionUpdateListener != null) { - getSelectionProvider().addSelectionChangedListener(fSelectionUpdateListener); - fSelectionUpdateListener = null; - } - - if (fStatusLineClearer != null) { - ISelectionProvider provider = getSelectionProvider(); - provider.removeSelectionChangedListener(fStatusLineClearer); - fStatusLineClearer = null; - } - if (fBracketMatcher != null) { fBracketMatcher.dispose(); fBracketMatcher = null; @@ -2127,11 +2102,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR fOutlinePage = null; } - if (fShowInCViewAction != null) { - fShowInCViewAction.dispose(); - fShowInCViewAction = null; - } - if (fSelectionSearchGroup != null) { fSelectionSearchGroup.dispose(); fSelectionSearchGroup = null; @@ -2285,11 +2255,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IR // action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DEF); // setAction("OpenDefinition", action); //$NON-NLS-1$ - fShowInCViewAction = new ShowInCViewAction(this); - action = fShowInCViewAction; - action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_CVIEW); - setAction("ShowInCView", action); //$NON-NLS-1$ - action = new TextOperationAction(CEditorMessages.getResourceBundle(), "OpenOutline.", this, CSourceViewer.SHOW_OUTLINE, true); //$NON-NLS-1$ action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_OUTLINE); setAction("OpenOutline", action); //$NON-NLS-1$*/ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties index 6b9f44140c8..789ac9c64c0 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditorMessages.properties @@ -21,6 +21,10 @@ AddIncludeOnSelection.error.message4=BadLocationException: AddIncludeOnSelection.label=Add Include AddIncludeOnSelection.tooltip=Add Include Statement on Selection +ShowInCView.description=Show the current resource in the C/C++ Projects view +ShowInCView.label=Show in C/C++ Projects +ShowInCView.tooltip=Show current resource in C/C++ Projects view + OpenHierarchy.description=Show the type hierarchy of the selected element OpenHierarchy.dialog.message=&Select the type to open: OpenHierarchy.dialog.title=Open Type Hierarchy diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ShowInCViewAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ShowInCViewAction.java index 17e48afbb37..0870ad39ac4 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ShowInCViewAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ShowInCViewAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 QNX Software Systems and others. + * Copyright (c) 2000, 2007 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,6 +35,8 @@ import org.eclipse.ui.texteditor.ITextEditor; * the C/C++ Editor. It uses the IShowInSource/IShowInTarget to * accomplish this task so as to provide some additional portability * and future proofing. + * + * @deprecated Use generic IShowInTarget support instead. */ public class ShowInCViewAction extends SelectionProviderAction {