List of usage examples for org.eclipse.jdt.internal.core PackageFragmentRootInfo getSourceMapper
protected SourceMapper getSourceMapper()
null if this root does not have attached source. From source file:org.eclipse.che.jdt.internal.core.PackageFragmentRoot.java
License:Open Source License
/** * @see org.eclipse.jdt.internal.core.JavaElement *///www . j av a 2 s. c o 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; }