/** * Given a NdType, returns its identifier in the form accepted by {@link IJavaSearchScope#encloses(String)} */ public static char[] getIndexPathFor(NdType type, IWorkspaceRoot root) { NdResourceFile resourceFile = type.getResourceFile(); char[] binaryName = type.getTypeId().getBinaryName(); char[] workspaceLocation = null; if (root != null) { workspaceLocation = resourceFile.getAnyOpenWorkspaceLocation(root).toString().toCharArray(); } if (workspaceLocation == null || workspaceLocation.length == 0) { workspaceLocation = resourceFile.getLocation().getChars(); } return CharArrayUtils.concat(workspaceLocation, JAR_FILE_ENTRY_SEPARATOR, binaryNameToResourceRelativePath(binaryName)); }
/** * Given a NdType, returns its identifier in the form accepted by {@link IJavaSearchScope#encloses(String)} */ public static char[] getIndexPathFor(NdType type, IWorkspaceRoot root) { NdResourceFile resourceFile = type.getResourceFile(); char[] binaryName = type.getTypeId().getBinaryName(); char[] workspaceLocation = null; if (root != null) { workspaceLocation = resourceFile.getAnyOpenWorkspaceLocation(root).toString().toCharArray(); } if (workspaceLocation == null || workspaceLocation.length == 0) { workspaceLocation = resourceFile.getLocation().getChars(); } return CharArrayUtils.concat(workspaceLocation, JAR_FILE_ENTRY_SEPARATOR, binaryNameToResourceRelativePath(binaryName)); }