1 11 package org.eclipse.update.internal.ui.model; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.jface.resource.*; 15 import org.eclipse.ui.model.*; 16 17 18 public class UIModelObject extends PlatformObject implements IWorkbenchAdapter { 19 UpdateModel model; 20 21 public void setModel(UpdateModel model) { 22 this.model = model; 23 } 24 25 public UpdateModel getModel() { 26 return model; 27 } 28 29 protected void notifyObjectChanged(String property) { 30 if (model==null) return; 31 model.fireObjectChanged(this, property); 32 } 33 34 protected void notifyObjectsAdded(Object parent, Object [] objects) { 35 if (model==null) return; 36 model.fireObjectsAdded(parent, objects); 37 } 38 39 protected void notifyObjectsRemoved(Object parent, Object [] objects) { 40 if (model==null) return; 41 model.fireObjectsRemoved(parent, objects); 42 } 43 44 public Object [] getChildren(Object obj) { 45 return new Object [0]; 46 } 47 48 public Object getParent(Object obj) { 49 return null; 50 } 51 public String getLabel(Object obj) { 52 return toString(); 53 } 54 public ImageDescriptor getImageDescriptor(Object obj) { 55 return null; 56 } 57 } 58 | Popular Tags |