KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > memory > PropertyChangeNotifier


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.debug.internal.ui.views.memory;
13
14 import org.eclipse.core.runtime.ISafeRunnable;
15 import org.eclipse.debug.internal.ui.DebugUIPlugin;
16 import org.eclipse.jface.util.IPropertyChangeListener;
17 import org.eclipse.jface.util.PropertyChangeEvent;
18
19 /**
20  * Fire properties changes events in ISafeRunnable to ensure that
21  * exceptions are caught and handled.
22  * @since 3.1
23  */

24 public class PropertyChangeNotifier implements ISafeRunnable
25 {
26     
27     IPropertyChangeListener fListener;
28     PropertyChangeEvent fEvt;
29     
30     public PropertyChangeNotifier(IPropertyChangeListener listener, PropertyChangeEvent evt)
31     {
32         fListener = listener;
33         fEvt = evt;
34     }
35     
36     /* (non-Javadoc)
37      * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
38      */

39     public void handleException(Throwable JavaDoc exception) {
40         DebugUIPlugin.log(exception);
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.core.runtime.ISafeRunnable#run()
45      */

46     public void run() throws Exception JavaDoc {
47         fListener.propertyChange(fEvt);
48     }
49 }
50
Popular Tags