1 11 package org.eclipse.team.ui.history; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.jface.util.IPropertyChangeListener; 15 import org.eclipse.team.internal.ui.PropertyChangeHandler; 16 import org.eclipse.ui.part.Page; 17 18 25 public abstract class HistoryPage extends Page implements IHistoryPage, IAdaptable { 26 27 private IHistoryPageSite site; 28 private Object input; 29 private IHistoryView historyView; 30 private PropertyChangeHandler fChangeHandler; 31 32 35 public void setSite(IHistoryPageSite site) { 36 this.site = site; 37 } 38 39 42 public IHistoryPageSite getHistoryPageSite() { 43 return site; 44 } 45 46 47 50 public Object getInput() { 51 return input; 52 } 53 54 57 public boolean setInput(Object object) { 58 this.input = object; 59 return inputSet(); 60 } 61 62 68 public abstract boolean inputSet(); 69 70 71 public void setHistoryView(IHistoryView historyView){ 72 this.historyView=historyView; 73 } 74 75 78 public IHistoryView getHistoryView() { 79 if (historyView != null) 80 return historyView; 81 82 return null; 83 } 84 85 88 public synchronized void addPropertyChangeListener(IPropertyChangeListener listener) { 89 if (fChangeHandler == null) { 90 fChangeHandler = new PropertyChangeHandler(); 91 } 92 fChangeHandler.addPropertyChangeListener(listener); 93 } 94 95 98 public void removePropertyChangeListener(IPropertyChangeListener listener) { 99 if (fChangeHandler != null) { 100 fChangeHandler.removePropertyChangeListener(listener); 101 } 102 } 103 104 113 protected void firePropertyChange(Object source, String property, Object oldValue, Object newValue) { 114 if (fChangeHandler == null) { 115 return; 116 } 117 fChangeHandler.firePropertyChange(source, property, oldValue, newValue); 118 } 119 } 120 | Popular Tags |