public void propertyChange (PropertyChangeEvent evt) { if (evt!=null && EditorUI.COMPONENT_PROPERTY.equals(evt.getPropertyName())) { if (evt.getNewValue() == null){ // component deinstalled, lets uninstall all isteners editorUI.removePropertyChangeListener(editorUIListener); annos.removeAnnotationsListener(GlyphGutter.this); foldHierarchy.removeFoldHierarchyListener(glyphGutterFoldHierarchyListener); if (gutterMouseListener!=null){ removeMouseListener(gutterMouseListener); removeMouseMotionListener(gutterMouseListener); } if (annoTypesListener !=null){ AnnotationTypes.getTypes().removePropertyChangeListener(annoTypesListener); } foldHierarchy.removeFoldHierarchyListener(glyphGutterFoldHierarchyListener); foldHierarchy = null; // Release document reference doc = null; editorUI.removePropertyChangeListener(this); editorUI = null; annos = null; } } } }