List of usage examples for javax.swing.text Document removeDocumentListener
public void removeDocumentListener(DocumentListener listener);
From source file:de.unentscheidbar.validation.swing.trigger.DocumentChangeTrigger.java
private void forgetDocument(Document doc, JComponent component) { if (doc == null) { return;/*w w w. j a va2 s . c om*/ } Wrapper<Document> docIdentity = Beans.identity(doc); documentMap.remove(docIdentity, Beans.identity(component)); if (!documentMap.containsKey(docIdentity)) { doc.removeDocumentListener(this); } }
From source file:de.unentscheidbar.validation.swing.trigger.DocumentChangeTrigger.java
private void observeDocument(JComponent component) { Document doc = DocumentGetter.INSTANCE.apply(component); Wrapper<Document> docIdentity = Beans.identity(doc); Wrapper<JComponent> componentIdentity = Beans.identity(component); /* Don't listen more than once to each document */ documentMap.remove(docIdentity, componentIdentity); if (!documentMap.containsKey(docIdentity)) { doc.removeDocumentListener(this); doc.addDocumentListener(this); }//from w w w . ja v a 2 s . co m documentMap.put(docIdentity, componentIdentity); }
From source file:org.nuclos.client.ui.collect.component.CollectableComboBox.java
public void removeDocumentListenerForEditor() { if (doclistener != null) { final Document document = getEditorDocument(); if (document != null) { document.removeDocumentListener(getDocumentListener()); }// ww w. j av a 2 s . c o m } }