To get this kind of color background, you need to use Markers and MarkerAnnotationSpecification . You will find how to use them here: http://cubussapiens.hu/2011/05/custom-markers-and-annotations-the-bright-side-of-eclipse/
As for how to find private , public fields, you need to use the JDT plugin and AST parser to parse the Java file and find all the information you want. I am adding a small piece of code to get you started with this.
ASTParser parser = ASTParser.newParser(AST_LEVEL); parser.setSource(cmpUnit); parser.setResolveBindings(true); CompilationUnit astRoot = (CompilationUnit) parser.createAST(null); AST ast = astRoot.getAST(); TypeDeclaration javaType = null; Object type = astRoot.types().get(0); if (type instanceof TypeDeclaration) { javaType = ((TypeDeclaration) type); } List<FieldDeclarationInfo> fieldDeclarations = new ArrayList<FieldDeclarationInfo>();
Here cmpUnit is an ICompilationUnit Java file.
source share