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

Fix for Bug 173550 - Missing strings for ShowInCViewAction

Marked ShowInCViewAction deprecated to use the generic platform support or Show In targets. At the same time fixed  the CView to support selection of source elements.
This commit is contained in:
Anton Leherbauer 2007-02-09 08:50:32 +00:00
parent 48ac3860b3
commit 93751c7530
4 changed files with 12 additions and 41 deletions

View file

@ -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;
}

View file

@ -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$*/

View file

@ -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

View file

@ -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 {