1 17 package org.eclipse.emf.mapping.provider; 18 19 20 import java.util.List ; 21 22 import org.eclipse.emf.common.notify.AdapterFactory; 23 import org.eclipse.emf.common.notify.Notification; 24 import org.eclipse.emf.common.util.ResourceLocator; 25 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; 26 import org.eclipse.emf.edit.provider.IItemLabelProvider; 27 import org.eclipse.emf.edit.provider.IItemPropertySource; 28 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; 29 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; 30 32 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; 33 import org.eclipse.emf.mapping.MappingPackage; 34 import org.eclipse.emf.mapping.MappingPlugin; 35 36 38 39 42 public class FunctionPairItemProvider 43 extends TypeConverterItemProvider 44 implements 45 IEditingDomainItemProvider, 46 IStructuredItemContentProvider, 47 ITreeItemContentProvider, 48 IItemLabelProvider, 49 IItemPropertySource 50 { 51 54 public FunctionPairItemProvider(AdapterFactory adapterFactory) 55 { 56 super(adapterFactory); 57 } 58 59 62 public List getPropertyDescriptors(Object object) 63 { 64 if (itemPropertyDescriptors == null) 65 { 66 super.getPropertyDescriptors(object); 67 68 MappingPackage ePackage = MappingPackage.eINSTANCE; 70 71 itemPropertyDescriptors.add 74 (new ItemPropertyDescriptor 75 (adapterFactory, 76 MappingPlugin.getPlugin().getString("_UI_In2out_property_label"), 77 MappingPlugin.getPlugin().getString("_UI_In2out_property_description"), 78 ePackage.getFunctionPair_In2out())); 79 80 itemPropertyDescriptors.add 83 (new ItemPropertyDescriptor 84 (adapterFactory, 85 MappingPlugin.getPlugin().getString("_UI_Out2in_property_label"), 86 MappingPlugin.getPlugin().getString("_UI_Out2in_property_description"), 87 ePackage.getFunctionPair_Out2in())); 88 89 } 90 return itemPropertyDescriptors; 91 } 92 93 96 public Object getImage(Object object) 97 { 98 return MappingPlugin.getPlugin().getImage("full/obj16/FunctionPair"); 99 } 100 101 public String getText(Object object) 102 { 103 return "FunctionPair"; 104 } 105 106 109 public void notifyChanged(Notification msg) 110 { 111 MappingPackage ePackage = MappingPackage.eINSTANCE; 113 if (msg.getFeature() == ePackage.getFunctionPair_In2out() || msg.getFeature() == ePackage.getFunctionPair_Out2in()) 114 { 115 fireNotifyChanged(msg); 116 return; 118 } 119 super.notifyChanged(msg); 120 } 121 122 128 public ResourceLocator getResourceLocator() 129 { 130 return MappingPlugin.INSTANCE; 131 } 132 133 } 134 | Popular Tags |