1 17 package org.eclipse.emf.ecore.provider; 18 19 20 import java.util.Collection ; 21 import java.util.List ; 22 23 import org.eclipse.emf.common.notify.AdapterFactory; 24 import org.eclipse.emf.common.notify.Notification; 25 import org.eclipse.emf.common.util.ResourceLocator; 26 import org.eclipse.emf.ecore.EParameter; 27 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; 28 import org.eclipse.emf.edit.provider.IItemLabelProvider; 29 import org.eclipse.emf.edit.provider.IItemPropertySource; 30 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; 31 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; 32 33 34 40 public class EParameterItemProvider 41 extends ETypedElementItemProvider 42 implements 43 IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource 44 { 45 51 public EParameterItemProvider(AdapterFactory adapterFactory) 52 { 53 super(adapterFactory); 54 } 55 56 62 public List getPropertyDescriptors(Object object) 63 { 64 if (itemPropertyDescriptors == null) 65 { 66 super.getPropertyDescriptors(object); 67 68 } 69 return itemPropertyDescriptors; 70 } 71 72 78 public Object getImage(Object object) 79 { 80 return getResourceLocator().getImage("full/obj16/EParameter"); 81 } 82 83 89 public String getText(Object object) 90 { 91 EParameter eParameter = (EParameter)object; 92 StringBuffer result = new StringBuffer (); 93 result.append(eParameter.getName()); 94 if (eParameter.getEType() != null) 95 { 96 result.append(" : "); 97 result.append(eParameter.getEType().getName()); 98 } 99 return result.toString(); 100 } 101 102 109 public void notifyChanged(Notification notification) 110 { 111 updateChildren(notification); 112 super.notifyChanged(notification); 113 } 114 115 122 protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) 123 { 124 super.collectNewChildDescriptors(newChildDescriptors, object); 125 } 126 127 133 public ResourceLocator getResourceLocator() 134 { 135 return EcoreEditPlugin.INSTANCE; 136 } 137 138 } 139 | Popular Tags |