1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

fixed problem that run from menu did not work on c files

This commit is contained in:
Alena Laskavaia 2011-02-22 02:55:51 +00:00
parent cec0640481
commit d71dfb3b20

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.internal.ui.CodanUIMessages; import org.eclipse.cdt.codan.internal.ui.CodanUIMessages;
import org.eclipse.cdt.core.model.ICContainer; import org.eclipse.cdt.core.model.ICContainer;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
@ -46,11 +47,12 @@ public class RunCodeAnalysis implements IObjectActionDelegate {
return Status.CANCEL_STATUS; return Status.CANCEL_STATUS;
for (Iterator iterator = ss.iterator(); iterator.hasNext();) { for (Iterator iterator = ss.iterator(); iterator.hasNext();) {
Object o = iterator.next(); Object o = iterator.next();
if (o instanceof ICContainer) { if (o instanceof ICContainer) {
o = ((ICContainer) o).getResource(); o = ((ICContainer) o).getResource();
} }
if (o instanceof IAdaptable) {
o = ((IAdaptable) o).getAdapter(IResource.class);
}
if (o instanceof IResource) { if (o instanceof IResource) {
IResource res = (IResource) o; IResource res = (IResource) o;
SubProgressMonitor subMon = new SubProgressMonitor( SubProgressMonitor subMon = new SubProgressMonitor(