1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Bug 270013 - Open Include action always displayed in the outline view in the Makefile editor, by Violaine Batthish

This commit is contained in:
Anton Leherbauer 2009-03-26 12:05:23 +00:00
parent fb71de7ec2
commit 5dc7000a12

View file

@ -1,12 +1,13 @@
/*******************************************************************************
* Copyright (c) 2002, 2008 QNX Software Systems and others.
* Copyright (c) 2002, 2009 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
* QNX Software Systems - Initial API and implementation
* Violaine Batthish (IBM) - bug 270013
*******************************************************************************/
package org.eclipse.cdt.make.internal.ui.editor;
@ -55,6 +56,7 @@ public class OpenIncludeAction extends Action {
*
* @see org.eclipse.jface.action.IAction#run()
*/
@Override
public void run() {
IInclude[] includes= getIncludeDirective(fSelectionProvider.getSelection());
if (includes != null) {
@ -121,6 +123,7 @@ public class OpenIncludeAction extends Action {
}
public boolean canActionBeAdded(ISelection selection) {
return getIncludeDirective(selection) != null;
IInclude[] includes = getIncludeDirective(selection);
return includes != null && includes.length != 0;
}
}