1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00
First work to add support for "Show in CView"
Based on work provided by Thomas Fletcher.
This commit is contained in:
Alain Magloire 2004-01-29 17:14:23 +00:00
parent d46025b64f
commit 11f6760c10
3 changed files with 28 additions and 6 deletions

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.internal.ui.text.CTextTools;
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IWorkingCopyManager;
import org.eclipse.cdt.ui.actions.ShowInCViewAction;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
@ -461,11 +462,16 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_DECL);
setAction("OpenDeclarations", action);
action = new ShowInCViewAction(this);
action.setActionDefinitionId(ICEditorActionDefinitionIds.OPEN_CVIEW);
setAction("ShowInCView", action); //$NON-NLS-1$
fFileSearchAction = new FileSearchAction(getSelectionProvider());
fFileSearchActionInWorkingSet = new FileSearchActionInWorkingSet(getSelectionProvider());
fSearchDialogAction = new SearchDialogAction(getSelectionProvider(), this);
}
public void editorContextMenuAboutToShow(IMenuManager menu) {
@ -498,6 +504,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "ContentAssistProposal"); //$NON-NLS-1$
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "AddIncludeOnSelection"); //$NON-NLS-1$
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "OpenDeclarations"); //$NON-NLS-1$
addAction(menu, IContextMenuConstants.GROUP_GENERATE, "ShowInCView"); //$NON-NLS-1$
}
public void setOutlinePageInput(CContentOutlinePage page, IEditorInput input) {

View file

@ -13,6 +13,10 @@ AddIncludeOnSelection.error.message4=BadLocationException:
AddIncludeOnSelection.label=Add I&nclude@Ctrl+Shift+N
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
ClassFileEditor.error.invalid_input_message=Invalid input for Class File Editor
ClassFileMarkerAnnotationModel.error.isAcceptable=ClassFileMarkerAnnotationModel.isAcceptable

View file

@ -1,7 +1,13 @@
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.ui.editor;
@ -49,9 +55,14 @@ public interface ICEditorActionDefinitionIds extends ITextEditorActionDefinition
public static final String TOGGLE_PRESENTATION= "org.eclipse.cdt.ui.edit.text.c.toggle.presentation"; //$NON-NLS-1$
/**
* Action definition ID of the open declaration action
* (value <code>"org.eclipse.cdt.ui.edit.text.java.toggle.presentation"</code>).
* (value <code>"org.eclipse.cdt.ui.edit.opendecl"</code>).
*/
public static final String OPEN_DECL= "org.eclipse.cdt.ui.edit.opendecl"; //$NON-NLS-1$
/**
* Action definition ID of the show in C/C++ Projects View action
* (value <code>"org.eclipse.cdt.ui.edit.opencview"</code>).
*/
public static final String OPEN_CVIEW= "org.eclipse.cdt.ui.edit.opencview"; //$NON-NLS-1$
}