public void propertyChange(PropertyChangeEvent evt) { if (EditorCookie.Observable.PROP_OPENED_PANES.equals(evt.getPropertyName())) { if (editorCookie.getOpenedPanes() == null) { opened = false; ((EditorCookie.Observable)editorCookie).removePropertyChangeListener(this); } } } });
private void checkForReset() { assert SwingUtilities.isEventDispatchThread(); if (ec.getOpenedPanes() == null) { //reset: AnnotationsHolder remove; synchronized (file2holders) { remove = file2holders.remove(file); cancelled.set(true); } ec.removePropertyChangeListener(this); if (remove != null) { task.schedule(0); } } else { cancelled.set(false); } }
public static void clearIfNeed(DataObject dao) { AnnotationsHolder holder; synchronized (file2holders) { holder = file2holders.remove(dao); if (holder != null) { holder.cancelled.set(true); } } if (holder != null) { holder.ec.removePropertyChangeListener(holder); holder.task.schedule(0); } }
if(pane != null) { hasEditorPanes = true; o.removePropertyChangeListener(l);
@Override public void propertyChange( PropertyChangeEvent evt ) { if (EditorCookie.Observable.PROP_OPENED_PANES.endsWith(evt.getPropertyName()) || evt.getPropertyName() == null) { if (myObservable.getOpenedPanes() == null) { myObservable.removePropertyChangeListener(this); Runnable runnable = new Runnable() { @Override public void run() { HELPERS.remove(myDataObject); List<CDIAnnotation> annotations = myModelAnnotations.get(); for (CDIAnnotation annotation : annotations) { annotation.detach(); } annotations = myAnnotations.get(); for( CDIAnnotation annotation : annotations ){ annotation.detach(); } myModelAnnotations.set( Collections.<CDIAnnotation>emptyList()); myAnnotations.set( Collections.<CDIAnnotation>emptyList()); } }; PROCESSOR.submit(runnable); } } }
private EditorCookie currentEditorCookie() { EditorCookie newCurrent = computeCurrentEditorCookie(); if (currentEditor != newCurrent) { // re-register a property change listener to the new editor if ((currentEditor != null) && (currentEditor instanceof EditorCookie.Observable)) { ((EditorCookie.Observable)currentEditor).removePropertyChangeListener(this); } if ((newCurrent != null) && (newCurrent instanceof EditorCookie.Observable)) { ((EditorCookie.Observable)newCurrent).addPropertyChangeListener(this); } // remember the new editor currentEditor = newCurrent; } return currentEditor; }