diff --git a/org.ntlab.traceCollector/src/org/ntlab/traceCollector/handlers/InstrumentationHandler.java b/org.ntlab.traceCollector/src/org/ntlab/traceCollector/handlers/InstrumentationHandler.java index 34a1d28..c20eaa1 100644 --- a/org.ntlab.traceCollector/src/org/ntlab/traceCollector/handlers/InstrumentationHandler.java +++ b/org.ntlab.traceCollector/src/org/ntlab/traceCollector/handlers/InstrumentationHandler.java @@ -8,10 +8,12 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.internal.localstore.FileSystemResourceManager; import org.eclipse.core.internal.resources.Workspace; +import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -37,8 +39,13 @@ ISelection selection = HandlerUtil.getActiveMenuSelection(event); if (selection instanceof IStructuredSelection) { Object project = ((IStructuredSelection)selection).getFirstElement(); - if (project instanceof IJavaProject) { - IJavaProject javaProject = (IJavaProject)project; + IJavaProject javaProject = null; + if (project instanceof IJavaProject) { + javaProject = (IJavaProject)project; + } else if (project instanceof IProject) { + javaProject = JavaCore.create((IProject)project); + } + if (javaProject != null) { try { // Javassist �� ClassPool �� Javassist ���C�u�������A����т��̃v���O�C�����̃N���X�����‚�����悤�ɂ��� ClassPool cp = new ClassPool(true);