* workspace
*/
public IProjectFragment getProjectFragment(String projectName,
String fragmentPath) throws ModelException {
IScriptProject project = getScriptProject(projectName);
if (project == null) {
return null;
}
IPath path = new Path(fragmentPath);
if (path.isAbsolute()) {
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
.getRoot();
IResource resource = workspaceRoot.findMember(path);
IProjectFragment root;
// resource in the workspace
root = project.getProjectFragment(resource);
return root;
} else {
IProjectFragment[] roots = project.getProjectFragments();
if (roots == null || roots.length == 0) {
return null;
}
for (int i = 0; i < roots.length; i++) {
IProjectFragment root = roots[i];