protected XImportDeclaration createImport(String importedNamespace, final String member) { XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration(); importDeclaration.setImportedNamespace(importedNamespace); if (member != null) { importDeclaration.setMemberName(member); } return importDeclaration; }
public boolean addImport(JvmDeclaredType type) { if (plainImports.containsKey(type.getSimpleName()) || !needsImport(type)) return false; Maps2.putIntoListMap(type.getSimpleName(), type, plainImports); XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration(); importDeclaration.setImportedType(type); addedImportDeclarations.add(importDeclaration); return true; }
public boolean addStaticImport(JvmDeclaredType type, String memberName) { if (hasStaticImport(staticImports, type, memberName)) { return false; } Maps2.putIntoSetMap(type, memberName, staticImports); XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration(); importDeclaration.setImportedType(type); importDeclaration.setStatic(true); if (memberName == null) { importDeclaration.setWildcard(true); } else { importDeclaration.setMemberName(memberName); } addedImportDeclarations.add(importDeclaration); return true; }
public boolean addStaticExtensionImport(JvmDeclaredType type, String memberName) { if (hasStaticImport(staticExtensionImports, type, memberName)) { return false; } Maps2.putIntoSetMap(type, memberName, staticExtensionImports); XImportDeclaration importDeclaration = XtypeFactory.eINSTANCE.createXImportDeclaration(); importDeclaration.setImportedType(type); importDeclaration.setStatic(true); importDeclaration.setExtension(true); if (memberName == null) { importDeclaration.setWildcard(true); } else { importDeclaration.setMemberName(memberName); } addedImportDeclarations.add(importDeclaration); return true; }
JvmType type = findType(getScript(), importName).getType(); if (concreteImports.addImportFor(type) && type instanceof JvmDeclaredType) { XImportDeclaration declaration = XtypeFactory.eINSTANCE.createXImportDeclaration(); declaration.setImportedType((JvmDeclaredType) type); if (importSection == null) {