Package ca.odell.glazedlists.impl.filter

Examples of ca.odell.glazedlists.impl.filter.TextMatcher


        // using the textField in a TextComponentMatcherEditor will install a DocumentListener
        TextComponentMatcherEditor<String> textMatcherEditor = new TextComponentMatcherEditor<String>(textField, GlazedLists.toStringTextFilterator(), true);
        assertEquals(originalDocumentAListenerCount+1, documentA.getDocumentListeners().length);
        assertEquals(originalDocumentBListenerCount, documentB.getDocumentListeners().length);
        TextMatcher textMatcher = (TextMatcher) textMatcherEditor.getMatcher();
        assertEquals("documentA", textMatcher.getSearchTerms()[0].getText());

        // replace DocumentA with DocumentB, which should update the filter with the text from DocumentB
        textField.setDocument(documentB);
        assertEquals(0, documentA.getDocumentListeners().length);
        assertEquals(originalDocumentBListenerCount+3, documentB.getDocumentListeners().length);
        textMatcher = (TextMatcher) textMatcherEditor.getMatcher();
        assertEquals("documentB", textMatcher.getSearchTerms()[0].getText());

        // changing the text in DocumentB should alter the filter
        documentB.replace(0, documentB.getLength(), "blah", null);
        textMatcher = (TextMatcher) textMatcherEditor.getMatcher();
        assertEquals("blah", textMatcher.getSearchTerms()[0].getText());
    }
View Full Code Here

TOP

Related Classes of ca.odell.glazedlists.impl.filter.TextMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.