1 7 package Olj.provider; 8 9 10 import Olj.CopyTableType; 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.edit.provider.ComposeableAdapterFactory; 23 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; 24 import org.eclipse.emf.edit.provider.IItemLabelProvider; 25 import org.eclipse.emf.edit.provider.IItemPropertySource; 26 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; 27 import org.eclipse.emf.edit.provider.ITreeItemContentProvider; 28 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; 29 import org.eclipse.emf.edit.provider.ItemProviderAdapter; 30 import org.eclipse.emf.edit.provider.ViewerNotification; 31 32 38 public class CopyTableTypeItemProvider 39 extends ItemProviderAdapter 40 implements 41 IEditingDomainItemProvider, 42 IStructuredItemContentProvider, 43 ITreeItemContentProvider, 44 IItemLabelProvider, 45 IItemPropertySource { 46 52 public CopyTableTypeItemProvider(AdapterFactory adapterFactory) { 53 super(adapterFactory); 54 } 55 56 62 public List getPropertyDescriptors(Object object) { 63 if (itemPropertyDescriptors == null) { 64 super.getPropertyDescriptors(object); 65 66 addCommitCountPropertyDescriptor(object); 67 addLogModePropertyDescriptor(object); 68 addNamePropertyDescriptor(object); 69 addObjectIDIncrementPropertyDescriptor(object); 70 addOidLogicPropertyDescriptor(object); 71 addOnErrorContinuePropertyDescriptor(object); 72 addSetCursorNamePropertyDescriptor(object); 73 addSetFetchSizePropertyDescriptor(object); 74 addSourceTableNamePropertyDescriptor(object); 75 addTargetTableNamePropertyDescriptor(object); 76 } 77 return itemPropertyDescriptors; 78 } 79 80 86 protected void addCommitCountPropertyDescriptor(Object object) { 87 itemPropertyDescriptors.add 88 (new ItemPropertyDescriptor 89 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 90 getResourceLocator(), 91 getString("_UI_CopyTableType_commitCount_feature"), 92 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_commitCount_feature", "_UI_CopyTableType_type"), 93 OljPackage.eINSTANCE.getCopyTableType_CommitCount(), 94 true, 95 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 96 } 97 98 104 protected void addLogModePropertyDescriptor(Object object) { 105 itemPropertyDescriptors.add 106 (new ItemPropertyDescriptor 107 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 108 getResourceLocator(), 109 getString("_UI_CopyTableType_logMode_feature"), 110 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_logMode_feature", "_UI_CopyTableType_type"), 111 OljPackage.eINSTANCE.getCopyTableType_LogMode(), 112 true, 113 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 114 } 115 116 122 protected void addNamePropertyDescriptor(Object object) { 123 itemPropertyDescriptors.add 124 (new ItemPropertyDescriptor 125 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 126 getResourceLocator(), 127 getString("_UI_CopyTableType_name_feature"), 128 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_name_feature", "_UI_CopyTableType_type"), 129 OljPackage.eINSTANCE.getCopyTableType_Name(), 130 true, 131 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 132 } 133 134 140 protected void addObjectIDIncrementPropertyDescriptor(Object object) { 141 itemPropertyDescriptors.add 142 (new ItemPropertyDescriptor 143 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 144 getResourceLocator(), 145 getString("_UI_CopyTableType_objectIDIncrement_feature"), 146 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_objectIDIncrement_feature", "_UI_CopyTableType_type"), 147 OljPackage.eINSTANCE.getCopyTableType_ObjectIDIncrement(), 148 true, 149 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 150 } 151 152 158 protected void addOidLogicPropertyDescriptor(Object object) { 159 itemPropertyDescriptors.add 160 (new ItemPropertyDescriptor 161 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 162 getResourceLocator(), 163 getString("_UI_CopyTableType_oidLogic_feature"), 164 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_oidLogic_feature", "_UI_CopyTableType_type"), 165 OljPackage.eINSTANCE.getCopyTableType_OidLogic(), 166 true, 167 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 168 } 169 170 176 protected void addOnErrorContinuePropertyDescriptor(Object object) { 177 itemPropertyDescriptors.add 178 (new ItemPropertyDescriptor 179 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 180 getResourceLocator(), 181 getString("_UI_CopyTableType_onErrorContinue_feature"), 182 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_onErrorContinue_feature", "_UI_CopyTableType_type"), 183 OljPackage.eINSTANCE.getCopyTableType_OnErrorContinue(), 184 true, 185 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 186 } 187 188 194 protected void addSetCursorNamePropertyDescriptor(Object object) { 195 itemPropertyDescriptors.add 196 (new ItemPropertyDescriptor 197 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 198 getResourceLocator(), 199 getString("_UI_CopyTableType_setCursorName_feature"), 200 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_setCursorName_feature", "_UI_CopyTableType_type"), 201 OljPackage.eINSTANCE.getCopyTableType_SetCursorName(), 202 true, 203 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 204 } 205 206 212 protected void addSetFetchSizePropertyDescriptor(Object object) { 213 itemPropertyDescriptors.add 214 (new ItemPropertyDescriptor 215 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 216 getResourceLocator(), 217 getString("_UI_CopyTableType_setFetchSize_feature"), 218 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_setFetchSize_feature", "_UI_CopyTableType_type"), 219 OljPackage.eINSTANCE.getCopyTableType_SetFetchSize(), 220 true, 221 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 222 } 223 224 230 protected void addSourceTableNamePropertyDescriptor(Object object) { 231 itemPropertyDescriptors.add 232 (new ItemPropertyDescriptor 233 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 234 getResourceLocator(), 235 getString("_UI_CopyTableType_sourceTableName_feature"), 236 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_sourceTableName_feature", "_UI_CopyTableType_type"), 237 OljPackage.eINSTANCE.getCopyTableType_SourceTableName(), 238 true, 239 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 240 } 241 242 248 protected void addTargetTableNamePropertyDescriptor(Object object) { 249 itemPropertyDescriptors.add 250 (new ItemPropertyDescriptor 251 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 252 getResourceLocator(), 253 getString("_UI_CopyTableType_targetTableName_feature"), 254 getString("_UI_PropertyDescriptor_description", "_UI_CopyTableType_targetTableName_feature", "_UI_CopyTableType_type"), 255 OljPackage.eINSTANCE.getCopyTableType_TargetTableName(), 256 true, 257 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 258 } 259 260 268 public Collection getChildrenFeatures(Object object) { 269 if (childrenFeatures == null) { 270 super.getChildrenFeatures(object); 271 childrenFeatures.add(OljPackage.eINSTANCE.getCopyTableType_JdbcParameters()); 272 } 273 return childrenFeatures; 274 } 275 276 282 public Object getImage(Object object) { 283 return getResourceLocator().getImage("full/obj16/CopyTableType"); 284 } 285 286 292 public String getText(Object object) { 293 String label = ((CopyTableType)object).getName(); 294 return label == null || label.length() == 0 ? 295 getString("_UI_CopyTableType_type") : 296 getString("_UI_CopyTableType_type") + " " + label; 297 } 298 299 306 public void notifyChanged(Notification notification) { 307 updateChildren(notification); 308 309 switch (notification.getFeatureID(CopyTableType.class)) { 310 case OljPackage.COPY_TABLE_TYPE__COMMIT_COUNT: 311 case OljPackage.COPY_TABLE_TYPE__LOG_MODE: 312 case OljPackage.COPY_TABLE_TYPE__NAME: 313 case OljPackage.COPY_TABLE_TYPE__OBJECT_ID_INCREMENT: 314 case OljPackage.COPY_TABLE_TYPE__OID_LOGIC: 315 case OljPackage.COPY_TABLE_TYPE__ON_ERROR_CONTINUE: 316 case OljPackage.COPY_TABLE_TYPE__SET_CURSOR_NAME: 317 case OljPackage.COPY_TABLE_TYPE__SET_FETCH_SIZE: 318 case OljPackage.COPY_TABLE_TYPE__SOURCE_TABLE_NAME: 319 case OljPackage.COPY_TABLE_TYPE__TARGET_TABLE_NAME: 320 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); 321 return; 322 case OljPackage.COPY_TABLE_TYPE__JDBC_PARAMETERS: 323 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); 324 return; 325 } 326 super.notifyChanged(notification); 327 } 328 329 336 protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { 337 super.collectNewChildDescriptors(newChildDescriptors, object); 338 339 newChildDescriptors.add 340 (createChildParameter 341 (OljPackage.eINSTANCE.getCopyTableType_JdbcParameters(), 342 OljFactory.eINSTANCE.createJdbcParametersType())); 343 } 344 345 351 public ResourceLocator getResourceLocator() { 352 return OljEditPlugin.INSTANCE; 353 } 354 355 } 356 | Popular Tags |