1 11 12 package org.eclipse.jface.viewers; 13 14 import org.eclipse.core.commands.common.EventManager; 15 import org.eclipse.jface.util.SafeRunnable; 16 17 24 public class BaseLabelProvider extends EventManager implements IBaseLabelProvider { 25 26 29 public void addListener(ILabelProviderListener listener) { 30 addListenerObject(listener); 31 } 32 33 38 public void dispose() { 39 clearListeners(); 40 } 41 42 47 public boolean isLabelProperty(Object element, String property) { 48 return true; 49 } 50 51 52 55 public void removeListener(ILabelProviderListener listener) { 56 removeListenerObject(listener); 57 } 58 59 68 protected void fireLabelProviderChanged(final LabelProviderChangedEvent event) { 69 Object [] listeners = getListeners(); 70 for (int i = 0; i < listeners.length; ++i) { 71 final ILabelProviderListener l = (ILabelProviderListener) listeners[i]; 72 SafeRunnable.run(new SafeRunnable() { 73 public void run() { 74 l.labelProviderChanged(event); 75 } 76 }); 77 78 } 79 } 80 } 81 | Popular Tags |