Lines 461-466
Link Here
|
461 |
return null; |
461 |
return null; |
462 |
} |
462 |
} |
463 |
} |
463 |
} |
|
|
464 |
private IClasspathEntry getClasspathEntry() throws JavaModelException { |
465 |
IPath path = getPath(); |
466 |
IClasspathEntry[] resolvedClasspath = ((JavaProject) getParent()).getResolvedClasspath(true); |
467 |
for (int i = 0, length = resolvedClasspath.length; i < length; i++) { |
468 |
IClasspathEntry entry = resolvedClasspath[i]; |
469 |
if (path.equals(entry.getPath())) |
470 |
return entry; |
471 |
} |
472 |
return null; |
473 |
} |
464 |
public String getElementName() { |
474 |
public String getElementName() { |
465 |
if (this.resource instanceof IFolder) |
475 |
if (this.resource instanceof IFolder) |
466 |
return ((IFolder) this.resource).getName(); |
476 |
return ((IFolder) this.resource).getName(); |
Lines 607-612
Link Here
|
607 |
public IPath getSourceAttachmentPath() throws JavaModelException { |
617 |
public IPath getSourceAttachmentPath() throws JavaModelException { |
608 |
if (getKind() != K_BINARY) return null; |
618 |
if (getKind() != K_BINARY) return null; |
609 |
|
619 |
|
|
|
620 |
IClasspathEntry entry = getClasspathEntry(); |
621 |
IPath sourceAttachmentPath; |
622 |
if (entry != null && (sourceAttachmentPath = entry.getSourceAttachmentPath()) != null) |
623 |
return sourceAttachmentPath; |
624 |
|
610 |
String serverPathString= getSourceAttachmentProperty(); |
625 |
String serverPathString= getSourceAttachmentProperty(); |
611 |
if (serverPathString == null) { |
626 |
if (serverPathString == null) { |
612 |
return null; |
627 |
return null; |
Lines 688-693
Link Here
|
688 |
public IPath getSourceAttachmentRootPath() throws JavaModelException { |
703 |
public IPath getSourceAttachmentRootPath() throws JavaModelException { |
689 |
if (getKind() != K_BINARY) return null; |
704 |
if (getKind() != K_BINARY) return null; |
690 |
|
705 |
|
|
|
706 |
IClasspathEntry entry = getClasspathEntry(); |
707 |
IPath sourceAttachmentRootPath; |
708 |
if (entry != null && (sourceAttachmentRootPath = entry.getSourceAttachmentRootPath()) != null) |
709 |
return sourceAttachmentRootPath; |
710 |
|
691 |
String serverPathString= getSourceAttachmentProperty(); |
711 |
String serverPathString= getSourceAttachmentProperty(); |
692 |
if (serverPathString == null) { |
712 |
if (serverPathString == null) { |
693 |
return null; |
713 |
return null; |
Lines 717-733
Link Here
|
717 |
mapper = createSourceMapper(getPath(), rootPath); // attach root to itself |
737 |
mapper = createSourceMapper(getPath(), rootPath); // attach root to itself |
718 |
else |
738 |
else |
719 |
mapper = createSourceMapper(sourcePath, rootPath); |
739 |
mapper = createSourceMapper(sourcePath, rootPath); |
720 |
if (rootPath == null && mapper.rootPath != null) { |
|
|
721 |
// as a side effect of calling the SourceMapper constructor, the root path was computed |
722 |
rootPath = new Path(mapper.rootPath); |
723 |
|
724 |
//set the property to the path of the mapped source |
725 |
if (sourcePath != null) |
726 |
setSourceAttachmentProperty( |
727 |
sourcePath.toString() |
728 |
+ ATTACHMENT_PROPERTY_DELIMITER |
729 |
+ rootPath.toString()); |
730 |
} |
731 |
rootInfo.setSourceMapper(mapper); |
740 |
rootInfo.setSourceMapper(mapper); |
732 |
} |
741 |
} |
733 |
} catch (JavaModelException e) { |
742 |
} catch (JavaModelException e) { |