~adrian-wilkins/ubuntu/quantal/freemind/fix-file-association

« back to all changes in this revision

Viewing changes to freemind/freemind/common/PropertyBean.java

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-01-03 14:19:19 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100103141919-m5az7dkicy21hqop
Tags: 0.9.0~rc6+dfsg-1ubuntu1
* Merge from Debian unstable (LP: #182927), remaining changes:
  - debian/copyright: add license/copyright for
    freemind/freemind/main/ExampleFileFilter.java

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*FreeMind - A Program for creating and viewing Mindmaps
 
2
 *Copyright (C) 2000-2006  Joerg Mueller, Daniel Polansky, Christian Foltin and others.
 
3
 *
 
4
 *See COPYING for Details
 
5
 *
 
6
 *This program is free software; you can redistribute it and/or
 
7
 *modify it under the terms of the GNU General Public License
 
8
 *as published by the Free Software Foundation; either version 2
 
9
 *of the License, or (at your option) any later version.
 
10
 *
 
11
 *This program is distributed in the hope that it will be useful,
 
12
 *but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *GNU General Public License for more details.
 
15
 *
 
16
 *You should have received a copy of the GNU General Public License
 
17
 *along with this program; if not, write to the Free Software
 
18
 *Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 *
 
20
 * Created on 25.02.2006
 
21
 */
 
22
/*$Id: PropertyBean.java,v 1.1.2.2 2006/02/28 18:56:50 christianfoltin Exp $*/
 
23
package freemind.common;
 
24
 
 
25
import java.beans.PropertyChangeEvent;
 
26
import java.beans.PropertyChangeListener;
 
27
import java.util.Iterator;
 
28
import java.util.Vector;
 
29
 
 
30
public abstract class PropertyBean {
 
31
    
 
32
    private Vector mPropertyChangeListeners = new Vector();
 
33
    
 
34
        /** The key of the property. */
 
35
        public abstract String getLabel();
 
36
 
 
37
        public abstract void setValue(String value);
 
38
 
 
39
        public abstract String getValue();
 
40
 
 
41
    public void addPropertyChangeListener(PropertyChangeListener listener) {
 
42
        mPropertyChangeListeners.add(listener);
 
43
    }
 
44
    public void removePropertyChangeListener(PropertyChangeListener listener) {
 
45
        mPropertyChangeListeners.remove(listener);
 
46
    }
 
47
    
 
48
    protected void firePropertyChangeEvent() {
 
49
        PropertyChangeEvent evt = new PropertyChangeEvent(this, getLabel(), null, getValue());
 
50
        for (Iterator i = mPropertyChangeListeners.iterator(); i.hasNext();)
 
51
        {
 
52
            PropertyChangeListener listener = (PropertyChangeListener) i.next();
 
53
            listener.propertyChange(evt);
 
54
        }
 
55
    }
 
56
}
 
 
b'\\ No newline at end of file'