@Override public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent; if (checkOwner && cu.isPrimary()) return this; return cu.getImportContainer(); } /**
@Override public WorkingCopyOwner getOwner() { return isPrimary() || !isWorkingCopy() ? null : this.owner; } /**
public boolean isWorkingCopy() { // For backward compatibility, non primary working copies are always returning true; in removal // delta, clients can still check that element was a working copy before being discarded. return !isPrimary() || getPerWorkingCopyInfo() != null; } /**
private boolean isPrimaryWorkingCopy(IJavaElement element, int elementType) { if (elementType == IJavaElement.COMPILATION_UNIT) { CompilationUnit cu = (CompilationUnit)element; return cu.isPrimary() && cu.isWorkingCopy(); } return false; } /*
public boolean isWorkingCopy() { // For backward compatibility, non primary working copies are always returning true; in removal // delta, clients can still check that element was a working copy before being discarded. return !isPrimary() || getPerWorkingCopyInfo() != null; } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent; if (checkOwner && cu.isPrimary()) return this; return cu.getImportContainer(); } /**
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(); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (checkOwner && cu.isPrimary()) return this; return cu.getPackageDeclaration(this.name); } /**
/** * @see IJavaElement */ public IResource getUnderlyingResource() throws JavaModelException { if (isWorkingCopy() && !isPrimary()) return null; return super.getUnderlyingResource(); } /**
@Override public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner && isPrimary()) return this; return new CompilationUnit((PackageFragment)getParent(), getElementName(), DefaultWorkingCopyOwner.PRIMARY); } /*
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner && isPrimary()) return this; return new CompilationUnit((PackageFragment)getParent(), getElementName(), DefaultWorkingCopyOwner.PRIMARY); } /*
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu.isPrimary()) return this; } IJavaElement primaryParent =this.parent.getPrimaryElement(false); return ((IType)primaryParent).getField(this.name); } /**
public IJavaElement getPrimaryElement(boolean checkOwner) { if (checkOwner) { CompilationUnit cu = (CompilationUnit)getAncestor(COMPILATION_UNIT); if (cu == null || cu.isPrimary()) return this; } IJavaElement primaryParent = this.parent.getPrimaryElement(false); return ((IType)primaryParent).getInitializer(this.occurrenceCount); } /**