1 11 12 package org.eclipse.jface.action; 13 14 import org.eclipse.core.commands.common.EventManager; 15 import org.eclipse.jface.util.IPropertyChangeListener; 16 import org.eclipse.jface.util.PropertyChangeEvent; 17 18 30 public abstract class AbstractAction extends EventManager implements IAction { 31 32 public void addPropertyChangeListener(final IPropertyChangeListener listener) { 33 addListenerObject(listener); 34 } 35 36 45 protected final void firePropertyChange(final PropertyChangeEvent event) { 46 final Object [] list = getListeners(); 47 for (int i = 0; i < list.length; ++i) { 48 ((IPropertyChangeListener) list[i]).propertyChange(event); 49 } 50 } 51 52 68 protected final void firePropertyChange(final String propertyName, 69 final Object oldValue, final Object newValue) { 70 if (isListenerAttached()) { 71 firePropertyChange(new PropertyChangeEvent(this, propertyName, 72 oldValue, newValue)); 73 } 74 } 75 76 public void removePropertyChangeListener( 77 final IPropertyChangeListener listener) { 78 removeListenerObject(listener); 79 } 80 81 } 82 | Popular Tags |