/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ @Override public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment#getCompilationUnit(String) * @exception IllegalArgumentException if the name does not end with ".java" */ public ICompilationUnit getCompilationUnit(String cuName) { if (!org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(cuName)) { throw new IllegalArgumentException(Messages.convention_unit_notJavaName); } return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ @Override public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
/** * @see IPackageFragment */ public ICompilationUnit createCompilationUnit(String cuName, String contents, boolean force, IProgressMonitor monitor) throws JavaModelException { CreateCompilationUnitOperation op= new CreateCompilationUnitOperation(this, cuName, contents, force); op.runOperation(monitor); return new CompilationUnit(this, cuName, DefaultWorkingCopyOwner.PRIMARY); } /**
@Override 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 && isPrimary()) return this; return new CompilationUnit((PackageFragment)getParent(), getElementName(), DefaultWorkingCopyOwner.PRIMARY); } /*
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 && isPrimary()) return this; return new CompilationUnit((PackageFragment)getParent(), getElementName(), DefaultWorkingCopyOwner.PRIMARY); } /*
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 && isPrimary()) return this; return new CompilationUnit((PackageFragment)getParent(), getElementName(), DefaultWorkingCopyOwner.PRIMARY); } /*
private ICompilationUnit getCompilationUnitStub() { final String compilationUnitName = getCompilationUnitName(getTypeName()); return new CompilationUnit((PackageFragment) getPackageFragment(), compilationUnitName, DefaultWorkingCopyOwner.PRIMARY); }
public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) { switch (token.charAt(0)) { case JEM_CLASSFILE: if (!memento.hasMoreTokens()) return this; String classFileName = memento.nextToken(); JavaElement classFile = (JavaElement)getClassFile(classFileName); return classFile.getHandleFromMemento(memento, owner); case JEM_COMPILATIONUNIT: if (!memento.hasMoreTokens()) return this; String cuName = memento.nextToken(); JavaElement cu = new CompilationUnit(this, cuName, owner); return cu.getHandleFromMemento(memento, owner); } return null; } /**