1 7 package Olj.provider; 8 9 10 import Olj.ImportDefinitionType; 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.ComposeableAdapterFactory; 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 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; 31 import org.eclipse.emf.edit.provider.ItemProviderAdapter; 32 import org.eclipse.emf.edit.provider.ViewerNotification; 33 34 40 public class ImportDefinitionTypeItemProvider 41 extends ItemProviderAdapter 42 implements 43 IEditingDomainItemProvider, 44 IStructuredItemContentProvider, 45 ITreeItemContentProvider, 46 IItemLabelProvider, 47 IItemPropertySource { 48 54 public ImportDefinitionTypeItemProvider(AdapterFactory adapterFactory) { 55 super(adapterFactory); 56 } 57 58 64 public List getPropertyDescriptors(Object object) { 65 if (itemPropertyDescriptors == null) { 66 super.getPropertyDescriptors(object); 67 68 addCommitCountPropertyDescriptor(object); 69 addDataCutOffPropertyDescriptor(object); 70 addLogModePropertyDescriptor(object); 71 addNamePropertyDescriptor(object); 72 addObjectIDAutoCreatePropertyDescriptor(object); 73 addObjectIDColumnNamePropertyDescriptor(object); 74 addObjectIDIncrementPropertyDescriptor(object); 75 addObjectIDNameColumnNamePropertyDescriptor(object); 76 addObjectIDNameColumnValuePropertyDescriptor(object); 77 addObjectIDStartValuePropertyDescriptor(object); 78 addObjectIDTableNamePropertyDescriptor(object); 79 addOnErrorContinuePropertyDescriptor(object); 80 addReturnCodePropertyDescriptor(object); 81 addSelectStatementPropertyDescriptor(object); 82 addSetCursorNamePropertyDescriptor(object); 83 addSetFetchSizePropertyDescriptor(object); 84 addTableNamePropertyDescriptor(object); 85 } 86 return itemPropertyDescriptors; 87 } 88 89 95 protected void addCommitCountPropertyDescriptor(Object object) { 96 itemPropertyDescriptors.add 97 (new ItemPropertyDescriptor 98 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 99 getResourceLocator(), 100 getString("_UI_ImportDefinitionType_commitCount_feature"), 101 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_commitCount_feature", "_UI_ImportDefinitionType_type"), 102 OljPackage.eINSTANCE.getImportDefinitionType_CommitCount(), 103 true, 104 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 105 } 106 107 113 protected void addDataCutOffPropertyDescriptor(Object object) { 114 itemPropertyDescriptors.add 115 (new ItemPropertyDescriptor 116 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 117 getResourceLocator(), 118 getString("_UI_ImportDefinitionType_dataCutOff_feature"), 119 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_dataCutOff_feature", "_UI_ImportDefinitionType_type"), 120 OljPackage.eINSTANCE.getImportDefinitionType_DataCutOff(), 121 true, 122 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 123 } 124 125 131 protected void addLogModePropertyDescriptor(Object object) { 132 itemPropertyDescriptors.add 133 (new ItemPropertyDescriptor 134 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 135 getResourceLocator(), 136 getString("_UI_ImportDefinitionType_logMode_feature"), 137 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_logMode_feature", "_UI_ImportDefinitionType_type"), 138 OljPackage.eINSTANCE.getImportDefinitionType_LogMode(), 139 true, 140 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 141 } 142 143 149 protected void addNamePropertyDescriptor(Object object) { 150 itemPropertyDescriptors.add 151 (new ItemPropertyDescriptor 152 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 153 getResourceLocator(), 154 getString("_UI_ImportDefinitionType_name_feature"), 155 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_name_feature", "_UI_ImportDefinitionType_type"), 156 OljPackage.eINSTANCE.getImportDefinitionType_Name(), 157 true, 158 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 159 } 160 161 167 protected void addObjectIDAutoCreatePropertyDescriptor(Object object) { 168 itemPropertyDescriptors.add 169 (new ItemPropertyDescriptor 170 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 171 getResourceLocator(), 172 getString("_UI_ImportDefinitionType_objectIDAutoCreate_feature"), 173 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDAutoCreate_feature", "_UI_ImportDefinitionType_type"), 174 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDAutoCreate(), 175 true, 176 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 177 } 178 179 185 protected void addObjectIDColumnNamePropertyDescriptor(Object object) { 186 itemPropertyDescriptors.add 187 (new ItemPropertyDescriptor 188 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 189 getResourceLocator(), 190 getString("_UI_ImportDefinitionType_objectIDColumnName_feature"), 191 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDColumnName_feature", "_UI_ImportDefinitionType_type"), 192 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDColumnName(), 193 true, 194 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 195 } 196 197 203 protected void addObjectIDIncrementPropertyDescriptor(Object object) { 204 itemPropertyDescriptors.add 205 (new ItemPropertyDescriptor 206 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 207 getResourceLocator(), 208 getString("_UI_ImportDefinitionType_objectIDIncrement_feature"), 209 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDIncrement_feature", "_UI_ImportDefinitionType_type"), 210 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDIncrement(), 211 true, 212 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 213 } 214 215 221 protected void addObjectIDNameColumnNamePropertyDescriptor(Object object) { 222 itemPropertyDescriptors.add 223 (new ItemPropertyDescriptor 224 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 225 getResourceLocator(), 226 getString("_UI_ImportDefinitionType_objectIDNameColumnName_feature"), 227 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDNameColumnName_feature", "_UI_ImportDefinitionType_type"), 228 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDNameColumnName(), 229 true, 230 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 231 } 232 233 239 protected void addObjectIDNameColumnValuePropertyDescriptor(Object object) { 240 itemPropertyDescriptors.add 241 (new ItemPropertyDescriptor 242 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 243 getResourceLocator(), 244 getString("_UI_ImportDefinitionType_objectIDNameColumnValue_feature"), 245 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDNameColumnValue_feature", "_UI_ImportDefinitionType_type"), 246 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDNameColumnValue(), 247 true, 248 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 249 } 250 251 257 protected void addObjectIDStartValuePropertyDescriptor(Object object) { 258 itemPropertyDescriptors.add 259 (new ItemPropertyDescriptor 260 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 261 getResourceLocator(), 262 getString("_UI_ImportDefinitionType_objectIDStartValue_feature"), 263 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDStartValue_feature", "_UI_ImportDefinitionType_type"), 264 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDStartValue(), 265 true, 266 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 267 } 268 269 275 protected void addObjectIDTableNamePropertyDescriptor(Object object) { 276 itemPropertyDescriptors.add 277 (new ItemPropertyDescriptor 278 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 279 getResourceLocator(), 280 getString("_UI_ImportDefinitionType_objectIDTableName_feature"), 281 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_objectIDTableName_feature", "_UI_ImportDefinitionType_type"), 282 OljPackage.eINSTANCE.getImportDefinitionType_ObjectIDTableName(), 283 true, 284 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 285 } 286 287 293 protected void addOnErrorContinuePropertyDescriptor(Object object) { 294 itemPropertyDescriptors.add 295 (new ItemPropertyDescriptor 296 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 297 getResourceLocator(), 298 getString("_UI_ImportDefinitionType_onErrorContinue_feature"), 299 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_onErrorContinue_feature", "_UI_ImportDefinitionType_type"), 300 OljPackage.eINSTANCE.getImportDefinitionType_OnErrorContinue(), 301 true, 302 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 303 } 304 305 311 protected void addReturnCodePropertyDescriptor(Object object) { 312 itemPropertyDescriptors.add 313 (new ItemPropertyDescriptor 314 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 315 getResourceLocator(), 316 getString("_UI_ImportDefinitionType_returnCode_feature"), 317 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_returnCode_feature", "_UI_ImportDefinitionType_type"), 318 OljPackage.eINSTANCE.getImportDefinitionType_ReturnCode(), 319 true, 320 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 321 } 322 323 329 protected void addSelectStatementPropertyDescriptor(Object object) { 330 itemPropertyDescriptors.add 331 (new ItemPropertyDescriptor 332 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 333 getResourceLocator(), 334 getString("_UI_ImportDefinitionType_selectStatement_feature"), 335 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_selectStatement_feature", "_UI_ImportDefinitionType_type"), 336 OljPackage.eINSTANCE.getImportDefinitionType_SelectStatement(), 337 true, 338 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 339 } 340 341 347 protected void addSetCursorNamePropertyDescriptor(Object object) { 348 itemPropertyDescriptors.add 349 (new ItemPropertyDescriptor 350 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 351 getResourceLocator(), 352 getString("_UI_ImportDefinitionType_setCursorName_feature"), 353 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_setCursorName_feature", "_UI_ImportDefinitionType_type"), 354 OljPackage.eINSTANCE.getImportDefinitionType_SetCursorName(), 355 true, 356 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 357 } 358 359 365 protected void addSetFetchSizePropertyDescriptor(Object object) { 366 itemPropertyDescriptors.add 367 (new ItemPropertyDescriptor 368 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 369 getResourceLocator(), 370 getString("_UI_ImportDefinitionType_setFetchSize_feature"), 371 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_setFetchSize_feature", "_UI_ImportDefinitionType_type"), 372 OljPackage.eINSTANCE.getImportDefinitionType_SetFetchSize(), 373 true, 374 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 375 } 376 377 383 protected void addTableNamePropertyDescriptor(Object object) { 384 itemPropertyDescriptors.add 385 (new ItemPropertyDescriptor 386 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), 387 getResourceLocator(), 388 getString("_UI_ImportDefinitionType_tableName_feature"), 389 getString("_UI_PropertyDescriptor_description", "_UI_ImportDefinitionType_tableName_feature", "_UI_ImportDefinitionType_type"), 390 OljPackage.eINSTANCE.getImportDefinitionType_TableName(), 391 true, 392 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); 393 } 394 395 403 public Collection getChildrenFeatures(Object object) { 404 if (childrenFeatures == null) { 405 super.getChildrenFeatures(object); 406 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_JdbcParameters()); 407 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_SortColumns()); 408 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_ValueColumns()); 409 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_Tables()); 410 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_VariableColumns()); 411 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_ConstantColumns()); 412 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_RelationColumns()); 413 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_Transformations()); 414 childrenFeatures.add(OljPackage.eINSTANCE.getImportDefinitionType_CounterColumns()); 415 } 416 return childrenFeatures; 417 } 418 419 424 protected EStructuralFeature getChildFeature(Object object, Object child) { 425 428 return super.getChildFeature(object, child); 429 } 430 431 437 public Object getImage(Object object) { 438 return getResourceLocator().getImage("full/obj16/ImportDefinitionType"); 439 } 440 441 447 public String getText(Object object) { 448 String label = ((ImportDefinitionType)object).getName(); 449 return label == null || label.length() == 0 ? 450 getString("_UI_ImportDefinitionType_type") : 451 getString("_UI_ImportDefinitionType_type") + " " + label; 452 } 453 454 461 public void notifyChanged(Notification notification) { 462 updateChildren(notification); 463 464 switch (notification.getFeatureID(ImportDefinitionType.class)) { 465 case OljPackage.IMPORT_DEFINITION_TYPE__COMMIT_COUNT: 466 case OljPackage.IMPORT_DEFINITION_TYPE__DATA_CUT_OFF: 467 case OljPackage.IMPORT_DEFINITION_TYPE__LOG_MODE: 468 case OljPackage.IMPORT_DEFINITION_TYPE__NAME: 469 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_AUTO_CREATE: 470 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_COLUMN_NAME: 471 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_INCREMENT: 472 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_NAME_COLUMN_NAME: 473 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_NAME_COLUMN_VALUE: 474 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_START_VALUE: 475 case OljPackage.IMPORT_DEFINITION_TYPE__OBJECT_ID_TABLE_NAME: 476 case OljPackage.IMPORT_DEFINITION_TYPE__ON_ERROR_CONTINUE: 477 case OljPackage.IMPORT_DEFINITION_TYPE__RETURN_CODE: 478 case OljPackage.IMPORT_DEFINITION_TYPE__SELECT_STATEMENT: 479 case OljPackage.IMPORT_DEFINITION_TYPE__SET_CURSOR_NAME: 480 case OljPackage.IMPORT_DEFINITION_TYPE__SET_FETCH_SIZE: 481 case OljPackage.IMPORT_DEFINITION_TYPE__TABLE_NAME: 482 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); 483 return; 484 case OljPackage.IMPORT_DEFINITION_TYPE__JDBC_PARAMETERS: 485 case OljPackage.IMPORT_DEFINITION_TYPE__SORT_COLUMNS: 486 case OljPackage.IMPORT_DEFINITION_TYPE__VALUE_COLUMNS: 487 case OljPackage.IMPORT_DEFINITION_TYPE__TABLES: 488 case OljPackage.IMPORT_DEFINITION_TYPE__VARIABLE_COLUMNS: 489 case OljPackage.IMPORT_DEFINITION_TYPE__CONSTANT_COLUMNS: 490 case OljPackage.IMPORT_DEFINITION_TYPE__RELATION_COLUMNS: 491 case OljPackage.IMPORT_DEFINITION_TYPE__TRANSFORMATIONS: 492 case OljPackage.IMPORT_DEFINITION_TYPE__COUNTER_COLUMNS: 493 fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); 494 return; 495 } 496 super.notifyChanged(notification); 497 } 498 499 506 protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { 507 super.collectNewChildDescriptors(newChildDescriptors, object); 508 509 newChildDescriptors.add 510 (createChildParameter 511 (OljPackage.eINSTANCE.getImportDefinitionType_JdbcParameters(), 512 OljFactory.eINSTANCE.createJdbcParametersType())); 513 514 newChildDescriptors.add 515 (createChildParameter 516 (OljPackage.eINSTANCE.getImportDefinitionType_SortColumns(), 517 OljFactory.eINSTANCE.createSortColumnsType())); 518 519 newChildDescriptors.add 520 (createChildParameter 521 (OljPackage.eINSTANCE.getImportDefinitionType_ValueColumns(), 522 OljFactory.eINSTANCE.createValueColumnsType())); 523 524 newChildDescriptors.add 525 (createChildParameter 526 (OljPackage.eINSTANCE.getImportDefinitionType_Tables(), 527 OljFactory.eINSTANCE.createTablesType())); 528 529 newChildDescriptors.add 530 (createChildParameter 531 (OljPackage.eINSTANCE.getImportDefinitionType_VariableColumns(), 532 OljFactory.eINSTANCE.createVariableColumnsType())); 533 534 newChildDescriptors.add 535 (createChildParameter 536 (OljPackage.eINSTANCE.getImportDefinitionType_ConstantColumns(), 537 OljFactory.eINSTANCE.createConstantColumnsType())); 538 539 newChildDescriptors.add 540 (createChildParameter 541 (OljPackage.eINSTANCE.getImportDefinitionType_RelationColumns(), 542 OljFactory.eINSTANCE.createRelationColumnsType())); 543 544 newChildDescriptors.add 545 (createChildParameter 546 (OljPackage.eINSTANCE.getImportDefinitionType_Transformations(), 547 OljFactory.eINSTANCE.createTransformationsType())); 548 549 newChildDescriptors.add 550 (createChildParameter 551 (OljPackage.eINSTANCE.getImportDefinitionType_CounterColumns(), 552 OljFactory.eINSTANCE.createCounterColumnsType())); 553 } 554 555 561 public ResourceLocator getResourceLocator() { 562 return OljEditPlugin.INSTANCE; 563 } 564 565 } 566 | Popular Tags |