1 11 package org.eclipse.ui.views.framelist; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.util.IPropertyChangeListener; 15 import org.eclipse.jface.util.PropertyChangeEvent; 16 17 22 public abstract class FrameAction extends Action { 23 private FrameList frameList; 24 25 private IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() { 26 public void propertyChange(PropertyChangeEvent event) { 27 FrameAction.this.handlePropertyChange(event); 28 } 29 }; 30 31 37 protected FrameAction(FrameList frameList) { 38 this.frameList = frameList; 39 frameList.addPropertyChangeListener(propertyChangeListener); 40 } 41 42 46 public void dispose() { 47 frameList.removePropertyChangeListener(propertyChangeListener); 48 } 49 50 53 public FrameList getFrameList() { 54 return frameList; 55 } 56 57 61 protected void handlePropertyChange(PropertyChangeEvent event) { 62 update(); 63 } 64 65 69 public void update() { 70 } 71 72 } 73 | Popular Tags |