/** * (c) Urs Zeidler */ package de.urszeidler.eclipse.shr5.gameplay.provider; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; import de.urszeidler.eclipse.shr5.gameplay.GameplayFactory; import de.urszeidler.eclipse.shr5.gameplay.GameplayPackage; import de.urszeidler.eclipse.shr5.gameplay.ProbeCommand; /** * This is the item provider adapter for a {@link de.urszeidler.eclipse.shr5.gameplay.ProbeCommand} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class ProbeCommandItemProvider extends SubjectCommandItemProvider { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ProbeCommandItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addProbePropertyDescriptor(object); addSuccessesPropertyDescriptor(object); addGlitchesPropertyDescriptor(object); addLimitPropertyDescriptor(object); addProbeStatePropertyDescriptor(object); addSkipTestPropertyDescriptor(object); addPushTheLimitPropertyDescriptor(object); addSecondChancePropertyDescriptor(object); addCloseCallPropertyDescriptor(object); addThresholdsPropertyDescriptor(object); addNetHitsPropertyDescriptor(object); addTestStatePropertyDescriptor(object); addModsPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the Probe feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addProbePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_probe_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_probe_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__PROBE, false, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Successes feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addSuccessesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_successes_feature"), getString("_UI_Probe_successes_description"), GameplayPackage.Literals.PROBE__SUCCESSES, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Glitches feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addGlitchesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_glitches_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_glitches_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__GLITCHES, false, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Limit feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addLimitPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_limit_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_limit_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__LIMIT, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Probe State feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addProbeStatePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_probeState_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_probeState_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__PROBE_STATE, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Skip Test feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addSkipTestPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_skipTest_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_skipTest_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__SKIP_TEST, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Push The Limit feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addPushTheLimitPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_pushTheLimit_feature"), getString("_UI_Probe_pushTheLimit_description"), GameplayPackage.Literals.PROBE__PUSH_THE_LIMIT, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Second Chance feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addSecondChancePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_secondChance_feature"), getString("_UI_Probe_secondChance_description"), GameplayPackage.Literals.PROBE__SECOND_CHANCE, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Close Call feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addCloseCallPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Probe_closeCall_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Probe_closeCall_feature", "_UI_Probe_type"), GameplayPackage.Literals.PROBE__CLOSE_CALL, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Thresholds feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addThresholdsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SuccesTest_thresholds_feature"), getString("_UI_SuccesTest_thresholds_description"), GameplayPackage.Literals.SUCCES_TEST__THRESHOLDS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Net Hits feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addNetHitsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SuccesTest_netHits_feature"), getString("_UI_SuccesTest_netHits_description"), GameplayPackage.Literals.SUCCES_TEST__NET_HITS, false, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Test State feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addTestStatePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_SuccesTest_testState_feature"), getString("_UI_PropertyDescriptor_description", "_UI_SuccesTest_testState_feature", "_UI_SuccesTest_type"), GameplayPackage.Literals.SUCCES_TEST__TEST_STATE, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the Mods feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addModsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ProbeCommand_mods_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ProbeCommand_mods_feature", "_UI_ProbeCommand_type"), GameplayPackage.Literals.PROBE_COMMAND__MODS, true, false, false, ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); } /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { if (childrenFeatures == null) { super.getChildrenFeatures(object); childrenFeatures.add(GameplayPackage.Literals.PROBE__PROBE_MODS); } return childrenFeatures; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EStructuralFeature getChildFeature(Object object, Object child) { // Check the type of the specified child object and return the proper feature to use for // adding (see {@link AddCommand}) it as a child. return super.getChildFeature(object, child); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { ProbeCommand probeCommand = (ProbeCommand)object; return getString("_UI_ProbeCommand_type") + " " + probeCommand.isExecuted(); } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ProbeCommand.class)) { case GameplayPackage.PROBE_COMMAND__PROBE: case GameplayPackage.PROBE_COMMAND__SUCCESSES: case GameplayPackage.PROBE_COMMAND__GLITCHES: case GameplayPackage.PROBE_COMMAND__LIMIT: case GameplayPackage.PROBE_COMMAND__PROBE_STATE: case GameplayPackage.PROBE_COMMAND__SKIP_TEST: case GameplayPackage.PROBE_COMMAND__PUSH_THE_LIMIT: case GameplayPackage.PROBE_COMMAND__SECOND_CHANCE: case GameplayPackage.PROBE_COMMAND__CLOSE_CALL: case GameplayPackage.PROBE_COMMAND__THRESHOLDS: case GameplayPackage.PROBE_COMMAND__NET_HITS: case GameplayPackage.PROBE_COMMAND__TEST_STATE: case GameplayPackage.PROBE_COMMAND__MODS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case GameplayPackage.PROBE_COMMAND__PROBE_MODS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (GameplayPackage.Literals.PROBE__PROBE_MODS, GameplayFactory.eINSTANCE.createProbeMod())); } }