/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
@Override public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
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) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ @Override public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
/** * @see ICompilationUnit#createImport(String, IJavaElement, int, IProgressMonitor) * @since 3.0 */ public IImportDeclaration createImport(String importName, IJavaElement sibling, int flags, IProgressMonitor monitor) throws JavaModelException { CreateImportOperation op = new CreateImportOperation(importName, this, flags); if (sibling != null) { op.createBefore(sibling); } op.runOperation(monitor); return getImport(importName); }
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); if (openable instanceof ModularClassFile) return openable; // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**
/** * Creates an IImportDeclaration from the given import statement */ protected IJavaElement createImportHandle(ImportReference importRef) { char[] importName = CharOperation.concatWith(importRef.getImportName(), '.'); if ((importRef.bits & ASTNode.OnDemand) != 0) importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$ Openable openable = this.currentPossibleMatch.openable; if (openable instanceof CompilationUnit) return ((CompilationUnit) openable).getImport(new String(importName)); if (openable instanceof ModularClassFile) return openable; // binary types do not contain import statements so just answer the top-level type as the element IType binaryType = ((ClassFile) openable).getType(); String typeName = binaryType.getElementName(); int lastDollar = typeName.lastIndexOf('$'); if (lastDollar == -1) return binaryType; return createTypeHandle(typeName.substring(0, lastDollar)); } /**