1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 10:45:37 +02:00

Merge remote-tracking branch 'cdt/master' into sd90

This commit is contained in:
Andrew Gvozdev 2012-01-25 15:45:10 -05:00
commit 0fdc3d95c3
3 changed files with 32 additions and 12 deletions

View file

@ -111,11 +111,12 @@ public class CViewLabelProvider extends AppearanceAwareLabelProvider {
String imageKey = null; String imageKey = null;
if (element instanceof IncludeReferenceProxy) { if (element instanceof IncludeReferenceProxy) {
IIncludeReference reference = ((IncludeReferenceProxy)element).getReference(); IIncludeReference reference = ((IncludeReferenceProxy)element).getReference();
IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(reference.getPath()); IContainer containerInclude = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(reference.getPath());
if (container != null) { if (containerInclude != null) {
ICProject cproject = reference.getCProject(); ICProject cproject = reference.getCProject();
IProject project = (cproject != null) ? cproject.getProject() : null; IProject project = (cproject != null) ? cproject.getProject() : null;
boolean isProjectRelative = container.getProject().equals(project); IProject projectInclude = containerInclude.getProject();
boolean isProjectRelative = projectInclude != null && projectInclude.equals(project);
imageKey = LanguageSettingsImages.getImageKey(ICSettingEntry.INCLUDE_PATH, ICSettingEntry.VALUE_WORKSPACE_PATH, isProjectRelative); imageKey = LanguageSettingsImages.getImageKey(ICSettingEntry.INCLUDE_PATH, ICSettingEntry.VALUE_WORKSPACE_PATH, isProjectRelative);
} else { } else {
imageKey = CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER; imageKey = CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2010 Ericsson and others. * Copyright (c) 2008, 2012 Ericsson 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
@ -7,14 +7,18 @@
* *
* Contributors: * Contributors:
* Ericsson - Initial Implementation * Ericsson - Initial Implementation
* Marc Khouzam (Ericsson) - Fix NPE (bug 369583)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service.command.commands; package org.eclipse.cdt.dsf.mi.service.command.commands;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakInsert; import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
import org.junit.Test; import org.junit.Test;
/** /**
@ -46,15 +50,20 @@ public class TestMIBreakInsertCommand {
} }
private class TestContext implements IBreakpointsTargetDMContext { private class TestContext implements IBreakpointsTargetDMContext {
private DsfSession session = null;
public TestContext() {
session = DsfSession.startSession(new DefaultDsfExecutor(TestsPlugin.PLUGIN_ID), TestsPlugin.PLUGIN_ID);
}
@Override @Override
public IDMContext[] getParents() { public IDMContext[] getParents() {
return null; return new IDMContext[] {new GDBControlDMContext(getSessionId(), "1")};
} }
@Override @Override
public String getSessionId() { public String getSessionId() {
return null; return session.getId();
} }
@Override @Override

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008, 2010 Ericsson and others. * Copyright (c) 2008, 2012 Ericsson 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
@ -7,14 +7,20 @@
* *
* Contributors: * Contributors:
* Ericsson - Initial Implementation * Ericsson - Initial Implementation
* Marc Khouzam (Ericsson) - Fix NPE (bug 369583)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service.command.commands; package org.eclipse.cdt.dsf.mi.service.command.commands;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor;
import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext;
import org.eclipse.cdt.dsf.mi.service.command.commands.MICommand; import org.eclipse.cdt.dsf.mi.service.command.commands.MICommand;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
import org.junit.Test; import org.junit.Test;
/** /**
@ -46,16 +52,21 @@ public class TestMICommandConstructCommand {
result); result);
} }
private class TestContext implements IDMContext { private class TestContext implements IBreakpointsTargetDMContext {
private DsfSession session = null;
public TestContext() {
session = DsfSession.startSession(new DefaultDsfExecutor(TestsPlugin.PLUGIN_ID), TestsPlugin.PLUGIN_ID);
}
@Override @Override
public IDMContext[] getParents() { public IDMContext[] getParents() {
return null; return new IDMContext[] {new GDBControlDMContext(getSessionId(), "1")};
} }
@Override @Override
public String getSessionId() { public String getSessionId() {
return null; return session.getId();
} }
@Override @Override
@ -63,7 +74,6 @@ public class TestMICommandConstructCommand {
public Object getAdapter(Class adapter) { public Object getAdapter(Class adapter) {
return null; return null;
} }
} }
} }