protected ImportDeclaration createImportDeclaration(ImportContainer parent, String name, boolean onDemand) { return new ImportDeclaration(parent, name, onDemand); } protected Initializer createInitializer(JavaElement parent) {
/** * @see JavaElement#getHandleMemento(StringBuffer) * For import declarations, the handle delimiter is associated to the import container already */ protected void getHandleMemento(StringBuffer buff) { ((JavaElement)getParent()).getHandleMemento(buff); escapeMementoName(buff, getElementName()); if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); buff.append(this.occurrenceCount); } } /**
/** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append("import "); //$NON-NLS-1$ toStringName(buffer); if (info == null) { buffer.append(" (not open)"); //$NON-NLS-1$ } } }
for (int i = 0; i < importCount; i++) { ImportDeclaration importDeclaration = (ImportDeclaration) importDeclarations[i]; ISourceImport sourceImport = (ISourceImport) importDeclaration.getElementInfo(); String nameWithoutStar = importDeclaration.getNameWithoutStar(); this.unit.imports[i] = createImportReference( Util.splitOn('.', nameWithoutStar, 0, nameWithoutStar.length()), sourceImport.getDeclarationSourceStart(), sourceImport.getDeclarationSourceEnd(), importDeclaration.isOnDemand(), sourceImport.getModifiers());
public ISourceRange getNameRange() throws JavaModelException { ImportDeclarationElementInfo info = (ImportDeclarationElementInfo) getElementInfo(); return info.getNameRange(); } /*
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
for (int i = 0; i < importCount; i++) { ImportDeclaration importDeclaration = (ImportDeclaration) importDeclarations[i]; ISourceImport sourceImport = (ISourceImport) importDeclaration.getElementInfo(); String nameWithoutStar = importDeclaration.getNameWithoutStar(); this.unit.imports[i] = createImportReference( Util.splitOn('.', nameWithoutStar, 0, nameWithoutStar.length()), sourceImport.getDeclarationSourceStart(), sourceImport.getDeclarationSourceEnd(), importDeclaration.isOnDemand(), sourceImport.getModifiers());
@Override public ISourceRange getNameRange() throws JavaModelException { ImportDeclarationElementInfo info = (ImportDeclarationElementInfo) getElementInfo(); return info.getNameRange(); }
public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
for (int i = 0; i < importCount; i++) { ImportDeclaration importDeclaration = (ImportDeclaration) importDeclarations[i]; ISourceImport sourceImport = (ISourceImport) importDeclaration.getElementInfo(); String nameWithoutStar = importDeclaration.getNameWithoutStar(); this.unit.imports[i] = createImportReference( Util.splitOn('.', nameWithoutStar, 0, nameWithoutStar.length()), sourceImport.getDeclarationSourceStart(), sourceImport.getDeclarationSourceEnd(), importDeclaration.isOnDemand(), sourceImport.getModifiers());
/** * @see JavaElement#getHandleMemento(StringBuffer) * For import declarations, the handle delimiter is associated to the import container already */ protected void getHandleMemento(StringBuffer buff) { ((JavaElement)getParent()).getHandleMemento(buff); escapeMementoName(buff, getElementName()); if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); buff.append(this.occurrenceCount); } } /**
/** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append("import "); //$NON-NLS-1$ toStringName(buffer); if (info == null) { buffer.append(" (not open)"); //$NON-NLS-1$ } } }
/** * @see org.eclipse.jdt.core.IImportDeclaration#getFlags() */ public int getFlags() throws JavaModelException { ImportDeclarationElementInfo info = (ImportDeclarationElementInfo)getElementInfo(); return info.getModifiers(); } /**
protected IImportDeclaration getImport(String importName, boolean isOnDemand) { return new ImportDeclaration(this, importName, isOnDemand); } /*
@Override public IJavaElement getPrimaryElement(boolean checkOwner) { CompilationUnit cu = (CompilationUnit)this.parent.getParent(); if (checkOwner && cu.isPrimary()) return this; return cu.getImport(getElementName()); } /**
for (int i = 0; i < importCount; i++) { ImportDeclaration importDeclaration = (ImportDeclaration) importDeclarations[i]; ISourceImport sourceImport = (ISourceImport) importDeclaration.getElementInfo(); String nameWithoutStar = importDeclaration.getNameWithoutStar(); this.unit.imports[i] = createImportReference( Util.splitOn('.', nameWithoutStar, 0, nameWithoutStar.length()), sourceImport.getDeclarationSourceStart(), sourceImport.getDeclarationSourceEnd(), importDeclaration.isOnDemand(), sourceImport.getModifiers());
/** * @see JavaElement#getHandleMemento(StringBuffer) * For import declarations, the handle delimiter is associated to the import container already */ protected void getHandleMemento(StringBuffer buff) { ((JavaElement)getParent()).getHandleMemento(buff); escapeMementoName(buff, getElementName()); if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); buff.append(this.occurrenceCount); } } /**
/** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append("import "); //$NON-NLS-1$ toStringName(buffer); if (info == null) { buffer.append(" (not open)"); //$NON-NLS-1$ } } }
public ISourceRange getNameRange() throws JavaModelException { ImportDeclarationElementInfo info = (ImportDeclarationElementInfo) getElementInfo(); return info.getNameRange(); } /*
protected ImportDeclaration createImportDeclaration(ImportContainer parent, String name, boolean onDemand) { return new ImportDeclaration(parent, name, onDemand); } protected Initializer createInitializer(JavaElement parent) {