@Override public WorkingCopyOwner getOwner() { return isPrimary() || !isWorkingCopy() ? null : this.owner; } /**
protected void openAncestors(HashMap newElements, IProgressMonitor monitor) throws JavaModelException { if (!isWorkingCopy()) { super.openAncestors(newElements, monitor); } // else don't open ancestors for a working copy to speed up the first becomeWorkingCopy // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=89411) } /*
private boolean isPrimaryWorkingCopy(IJavaElement element, int elementType) { if (elementType == IJavaElement.COMPILATION_UNIT) { CompilationUnit cu = (CompilationUnit)element; return cu.isPrimary() && cu.isWorkingCopy(); } return false; } /*
private boolean isPrimaryWorkingCopy(IJavaElement element, int elementType) { if (elementType == IJavaElement.COMPILATION_UNIT) { CompilationUnit cu = (CompilationUnit)element; return cu.isPrimary() && cu.isWorkingCopy(); } return false; } /*
private boolean isPrimaryWorkingCopy(IJavaElement element, int elementType) { if (elementType == IJavaElement.COMPILATION_UNIT) { CompilationUnit cu = (CompilationUnit)element; return cu.isPrimary() && cu.isWorkingCopy(); } return false; } /*
/** * @see IJavaElement */ @Override public IResource getUnderlyingResource() throws JavaModelException { if (isWorkingCopy() && !isPrimary()) return null; return super.getUnderlyingResource(); } /**
/** * @see IJavaElement */ public IResource getUnderlyingResource() throws JavaModelException { if (isWorkingCopy() && !isPrimary()) return null; return super.getUnderlyingResource(); } /**
/** * @see IJavaElement */ public IResource getUnderlyingResource() throws JavaModelException { if (isWorkingCopy() && !isPrimary()) return null; return super.getUnderlyingResource(); } /**
/** * @see IJavaElement */ public IResource getUnderlyingResource() throws JavaModelException { if (isWorkingCopy() && !isPrimary()) return null; return super.getUnderlyingResource(); } /**
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner workingCopyOwner, IProgressMonitor monitor) throws JavaModelException { codeComplete( this, isWorkingCopy() ? (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) getOriginalElement() : this, offset, requestor, workingCopyOwner, this, monitor); }
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner workingCopyOwner, IProgressMonitor monitor) throws JavaModelException { codeComplete( this, isWorkingCopy() ? (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) getOriginalElement() : this, offset, requestor, workingCopyOwner, this, monitor); }
/** * @see IWorkingCopy#isBasedOn(IResource) * @deprecated */ @Override public boolean isBasedOn(IResource resource) { if (!isWorkingCopy()) return false; if (!getResource().equals(resource)) return false; return !hasResourceChanged(); } /**
/** * @see IWorkingCopy#isBasedOn(IResource) * @deprecated */ public boolean isBasedOn(IResource resource) { if (!isWorkingCopy()) return false; if (!getResource().equals(resource)) return false; return !hasResourceChanged(); } /**
/** * @see IWorkingCopy#isBasedOn(IResource) * @deprecated */ public boolean isBasedOn(IResource resource) { if (!isWorkingCopy()) return false; if (!getResource().equals(resource)) return false; return !hasResourceChanged(); } /**
@Override protected IJavaModelStatus verify() { IJavaModelStatus status = super.verify(); if (!status.isOK()) { return status; } CompilationUnit workingCopy = getWorkingCopy(); if (!workingCopy.isWorkingCopy()) { return new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, workingCopy); //was destroyed } return status; }
protected IJavaModelStatus verify() { IJavaModelStatus status = super.verify(); if (!status.isOK()) { return status; } CompilationUnit workingCopy = getWorkingCopy(); if (!workingCopy.isWorkingCopy()) { return new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, workingCopy); //was destroyed } return status; }
public boolean hasResourceChanged() { if (!isWorkingCopy()) return false; // if resource got deleted, then #getModificationStamp() will answer IResource.NULL_STAMP, which is always different from the cached // timestamp Object info = JavaModelManager.getJavaModelManager().getInfo(this); if (info == null) return false; IResource resource = getResource(); if (resource == null) return false; return ((CompilationUnitElementInfo)info).timestamp != resource.getModificationStamp(); } public boolean ignoreOptionalProblems() {
protected IJavaModelStatus verify() { IJavaModelStatus status = super.verify(); if (!status.isOK()) { return status; } CompilationUnit workingCopy = getWorkingCopy(); if (!workingCopy.isWorkingCopy()) { return new JavaModelStatus(IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST, workingCopy); //was destroyed } return status; }
@Override public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**
public void restore() throws JavaModelException { if (!isWorkingCopy()) return; CompilationUnit original = (CompilationUnit) getOriginalElement(); IBuffer buffer = getBuffer(); if (buffer == null) return; buffer.setContents(original.getContents()); updateTimeStamp(original); makeConsistent(null); } /**