1 7 package Olj.provider; 8 9 10 import Olj.JdbcParametersType; 11 import Olj.OljFactory; 12 import Olj.OljPackage; 13 14 import java.util.Collection ; 15 import java.util.List ; 16 17 import org.eclipse.emf.common.notify.AdapterFactory; 18 import org.eclipse.emf.common.notify.Notification; 19 20 import org.eclipse.emf.common.util.ResourceLocator; 21 22 import org.eclipse.emf.ecore.EStructuralFeature; 23 24 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; 25 import org.eclipse.emf.edit.provider.IItemLabelProvider; 26 import org.eclipse.emf.edit.provider.IItemPropertySource; 27 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; 28 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; 29 import org.eclipse.emf.edit.provider.ItemProviderAdapter; 30 import org.eclipse.emf.edit.provider.ViewerNotification; 31 32 38 public class JdbcParametersTypeItemProvider 39 extends ItemProviderAdapter 40 implements 41 IEditingDomainItemProvider, 42 IStructuredItemContentProvider, 43 ITreeItemContentProvider, 44 IItemLabelProvider, 45 IItemPropertySource { 46 52 public JdbcParametersTypeItemProvider(AdapterFactory adapterFactory) { 53 super(adapterFactory); 54 } 55 56 62 public List getPropertyDescriptors(Object object) { 63 if (itemPropertyDescriptors == null) { 64 super.getPropertyDescriptors(object); 65 66 } 67 return itemPropertyDescriptors; 68 } 69 70 78 public Collection getChildrenFeatures(Object object) { 79 if (childrenFeatures == null) { 80 super.getChildrenFeatures(object); 81 childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceTargetParameters()); 82 childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceParameters()); 83 childrenFeatures.add(OljPackage.eINSTANCE.getJdbcParametersType_JdbcTargetParameters()); 84 } 85 return childrenFeatures; 86 } 87 88 93 protected EStructuralFeature getChildFeature(Object object, Object child) { 94 97 return super.getChildFeature(object, child); 98 } 99 100 106 public Object getImage(Object object) { 107 return getResourceLocator().getImage("full/obj16/JdbcParametersType"); 108 } 109 110 116 public String getText(Object object) { 117 return getString("_UI_JdbcParametersType_type"); 118 } 119 120 127 public void notifyChanged(Notification notification) { 128 updateChildren(notification); 129 130 switch (notification.getFeatureID(JdbcParametersType.class)) { 131 case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_SOURCE_TARGET_PARAMETERS: 132 case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_SOURCE_PARAMETERS: 133 case OljPackage.JDBC_PARAMETERS_TYPE__JDBC_TARGET_PARAMETERS: 134 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); 135 return; 136 } 137 super.notifyChanged(notification); 138 } 139 140 147 protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { 148 super.collectNewChildDescriptors(newChildDescriptors, object); 149 150 newChildDescriptors.add 151 (createChildParameter 152 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceTargetParameters(), 153 OljFactory.eINSTANCE.createJdbcSourceTargetParametersType())); 154 155 newChildDescriptors.add 156 (createChildParameter 157 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcSourceParameters(), 158 OljFactory.eINSTANCE.createJdbcSourceParametersType())); 159 160 newChildDescriptors.add 161 (createChildParameter 162 (OljPackage.eINSTANCE.getJdbcParametersType_JdbcTargetParameters(), 163 OljFactory.eINSTANCE.createJdbcTargetParametersType())); 164 } 165 166 172 public ResourceLocator getResourceLocator() { 173 return OljEditPlugin.INSTANCE; 174 } 175 176 } 177 | Popular Tags |