1 7 package Olj.provider; 8 9 10 import Olj.JdbcSourceTargetParametersType; 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 JdbcSourceTargetParametersTypeItemProvider 39 extends ItemProviderAdapter 40 implements 41 IEditingDomainItemProvider, 42 IStructuredItemContentProvider, 43 ITreeItemContentProvider, 44 IItemLabelProvider, 45 IItemPropertySource { 46 52 public JdbcSourceTargetParametersTypeItemProvider(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.getJdbcSourceTargetParametersType_JdbcSourceParameters()); 82 childrenFeatures.add(OljPackage.eINSTANCE.getJdbcSourceTargetParametersType_JdbcTargetParameters()); 83 } 84 return childrenFeatures; 85 } 86 87 92 protected EStructuralFeature getChildFeature(Object object, Object child) { 93 96 return super.getChildFeature(object, child); 97 } 98 99 105 public Object getImage(Object object) { 106 return getResourceLocator().getImage("full/obj16/JdbcSourceTargetParametersType"); 107 } 108 109 115 public String getText(Object object) { 116 return getString("_UI_JdbcSourceTargetParametersType_type"); 117 } 118 119 126 public void notifyChanged(Notification notification) { 127 updateChildren(notification); 128 129 switch (notification.getFeatureID(JdbcSourceTargetParametersType.class)) { 130 case OljPackage.JDBC_SOURCE_TARGET_PARAMETERS_TYPE__JDBC_SOURCE_PARAMETERS: 131 case OljPackage.JDBC_SOURCE_TARGET_PARAMETERS_TYPE__JDBC_TARGET_PARAMETERS: 132 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); 133 return; 134 } 135 super.notifyChanged(notification); 136 } 137 138 145 protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { 146 super.collectNewChildDescriptors(newChildDescriptors, object); 147 148 newChildDescriptors.add 149 (createChildParameter 150 (OljPackage.eINSTANCE.getJdbcSourceTargetParametersType_JdbcSourceParameters(), 151 OljFactory.eINSTANCE.createJdbcSourceParametersType())); 152 153 newChildDescriptors.add 154 (createChildParameter 155 (OljPackage.eINSTANCE.getJdbcSourceTargetParametersType_JdbcTargetParameters(), 156 OljFactory.eINSTANCE.createJdbcTargetParametersType())); 157 } 158 159 165 public ResourceLocator getResourceLocator() { 166 return OljEditPlugin.INSTANCE; 167 } 168 169 } 170 | Popular Tags |