Lines 16-21
Link Here
|
16 |
import org.eclipse.core.resources.IProject; |
16 |
import org.eclipse.core.resources.IProject; |
17 |
import org.eclipse.core.resources.IResource; |
17 |
import org.eclipse.core.resources.IResource; |
18 |
import org.eclipse.core.runtime.IPath; |
18 |
import org.eclipse.core.runtime.IPath; |
|
|
19 |
import org.eclipse.core.runtime.jobs.ILock; |
19 |
import org.eclipse.wst.common.componentcore.internal.ComponentResource; |
20 |
import org.eclipse.wst.common.componentcore.internal.ComponentResource; |
20 |
import org.eclipse.wst.common.componentcore.internal.ModulecorePlugin; |
21 |
import org.eclipse.wst.common.componentcore.internal.ModulecorePlugin; |
21 |
import org.eclipse.wst.common.componentcore.internal.StructureEdit; |
22 |
import org.eclipse.wst.common.componentcore.internal.StructureEdit; |
Lines 29-34
Link Here
|
29 |
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; |
30 |
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder; |
30 |
import org.eclipse.wst.common.componentcore.resources.IVirtualReference; |
31 |
import org.eclipse.wst.common.componentcore.resources.IVirtualReference; |
31 |
import org.eclipse.wst.common.componentcore.resources.IVirtualResource; |
32 |
import org.eclipse.wst.common.componentcore.resources.IVirtualResource; |
|
|
33 |
import org.eclipse.wst.common.internal.emfworkbench.edit.EMFWorkbenchEditContextFactory; |
32 |
|
34 |
|
33 |
/** |
35 |
/** |
34 |
* Provides a handle creation factory for the Virtual Path API. Clients may use |
36 |
* Provides a handle creation factory for the Virtual Path API. Clients may use |
Lines 81-87
Link Here
|
81 |
if (aProject == null || !aProject.isAccessible()){ |
83 |
if (aProject == null || !aProject.isAccessible()){ |
82 |
return null; |
84 |
return null; |
83 |
} |
85 |
} |
84 |
return ComponentImplManager.instance().createComponent(aProject, checkForComponentFile); |
86 |
IVirtualComponent retVal = null; |
|
|
87 |
// acquire the lock that StructureEdit will need already, to prevent others from locking that before calling createComponent() - see bug 508685 |
88 |
ILock lock = EMFWorkbenchEditContextFactory.getProjectLockObject(aProject); |
89 |
try{ |
90 |
if(null != lock){ |
91 |
lock.acquire(); |
92 |
} |
93 |
retVal = createComponent(aProject, checkForComponentFile); |
94 |
} finally{ |
95 |
if(null != lock){ |
96 |
lock.release(); |
97 |
} |
98 |
} |
99 |
return retVal; |
85 |
} |
100 |
} |
86 |
|
101 |
|
87 |
/** |
102 |
/** |