1 11 package org.eclipse.pde.core; 12 17 public class ModelChangedEvent implements IModelChangedEvent { 18 private int type; 19 private IModelChangeProvider provider; 20 private Object [] changedObjects; 21 private Object oldValue, newValue; 22 private String changedProperty; 23 35 public ModelChangedEvent(IModelChangeProvider provider, int type, 36 Object [] objects, String changedProperty) { 37 this.type = type; 38 this.provider = provider; 39 this.changedObjects = objects; 40 this.changedProperty = changedProperty; 41 } 42 56 public ModelChangedEvent(IModelChangeProvider provider, Object object, 57 String changedProperty, Object oldValue, Object newValue) { 58 this.type = CHANGE; 59 this.provider = provider; 60 this.changedObjects = new Object []{object}; 61 this.changedProperty = changedProperty; 62 this.oldValue = oldValue; 63 this.newValue = newValue; 64 } 65 68 public IModelChangeProvider getChangeProvider() { 69 return provider; 70 } 71 74 public Object [] getChangedObjects() { 75 return (changedObjects == null) ? new Object [0] : changedObjects; 76 } 77 80 public String getChangedProperty() { 81 return changedProperty; 82 } 83 88 public Object getOldValue() { 89 return oldValue; 90 } 91 96 public Object getNewValue() { 97 return newValue; 98 } 99 106 public int getChangeType() { 107 return type; 108 } 109 } 110 | Popular Tags |