List of usage examples for org.eclipse.jdt.internal.core PackageFragmentRootInfo setSourceMapper
protected void setSourceMapper(SourceMapper mapper)
From source file:org.eclipse.che.jdt.internal.core.PackageFragmentRoot.java
License:Open Source License
/** * @see org.eclipse.jdt.internal.core.JavaElement *//*from w w w .ja va 2s. co m*/ public SourceMapper getSourceMapper() { SourceMapper mapper; try { PackageFragmentRootInfo rootInfo = (PackageFragmentRootInfo) getElementInfo(); mapper = rootInfo.getSourceMapper(); if (mapper == null) { // first call to this method IPath sourcePath = getSourceAttachmentPath(); IPath rootPath = getSourceAttachmentRootPath(); if (sourcePath == null) mapper = createSourceMapper(getPath(), rootPath); // attach root to itself else mapper = createSourceMapper(sourcePath, rootPath); rootInfo.setSourceMapper(mapper); } } catch (JavaModelException e) { // no source can be attached mapper = null; } return mapper; }