@Override public boolean equals(Object object) { if (object instanceof PackageFragmentRootSourceLocation) { PackageFragmentRootSourceLocation root = (PackageFragmentRootSourceLocation)object; if (getPackageFragmentRoot() == null) { return root.getPackageFragmentRoot() == null; } return getPackageFragmentRoot().equals(root.getPackageFragmentRoot()); } return false; }
/** * Creates a source location on the given package fragment root. * * @param root package fragment root */ public PackageFragmentRootSourceLocation(IPackageFragmentRoot root) { setPackageFragmentRoot(root); }
abort(LaunchingMessages.PackageFragmentRootSourceLocation_Unable_to_initialize_source_location___missing_handle_identifier_for_package_fragment_root__6, null); } else { if (handle.length() == 0) { setPackageFragmentRoot(null); } else { IJavaElement element = JavaCore.create(handle); if (element instanceof IPackageFragmentRoot) { setPackageFragmentRoot((IPackageFragmentRoot)element); } else { abort(LaunchingMessages.PackageFragmentRootSourceLocation_Unable_to_initialize_source_location___package_fragment_root_does_not_exist__7, null); ex = e; abort(LaunchingMessages.PackageFragmentRootSourceLocation_Exception_occurred_initializing_source_location__8, ex);
/** * Sets the Java project in which source elements will * be searched for. * * @param project Java project */ private void setJavaProject(IJavaProject project) { fProject = project; fRootLocations = null; if (fProject != null) { try { IPackageFragmentRoot[] roots = project.getPackageFragmentRoots(); ArrayList<PackageFragmentRootSourceLocation> list = new ArrayList<>(roots.length); for (int i = 0; i < roots.length; i++) { if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) { list.add(new PackageFragmentRootSourceLocation(roots[i])); } } fRootLocations = list.toArray(new IJavaSourceLocation[list.size()]); } catch (JavaModelException e) { LaunchingPlugin.log(e); } } }
abort(LaunchingMessages.PackageFragmentRootSourceLocation_Unable_to_initialize_source_location___missing_handle_identifier_for_package_fragment_root__6, null); } else { if (handle.length() == 0) { setPackageFragmentRoot(null); } else { IJavaElement element = JavaCore.create(handle); if (element instanceof IPackageFragmentRoot) { setPackageFragmentRoot((IPackageFragmentRoot)element); } else { abort(LaunchingMessages.PackageFragmentRootSourceLocation_Unable_to_initialize_source_location___package_fragment_root_does_not_exist__7, null); ex = e; abort(LaunchingMessages.PackageFragmentRootSourceLocation_Exception_occurred_initializing_source_location__8, ex);
/** * Sets the Java project in which source elements will * be searched for. * * @param project Java project */ private void setJavaProject(IJavaProject project) { fProject = project; fRootLocations = null; if (fProject != null) { try { IPackageFragmentRoot[] roots = project.getPackageFragmentRoots(); ArrayList<PackageFragmentRootSourceLocation> list = new ArrayList<PackageFragmentRootSourceLocation>(roots.length); for (int i = 0; i < roots.length; i++) { if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE) { list.add(new PackageFragmentRootSourceLocation(roots[i])); } } fRootLocations = list.toArray(new IJavaSourceLocation[list.size()]); } catch (JavaModelException e) { LaunchingPlugin.log(e); } } }
@Override public boolean equals(Object object) { if (object instanceof PackageFragmentRootSourceLocation) { PackageFragmentRootSourceLocation root = (PackageFragmentRootSourceLocation)object; if (getPackageFragmentRoot() == null) { return root.getPackageFragmentRoot() == null; } return getPackageFragmentRoot().equals(root.getPackageFragmentRoot()); } return false; }
if (external.get(location) == null) { external.put(location, location); list.add(new PackageFragmentRootSourceLocation(roots[i])); list.add(new PackageFragmentRootSourceLocation(roots[i]));
/** * Creates a source location on the given package fragment root. * * @param root package fragment root */ public PackageFragmentRootSourceLocation(IPackageFragmentRoot root) { setPackageFragmentRoot(root); }
@Override public int hashCode() { if (getPackageFragmentRoot() == null) { return getClass().hashCode(); } return getPackageFragmentRoot().hashCode(); } }
if (external.get(location) == null) { external.put(location, location); list.add(new PackageFragmentRootSourceLocation(roots[i])); list.add(new PackageFragmentRootSourceLocation(roots[i]));
@Override public int hashCode() { if (getPackageFragmentRoot() == null) { return getClass().hashCode(); } return getPackageFragmentRoot().hashCode(); } }
if (isSourceAttachmentEqual(root, entry)) { return new PackageFragmentRootSourceLocation(root); return new PackageFragmentRootSourceLocation(root); if (isSourceAttachmentEqual(root, entry)) { return new PackageFragmentRootSourceLocation(root);
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaPackageFragmentRootSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); String handle = ""; //$NON-NLS-1$ if (getPackageFragmentRoot() != null) { handle = getPackageFragmentRoot().getHandleIdentifier(); } node.setAttribute("handleId", handle); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
if (isSourceAttachmentEqual(root, entry)) { return new PackageFragmentRootSourceLocation(root); return new PackageFragmentRootSourceLocation(root); if (isSourceAttachmentEqual(root, entry)) { return new PackageFragmentRootSourceLocation(root);
@Override public String getMemento() throws CoreException { Document doc = DebugPlugin.newDocument(); Element node = doc.createElement("javaPackageFragmentRootSourceLocation"); //$NON-NLS-1$ doc.appendChild(node); String handle = ""; //$NON-NLS-1$ if (getPackageFragmentRoot() != null) { handle = getPackageFragmentRoot().getHandleIdentifier(); } node.setAttribute("handleId", handle); //$NON-NLS-1$ return DebugPlugin.serializeDocument(doc); }
@Override public Object findSourceElement(String name) throws CoreException { if (name != null && getPackageFragmentRoot() != null) { IPackageFragment pkg = null; int index = name.lastIndexOf('.'); if (index >= 0) { String fragment = name.substring(0, index); pkg = getPackageFragmentRoot().getPackageFragment(fragment); name = name.substring(index + 1); } else { pkg = getPackageFragmentRoot().getPackageFragment(""); //$NON-NLS-1$
@Override public Object findSourceElement(String name) throws CoreException { if (name != null && getPackageFragmentRoot() != null) { IPackageFragment pkg = null; int index = name.lastIndexOf('.'); if (index >= 0) { String fragment = name.substring(0, index); pkg = getPackageFragmentRoot().getPackageFragment(fragment); name = name.substring(index + 1); } else { pkg = getPackageFragmentRoot().getPackageFragment(""); //$NON-NLS-1$