BaseDocument document = (BaseDocument)text.getDocument();
int lineNumber = getCurrentLineNumber() - 1;
if (document != null && lineNumber != -1) {
//get a list if all annotations in the document
Annotations docAnnotations = document.getAnnotations();
int count = docAnnotations.getNumberOfAnnotations(lineNumber);
if (count == 0) {
return null;
}
else {
//get the active Annotation
AnnotationDesc active = docAnnotations.getActiveAnnotation(lineNumber);
String[][] list = new String[2][count];
list[0][0] = annotations.get(active.getAnnotationType());
list[1][0] = active.getShortDescription();
if (list[0][0].equals("Compiler Error")) {
snd.playCompilerError();
}
if (count > 1){
//get the inactive Annotation(s)
AnnotationDesc[] pasive = docAnnotations.getPasiveAnnotations(lineNumber);
for (int i = 1; i < count; i++){
list[0][i] = annotations.get(pasive[i-1].getAnnotationType());
list[1][i] = pasive[i-1].getShortDescription();
if (list[0][i].equals("Compiler Error")) {