1 17 package org.eclipse.emf.ecore.sdo.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.ecore.change.provider.ChangeDescriptionItemProvider; 26 import org.eclipse.emf.ecore.sdo.EChangeSummary; 27 import org.eclipse.emf.ecore.sdo.SDOPackage; 28 import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; 29 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; 30 import org.eclipse.emf.edit.provider.IItemLabelProvider; 31 import org.eclipse.emf.edit.provider.IItemPropertySource; 32 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; 33 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; 34 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; 35 36 37 import org.eclipse.emf.edit.provider.ViewerNotification; 38 39 45 public class EChangeSummaryItemProvider 46 extends ChangeDescriptionItemProvider 47 implements 48 IEditingDomainItemProvider, 49 IStructuredItemContentProvider, 50 ITreeItemContentProvider, 51 IItemLabelProvider, 52 IItemPropertySource 53 { 54 60 public EChangeSummaryItemProvider(AdapterFactory adapterFactory) 61 { 62 super(adapterFactory); 63 } 64 65 71 public List getPropertyDescriptors(Object object) 72 { 73 if (itemPropertyDescriptors == null) 74 { 75 super.getPropertyDescriptors(object); 76 77 addLoggingPropertyDescriptor(object); 78 } 79 return itemPropertyDescriptors; 80 } 81 82 88 protected void addLoggingPropertyDescriptor(Object object) 89 { 90 itemPropertyDescriptors.add 91 (createItemPropertyDescriptor 92 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 93 getResourceLocator(), 94 getString("_UI_ChangeSummary_logging_feature"), 95 getString("_UI_PropertyDescriptor_description", "_UI_ChangeSummary_logging_feature", "_UI_ChangeSummary_type"), 96 SDOPackage.eINSTANCE.getChangeSummary_Logging(), 97 false, 98 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, 99 null, 100 null)); 101 } 102 103 109 public String getText(Object object) 110 { 111 EChangeSummary eChangeSummary = (EChangeSummary)object; 112 return "Changes - logging=" + eChangeSummary.isLogging(); 115 } 116 117 124 public void notifyChanged(Notification notification) 125 { 126 updateChildren(notification); 127 128 switch (notification.getFeatureID(EChangeSummary.class)) 129 { 130 case SDOPackage.ECHANGE_SUMMARY__LOGGING: 131 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); 132 return; 133 } 134 super.notifyChanged(notification); 135 } 136 137 143 public ResourceLocator getResourceLocator() 144 { 145 return SDOEditPlugin.INSTANCE; 146 } 147 148 } 149 | Popular Tags |