001 /*
002 * Copyright 2002 - 2007 JEuclid, http://jeuclid.sf.net
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 /* $Id: ChangeTrackingInterface.java 310 2007-05-18 20:26:36Z maxberger $ */
018
019 package net.sourceforge.jeuclid.dom;
020
021 /**
022 * Interface for nodes which are capable of tracking changes.
023 *
024 * @author Max Berger
025 * @version $Revision: 310 $
026 */
027 public interface ChangeTrackingInterface {
028 /**
029 * Called when the element has changed.
030 *
031 * @param propagate
032 * if set to true, change is also fired on parent and
033 * registered listeners.
034 */
035 void fireChanged(boolean propagate);
036
037 /**
038 * Adds a change listener to this element.
039 *
040 * @param listener
041 * the element to be notified in case of changes (if propagate
042 * is set).
043 */
044 void addListener(ChangeTrackingInterface listener);
045
046 /**
047 * fires a change on this element and all its children, but no listeners
048 * and parents.
049 */
050 void fireChangeForSubTree();
051 }