View Javadoc
1 /* 2 * ==================================================================== 3 * 4 * This code is subject to the freebxml License, Version 1.1 5 * 6 * Copyright (c) 2003 freebxml.org. All rights reserved. 7 * 8 * ==================================================================== 9 */ 10 package com.sun.xml.registry.client.browser.swing; 11 12 import javax.swing.JPanel; 13 import javax.swing.event.DocumentEvent; 14 15 /*** 16 * Implements a document listener for a MappedPanel. 17 * 18 * The removeUpdate method only invokes update if the mapping is not 19 * currently changing. Otherwise, the update might erase the text field, 20 * trigger a new DocumentEvent and create an infinite loop. 21 * 22 * @author Fabian Ritzmann 23 */ 24 public abstract class MappedDocumentListener 25 extends RegistryDocumentListener { 26 27 /*** 28 * Initializes the object. 29 * 30 * @param p The panel on which the listener operates. 31 * 32 * @param error A text that is prepended to the exception that may be 33 * thrown by the setText method. 34 */ 35 public MappedDocumentListener(RegistryMappedPanel p, String error) { 36 super(p, error); 37 } 38 39 40 /*** 41 * Only invokes update if the current mapping is not changing. 42 * 43 * @see javax.swing.event.DocumentListener#removeUpdate(DocumentEvent) 44 */ 45 public void removeUpdate(DocumentEvent e) { 46 if (! ((RegistryMappedPanel) this.panel).mappingIsChanging()) { 47 update(e); 48 } 49 } 50 51 }

This page was automatically generated by Maven