Để có loại nền màu này, bạn cần sử dụng Điểm đánh dấu và MarkerAnnotationSpecification. Bạn sẽ tìm thấy làm thế nào để sử dụng chúng ở đây: http://cubussapiens.hu/2011/05/custom-markers-and-annotations-the-bright-side-of-eclipse/
Đối với làm thế nào để tìm ra tin, công lĩnh vực, bạn cần phải sử dụng các plugin JDT và phân tích cú pháp AST để phân tích các tập tin Java và tất cả các thông tin mà bạn muốn. Tôi đang thêm một đoạn mã nhỏ để giúp bạn bắt đầu điều này.
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>();
// Get the field info
for (FieldDeclaration fieldDeclaration : javaType.getFields()) {
// From this object you can recover all the information that you want about the fields.
}
Đây cmpUnit
là ICompilationUnit
của File Java.
Một yêu cầu rất lạ, nhưng thú vị để xem liệu có giải pháp cho việc này hay không. – GGrec
Có thể thực sự hữu ích, ... –