ApproximationAdaptationItemProvider.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /**
  2. */
  3. package ua.ansymo.hintco.provider;
  4. import java.util.Collection;
  5. import java.util.List;
  6. import org.eclipse.emf.common.notify.AdapterFactory;
  7. import org.eclipse.emf.common.notify.Notification;
  8. import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
  9. import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
  10. import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
  11. import org.eclipse.emf.edit.provider.ViewerNotification;
  12. import ua.ansymo.hintco.ApproximationAdaptation;
  13. import ua.ansymo.hintco.HintcoPackage;
  14. /**
  15. * This is the item provider adapter for a {@link ua.ansymo.hintco.ApproximationAdaptation} object.
  16. * <!-- begin-user-doc -->
  17. * <!-- end-user-doc -->
  18. * @generated
  19. */
  20. public class ApproximationAdaptationItemProvider extends PortAdaptationItemProvider {
  21. /**
  22. * This constructs an instance from a factory and a notifier.
  23. * <!-- begin-user-doc -->
  24. * <!-- end-user-doc -->
  25. * @generated
  26. */
  27. public ApproximationAdaptationItemProvider(AdapterFactory adapterFactory) {
  28. super(adapterFactory);
  29. }
  30. /**
  31. * This returns the property descriptors for the adapted class.
  32. * <!-- begin-user-doc -->
  33. * <!-- end-user-doc -->
  34. * @generated
  35. */
  36. @Override
  37. public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
  38. if (itemPropertyDescriptors == null) {
  39. super.getPropertyDescriptors(object);
  40. addOrderPropertyDescriptor(object);
  41. }
  42. return itemPropertyDescriptors;
  43. }
  44. /**
  45. * This adds a property descriptor for the Order feature.
  46. * <!-- begin-user-doc -->
  47. * <!-- end-user-doc -->
  48. * @generated
  49. */
  50. protected void addOrderPropertyDescriptor(Object object) {
  51. itemPropertyDescriptors.add
  52. (createItemPropertyDescriptor
  53. (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
  54. getResourceLocator(),
  55. getString("_UI_ApproximationAdaptation_order_feature"),
  56. getString("_UI_PropertyDescriptor_description", "_UI_ApproximationAdaptation_order_feature", "_UI_ApproximationAdaptation_type"),
  57. HintcoPackage.Literals.APPROXIMATION_ADAPTATION__ORDER,
  58. true,
  59. false,
  60. false,
  61. ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
  62. null,
  63. null));
  64. }
  65. /**
  66. * This returns the label text for the adapted class.
  67. * <!-- begin-user-doc -->
  68. * <!-- end-user-doc -->
  69. * @generated
  70. */
  71. @Override
  72. public String getText(Object object) {
  73. ApproximationAdaptation approximationAdaptation = (ApproximationAdaptation)object;
  74. return getString("_UI_ApproximationAdaptation_type") + " " + approximationAdaptation.getWeight();
  75. }
  76. /**
  77. * This handles model notifications by calling {@link #updateChildren} to update any cached
  78. * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
  79. * <!-- begin-user-doc -->
  80. * <!-- end-user-doc -->
  81. * @generated
  82. */
  83. @Override
  84. public void notifyChanged(Notification notification) {
  85. updateChildren(notification);
  86. switch (notification.getFeatureID(ApproximationAdaptation.class)) {
  87. case HintcoPackage.APPROXIMATION_ADAPTATION__ORDER:
  88. fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
  89. return;
  90. }
  91. super.notifyChanged(notification);
  92. }
  93. /**
  94. * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
  95. * that can be created under this object.
  96. * <!-- begin-user-doc -->
  97. * <!-- end-user-doc -->
  98. * @generated
  99. */
  100. @Override
  101. protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
  102. super.collectNewChildDescriptors(newChildDescriptors, object);
  103. }
  104. }