[Jsxe-cvs] SF.net SVN: jsxe: [1174] branches/jsxe2
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-08-27 20:09:22
|
Revision: 1174 Author: ian_lewis Date: 2006-08-27 13:09:13 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1174&view=rev Log Message: ----------- Added a PropertyChangeEvent class for when properties change in the XMLDocument Modified Paths: -------------- branches/jsxe2/build.xml branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentEvent.java branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentListener.java Added Paths: ----------- branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/PropertyChangeEvent.java Modified: branches/jsxe2/build.xml =================================================================== --- branches/jsxe2/build.xml 2006-08-27 18:55:21 UTC (rev 1173) +++ branches/jsxe2/build.xml 2006-08-27 20:09:13 UTC (rev 1174) @@ -141,8 +141,8 @@ <include name="**/*.png"/> <!-- files in the source directory to ignore --> - <exclude name="net/sourceforge/jsxe/dom2/**/*"/> - <exclude name="net/sourceforge/jsxe/io/**/*"/> + <!--<exclude name="net/sourceforge/jsxe/dom2/**/*"/> + <exclude name="net/sourceforge/jsxe/io/**/*"/>--> </fileset> </copy> <mkdir dir="${build.plugin}"/> Added: branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/PropertyChangeEvent.java =================================================================== --- branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/PropertyChangeEvent.java (rev 0) +++ branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/PropertyChangeEvent.java 2006-08-27 20:09:13 UTC (rev 1174) @@ -0,0 +1,88 @@ +/* +PropertyChangedEvent.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version.e + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.dom2.event; + +import net.sourceforge.jsxe.dom2.*; +import java.util.EventObject; + +/** + * PropertyChangedEvents occur when a property in the XMLDocument is changed. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @see XMLDocument + * @since jsXe XX.XX + */ +public class PropertyChangeEvent extends EventObject { + + private XMLDocument m_document; + private String m_oldValue; + private String m_newValue; + private String m_key; + + //{{{ PropertyChangeEvent constructor + /** + * Creates a new PropertyChangeEvent. + */ + public PropertyChangeEvent(XMLDocument doc, String name, String oldValue, String newValue) { + super(doc); + m_key = name; + m_oldValue = oldValue; + m_newValue = newValue; + }//}}} + + //{{{ getDocument() + /** + * Gets the document that was updated. + */ + public XMLDocument getDocument() { + return (XMLDocument)getSource(); + }//}}} + + //{{{ getOldValue() + /** + * Gets the old value of the property. + */ + public String getOldValue() { + return m_oldValue; + }//}}} + + //{{{ getNewValue() + /** + * Gets the new value of the property. + */ + public String getNewValue() { + return m_newValue; + }//}}} + + //{{{ getName() + /** + * Gets the name of the property that was changed. + */ + public String getName() { + return m_key; + }//}}} + +} \ No newline at end of file Modified: branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentEvent.java =================================================================== --- branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentEvent.java 2006-08-27 18:55:21 UTC (rev 1173) +++ branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentEvent.java 2006-08-27 20:09:13 UTC (rev 1174) @@ -34,7 +34,7 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ * @see XMLDocument - * @since jsXe 0.5 pre3 + * @since jsXe XX.XX */ public class XMLDocumentEvent extends EventObject { Modified: branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentListener.java =================================================================== --- branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentListener.java 2006-08-27 18:55:21 UTC (rev 1173) +++ branches/jsxe2/src/net/sourceforge/jsxe/dom2/event/XMLDocumentListener.java 2006-08-27 20:09:13 UTC (rev 1174) @@ -27,9 +27,19 @@ import net.sourceforge.jsxe.dom2.*; import java.util.EventListener; +/** + * An XMLDocumentListener listens for changes to an XMLDocument. Components + * that need to recieve notification when the document changes should implement + * this interface. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @see XMLDocument + * @since jsXe XX.XX + */ public interface XMLDocumentListener extends EventListener { - public void propertyChanged(PropertyChangedEvent event); + public void propertyChanged(PropertyChangeEvent event); public void insertUpdate(XMLDocumentEvent event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |