@Override public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
@Override public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
@Override public String getElementName() { if (fSelectedNode != null) { return ASTNodes.asString(fSelectedNode); } return null; }
public String getElementName() { if (fSelectedName != null) { return ASTNodes.asString(fSelectedName); } return null; }
private static void appendTypeParameters(StringBuffer buf, List<TypeParameter> typeParameters) { int typeParametersCount= typeParameters.size(); if (typeParametersCount > 0) { buf.append('<'); for (int i= 0; i < typeParametersCount; i++) { TypeParameter typeParameter= typeParameters.get(i); buf.append(ASTNodes.asString(typeParameter)); if (i < typeParametersCount - 1) buf.append(','); } buf.append('>'); } }
private Set<String> getExistingImports(CompilationUnit root) { List<ImportDeclaration> imports= root.imports(); Set<String> res= new HashSet<>(imports.size()); for (int i= 0; i < imports.size(); i++) { res.add(ASTNodes.asString(imports.get(i))); } return res; }
private Set /* String */ getExistingImports(CompilationUnit root) { List imports= root.imports(); Set res= new HashSet(imports.size()); for (int i= 0; i < imports.size(); i++) { res.add(ASTNodes.asString((ImportDeclaration) imports.get(i))); } return res; }
private Set<String> getExistingImports(CompilationUnit root) { List<ImportDeclaration> imports= root.imports(); Set<String> res= new HashSet<>(imports.size()); for (int i= 0; i < imports.size(); i++) { res.add(ASTNodes.asString(imports.get(i))); } return res; }
private String getConstantTypeName() throws JavaModelException { return ASTNodes.asString(getConstantType()); }
protected Name createDestinationTypeName() { return ASTNodeFactory.newName(getAst(), ASTNodes.asString(fDestinationType)); }
public static String asFormattedString(ASTNode node, int indent, String lineDelim, Map options) { String unformatted= asString(node); TextEdit edit= CodeFormatterUtil.format2(node, unformatted, indent, lineDelim, options); if (edit != null) { return CodeFormatterUtil.evaluateFormatterEdit(unformatted, edit, null); } return unformatted; // unknown node }
private String getType(VariableDeclaration declaration, boolean isVarargs) { String type = ASTNodes.asString(ASTNodeFactory.newType(declaration.getAST(), declaration, fImportRewriter, new ContextSensitiveImportRewriteContext(declaration, fImportRewriter))); if (isVarargs) { return type + ParameterInfo.ELLIPSIS; } else { return type; } }
private String getTypeName(ASTNode type) { if (type instanceof AbstractTypeDeclaration) { return ((AbstractTypeDeclaration)type).getName().getIdentifier(); } else if (type instanceof AnonymousClassDeclaration) { ClassInstanceCreation node= ASTNodes.getParent(type, ClassInstanceCreation.class); return ASTNodes.asString(node.getType()); } Assert.isTrue(false, "Should not happen"); //$NON-NLS-1$ return null; }
private String getTypeName(ASTNode type) { if (type instanceof AbstractTypeDeclaration) { return ((AbstractTypeDeclaration) type).getName().getIdentifier(); } else if (type instanceof AnonymousClassDeclaration) { ClassInstanceCreation node = ASTNodes.getParent(type, ClassInstanceCreation.class); return ASTNodes.asString(node.getType()); } Assert.isTrue(false, "Should not happen"); //$NON-NLS-1$ return null; }
private String getTypeName(ASTNode type) { if (type instanceof AbstractTypeDeclaration) { return ((AbstractTypeDeclaration)type).getName().getIdentifier(); } else if (type instanceof AnonymousClassDeclaration) { ClassInstanceCreation node= (ClassInstanceCreation)ASTNodes.getParent(type, ClassInstanceCreation.class); return ASTNodes.asString(node.getType()); } Assert.isTrue(false, "Should not happen"); //$NON-NLS-1$ return null; }
private String getTypeName(ASTNode type) { if (type instanceof AbstractTypeDeclaration) { return ((AbstractTypeDeclaration)type).getName().getIdentifier(); } else if (type instanceof AnonymousClassDeclaration) { ClassInstanceCreation node= (ClassInstanceCreation)ASTNodes.getParent(type, ClassInstanceCreation.class); return ASTNodes.asString(node.getType()); } Assert.isTrue(false, "Should not happen"); //$NON-NLS-1$ return null; }
private boolean updateNameReference(ITypeBinding[] parameters, Name name, CompilationUnitRewrite targetRewrite, TextEditGroup group) { if (ASTNodes.asString(name).equals(fType.getFullyQualifiedName('.'))) { targetRewrite.getASTRewrite().replace(name, getNewQualifiedNameNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; } targetRewrite.getASTRewrite().replace(name, getNewUnqualifiedTypeNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; }
private boolean updateNameReference(ITypeBinding[] parameters, Name name, CompilationUnitRewrite targetRewrite, TextEditGroup group) { if (ASTNodes.asString(name).equals(fType.getFullyQualifiedName('.'))) { targetRewrite.getASTRewrite().replace(name, getNewQualifiedNameNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; } targetRewrite.getASTRewrite().replace(name, getNewUnqualifiedTypeNode(parameters, name), group); targetRewrite.getImportRemover().registerRemovedNode(name); return true; }