Lines 6-11
Link Here
|
6 |
*/ |
6 |
*/ |
7 |
import org.eclipse.core.resources.*; |
7 |
import org.eclipse.core.resources.*; |
8 |
import org.eclipse.core.runtime.CoreException; |
8 |
import org.eclipse.core.runtime.CoreException; |
|
|
9 |
import org.eclipse.core.runtime.IAdaptable; |
9 |
import org.eclipse.core.runtime.IProgressMonitor; |
10 |
import org.eclipse.core.runtime.IProgressMonitor; |
10 |
import org.eclipse.ui.PlatformUI; |
11 |
import org.eclipse.ui.PlatformUI; |
11 |
import org.eclipse.ui.help.WorkbenchHelp; |
12 |
import org.eclipse.ui.help.WorkbenchHelp; |
Lines 15-20
Link Here
|
15 |
import org.eclipse.ui.internal.misc.Assert; |
16 |
import org.eclipse.ui.internal.misc.Assert; |
16 |
import org.eclipse.jface.viewers.IStructuredSelection; |
17 |
import org.eclipse.jface.viewers.IStructuredSelection; |
17 |
import org.eclipse.swt.widgets.Shell; |
18 |
import org.eclipse.swt.widgets.Shell; |
|
|
19 |
|
18 |
import java.util.Iterator; |
20 |
import java.util.Iterator; |
19 |
|
21 |
|
20 |
/** |
22 |
/** |
Lines 58-65
Link Here
|
58 |
IStructuredSelection selection = getStructuredSelection(); |
60 |
IStructuredSelection selection = getStructuredSelection(); |
59 |
for (Iterator enum = selection.iterator(); enum.hasNext();) { |
61 |
for (Iterator enum = selection.iterator(); enum.hasNext();) { |
60 |
Object o = enum.next(); |
62 |
Object o = enum.next(); |
61 |
if (o instanceof IFile) |
63 |
if (o instanceof IAdaptable) { |
62 |
createMarker((IFile) o, markerType); |
64 |
// don't rely on selection being of type IFile. fixes bug 2296 |
|
|
65 |
Object resource= ((IAdaptable)o).getAdapter(IResource.class); |
66 |
if (resource instanceof IFile) |
67 |
createMarker((IFile)resource, markerType); |
68 |
} |
63 |
} |
69 |
} |
64 |
} |
70 |
} |
65 |
/** |
71 |
/** |