1 19 20 package org.netbeans.modules.xml.validation.ui; 21 22 import java.beans.PropertyChangeEvent ; 23 import java.beans.PropertyChangeListener ; 24 import org.openide.text.Annotation; 25 import org.openide.text.Line; 26 27 30 public class ValidationAnnotation extends Annotation implements PropertyChangeListener { 31 32 private String message; 33 34 public String getAnnotationType() { 35 return "org-netbeans-modules-xml-core-error"; } 37 38 public String getShortDescription() { 39 return message; 40 } 41 42 public void show( Line line, String message) { 43 this.message = message; 44 attach(line); 45 line.addPropertyChangeListener(this); 46 } 47 48 public void propertyChange( PropertyChangeEvent propertyChangeEvent ) { 49 Line line = (Line) propertyChangeEvent.getSource(); 50 if (line != null) { 51 line.removePropertyChangeListener(this); 52 detach(); 53 } 54 } 55 } | Popular Tags |