/** * Computes the files that are being modified by this refactoring. * * @param source * the source compilation unit * @param target * the target compilation unit * @return the modified files */ protected IFile[] computeModifiedFiles(final ICompilationUnit source, final ICompilationUnit target) { Assert.isNotNull(source); Assert.isNotNull(target); if (source.equals(target)) return ResourceUtil.getFiles(new ICompilationUnit[] { source }); return ResourceUtil.getFiles(new ICompilationUnit[] { source, target }); }
public static IResource getResource(Object o){ if (o instanceof IResource) return (IResource)o; if (o instanceof IJavaElement) return getResource((IJavaElement)o); return null; }
@Override protected IFile[] getChangedFiles() throws CoreException { if (!fWillRenameType) { IFile file= ResourceUtil.getFile(fCu); if (file != null) return new IFile[] {file}; } return new IFile[0]; }
protected IFile[] getChangedFiles() throws CoreException { List result= new ArrayList(); result.addAll(Arrays.asList(ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits()))); if (fQualifiedNameSearchResult != null) result.addAll(Arrays.asList(fQualifiedNameSearchResult.getAllFiles())); if (willRenameCU()) result.add(ResourceUtil.getFile(fType.getCompilationUnit())); return (IFile[]) result.toArray(new IFile[result.size()]); }
@Override protected IFile[] getChangedFiles() throws CoreException { List<IFile> result= new ArrayList<>(); result.addAll(Arrays.asList(ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits()))); if (fQualifiedNameSearchResult != null) result.addAll(Arrays.asList(fQualifiedNameSearchResult.getAllFiles())); if (willRenameCU()) result.add(ResourceUtil.getFile(fType.getCompilationUnit())); return result.toArray(new IFile[result.size()]); }
/** * Computes the files that are being modified by this refactoring. * * @param source * the source compilation unit * @param target * the target compilation unit * @return the modified files */ protected IFile[] computeModifiedFiles(final ICompilationUnit source, final ICompilationUnit target) { Assert.isNotNull(source); Assert.isNotNull(target); if (source.equals(target)) return ResourceUtil.getFiles(new ICompilationUnit[] { source }); return ResourceUtil.getFiles(new ICompilationUnit[] { source, target }); }
public static IResource getResource(Object o){ if (o instanceof IResource) return (IResource)o; if (o instanceof IJavaElement) return getResource((IJavaElement)o); return null; }
@Override protected IFile[] getChangedFiles() throws CoreException { return new IFile[] {ResourceUtil.getFile(fCu)}; }
@Override protected IFile[] getChangedFiles() throws CoreException { List<IFile> result= new ArrayList<>(); result.addAll(Arrays.asList(ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits()))); if (fQualifiedNameSearchResult != null) result.addAll(Arrays.asList(fQualifiedNameSearchResult.getAllFiles())); if (willRenameCU()) result.add(ResourceUtil.getFile(fType.getCompilationUnit())); return result.toArray(new IFile[result.size()]); }
/** * Computes the files that are being modified by this refactoring. * * @param source * the source compilation unit * @param target * the target compilation unit * @return the modified files */ protected IFile[] computeModifiedFiles(final ICompilationUnit source, final ICompilationUnit target) { Assert.isNotNull(source); Assert.isNotNull(target); if (source.equals(target)) return ResourceUtil.getFiles(new ICompilationUnit[] { source }); return ResourceUtil.getFiles(new ICompilationUnit[] { source, target }); }
public static IResource getResource(Object o){ if (o instanceof IResource) return (IResource)o; if (o instanceof IJavaElement) return getResource((IJavaElement)o); return null; }
protected IFile[] getChangedFiles() throws CoreException { if (!fWillRenameType) { IFile file= ResourceUtil.getFile(fCu); if (file != null) return new IFile[] {file}; } return new IFile[0]; }
private IFile[] getAllFilesToModify() { List<ICompilationUnit> cus= new ArrayList<>(); cus.addAll(Arrays.asList(fTextChangeManager.getAllCompilationUnits())); return ResourceUtil.getFiles(cus.toArray(new ICompilationUnit[cus.size()])); }
public static boolean isParentInWorkspaceOrOnDisk(IPackageFragmentRoot root, IJavaProject javaProject){ if (root == null) return false; IJavaElement rootParent= root.getParent(); if (rootParent == null) return false; if (rootParent.equals(root)) return true; IResource packageResource= ResourceUtil.getResource(root); IResource packageRootResource= ResourceUtil.getResource(javaProject); return isParentInWorkspaceOrOnDisk(packageResource, packageRootResource); }
@Override protected IFile[] getChangedFiles() throws CoreException { if (!fWillRenameType) { IFile file= ResourceUtil.getFile(fCu); if (file != null) return new IFile[] {file}; } return new IFile[0]; }
@Override protected IFile[] getChangedFiles() { return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits()); }
public static boolean isParentInWorkspaceOrOnDisk(IPackageFragment pack, IPackageFragmentRoot root){ if (pack == null) return false; IJavaElement packParent= pack.getParent(); if (packParent == null) return false; if (packParent.equals(root)) return true; IResource packageResource= ResourceUtil.getResource(pack); IResource packageRootResource= ResourceUtil.getResource(root); return isParentInWorkspaceOrOnDisk(packageResource, packageRootResource); }
protected IFile[] getChangedFiles() throws CoreException { return new IFile[] {ResourceUtil.getFile(fCu)}; }
@Override protected IFile[] getChangedFiles() { return ResourceUtil.getFiles(fChangeManager.getAllCompilationUnits()); }
public static boolean isParentInWorkspaceOrOnDisk(IPackageFragment pack, IPackageFragmentRoot root){ if (pack == null) return false; IJavaElement packParent= pack.getParent(); if (packParent == null) return false; if (packParent.equals(root)) return true; IResource packageResource= ResourceUtil.getResource(pack); IResource packageRootResource= ResourceUtil.getResource(root); return isParentInWorkspaceOrOnDisk(packageResource, packageRootResource); }