| /* |
| * Copyright (c) 2005, 2016 IBM Corporation, Embarcadero Technologies, CEA, and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM - initial API and implementation |
| * Kenn Hussey (Embarcadero Technologies) - 215418, 204200 |
| * Kenn Hussey - 323181 |
| * Kenn Hussey (CEA) - 327039, 418466, 414970, 370089, 459723, 464702 |
| * |
| */ |
| package org.eclipse.uml2.uml.edit.providers; |
| |
| import java.util.Collection; |
| import java.util.List; |
| |
| import org.eclipse.emf.common.command.Command; |
| import org.eclipse.emf.common.notify.AdapterFactory; |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| |
| import org.eclipse.emf.edit.domain.EditingDomain; |
| 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 org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; |
| import org.eclipse.uml2.common.edit.command.SubsetSupersetSetCommand; |
| import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; |
| import org.eclipse.uml2.uml.State; |
| import org.eclipse.uml2.uml.UMLFactory; |
| import org.eclipse.uml2.uml.UMLPackage; |
| |
| /** |
| * This is the item provider adapter for a {@link org.eclipse.uml2.uml.State} object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class StateItemProvider |
| extends NamespaceItemProvider { |
| |
| /** |
| * This constructs an instance from a factory and a notifier. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public StateItemProvider(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); |
| |
| addIsLeafPropertyDescriptor(object); |
| addRedefinedElementPropertyDescriptor(object); |
| addRedefinitionContextPropertyDescriptor(object); |
| addContainerPropertyDescriptor(object); |
| addIncomingPropertyDescriptor(object); |
| addOutgoingPropertyDescriptor(object); |
| addConnectionPropertyDescriptor(object); |
| addConnectionPointPropertyDescriptor(object); |
| addDeferrableTriggerPropertyDescriptor(object); |
| addDoActivityPropertyDescriptor(object); |
| addEntryPropertyDescriptor(object); |
| addExitPropertyDescriptor(object); |
| addIsCompositePropertyDescriptor(object); |
| addIsOrthogonalPropertyDescriptor(object); |
| addIsSimplePropertyDescriptor(object); |
| addIsSubmachineStatePropertyDescriptor(object); |
| addRedefinedStatePropertyDescriptor(object); |
| addStateInvariantPropertyDescriptor(object); |
| addSubmachinePropertyDescriptor(object); |
| addRegionPropertyDescriptor(object); |
| } |
| return itemPropertyDescriptors; |
| } |
| |
| /** |
| * This adds a property descriptor for the Is Leaf feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIsLeafPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_RedefinableElement_isLeaf_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_RedefinableElement_isLeaf_feature", "_UI_RedefinableElement_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.REDEFINABLE_ELEMENT__IS_LEAF, true, false, |
| false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Redefined Element feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addRedefinedElementPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_RedefinableElement_redefinedElement_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_RedefinableElement_redefinedElement_feature", "_UI_RedefinableElement_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.REDEFINABLE_ELEMENT__REDEFINED_ELEMENT, |
| false, false, false, null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Redefinition Context feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addRedefinitionContextPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_RedefinableElement_redefinitionContext_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_RedefinableElement_redefinitionContext_feature", "_UI_RedefinableElement_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.REDEFINABLE_ELEMENT__REDEFINITION_CONTEXT, |
| false, false, false, null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Container feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addContainerPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_Vertex_container_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_Vertex_container_feature", "_UI_Vertex_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.VERTEX__CONTAINER, true, false, true, null, |
| null, new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Outgoing feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addOutgoingPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_Vertex_outgoing_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_Vertex_outgoing_feature", "_UI_Vertex_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.VERTEX__OUTGOING, false, false, false, |
| null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Incoming feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIncomingPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_Vertex_incoming_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_Vertex_incoming_feature", "_UI_Vertex_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.VERTEX__INCOMING, false, false, false, |
| null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Is Composite feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIsCompositePropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_isComposite_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_isComposite_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__IS_COMPOSITE, false, false, false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Is Orthogonal feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIsOrthogonalPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_isOrthogonal_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_isOrthogonal_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__IS_ORTHOGONAL, false, false, false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Is Simple feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIsSimplePropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_isSimple_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_isSimple_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__IS_SIMPLE, false, false, false, |
| ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Is Submachine State feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addIsSubmachineStatePropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_isSubmachineState_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_isSubmachineState_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__IS_SUBMACHINE_STATE, false, false, |
| false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Submachine feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addSubmachinePropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_submachine_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_submachine_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__SUBMACHINE, true, false, true, null, |
| null, null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the Connection feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addConnectionPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_connection_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_connection_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__CONNECTION, true, false, true, null, |
| null, new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Connection Point feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addConnectionPointPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_connectionPoint_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_connectionPoint_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__CONNECTION_POINT, true, false, true, |
| null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Redefined State feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addRedefinedStatePropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_redefinedState_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_redefinedState_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__REDEFINED_STATE, true, false, true, |
| null, null, null)); |
| } |
| |
| /** |
| * This adds a property descriptor for the State Invariant feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addStateInvariantPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_stateInvariant_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_stateInvariant_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__STATE_INVARIANT, true, false, true, |
| null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Entry feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addEntryPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_entry_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_entry_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__ENTRY, true, false, true, null, |
| null, new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Exit feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addExitPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_exit_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_exit_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__EXIT, true, false, true, null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Do Activity feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addDoActivityPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_doActivity_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_doActivity_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__DO_ACTIVITY, true, false, true, |
| null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Deferrable Trigger feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addDeferrableTriggerPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_deferrableTrigger_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_deferrableTrigger_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER, true, false, |
| true, null, null, |
| new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * This adds a property descriptor for the Region feature. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected void addRegionPropertyDescriptor(Object object) { |
| itemPropertyDescriptors |
| .add(createItemPropertyDescriptor( |
| ((ComposeableAdapterFactory) adapterFactory) |
| .getRootAdapterFactory(), |
| getResourceLocator(), |
| getString("_UI_State_region_feature"), //$NON-NLS-1$ |
| getString( |
| "_UI_PropertyDescriptor_description", "_UI_State_region_feature", "_UI_State_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| UMLPackage.Literals.STATE__REGION, true, false, true, null, |
| null, new String[]{"org.eclipse.ui.views.properties.expert" //$NON-NLS-1$ |
| })); |
| } |
| |
| /** |
| * 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(UMLPackage.Literals.STATE__CONNECTION); |
| childrenFeatures.add(UMLPackage.Literals.STATE__CONNECTION_POINT); |
| childrenFeatures.add(UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER); |
| childrenFeatures.add(UMLPackage.Literals.STATE__DO_ACTIVITY); |
| childrenFeatures.add(UMLPackage.Literals.STATE__ENTRY); |
| childrenFeatures.add(UMLPackage.Literals.STATE__EXIT); |
| childrenFeatures.add(UMLPackage.Literals.STATE__REGION); |
| } |
| 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 State.gif. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object getImage(Object object) { |
| return overlayImage(object, |
| getResourceLocator().getImage("full/obj16/State")); //$NON-NLS-1$ |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected boolean shouldComposeCreationImage() { |
| return true; |
| } |
| |
| /** |
| * This returns the label text for the adapted class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| @Override |
| public String getText(Object object) { |
| return appendLabel( |
| appendType(appendKeywords(new StringBuffer(), object), |
| "_UI_State_type"), object).toString(); //$NON-NLS-1$ |
| } |
| |
| /** |
| * 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(State.class)) { |
| case UMLPackage.STATE__IS_LEAF : |
| case UMLPackage.STATE__IS_COMPOSITE : |
| case UMLPackage.STATE__IS_ORTHOGONAL : |
| case UMLPackage.STATE__IS_SIMPLE : |
| case UMLPackage.STATE__IS_SUBMACHINE_STATE : |
| fireNotifyChanged(new ViewerNotification(notification, |
| notification.getNotifier(), false, true)); |
| return; |
| case UMLPackage.STATE__CONNECTION : |
| case UMLPackage.STATE__CONNECTION_POINT : |
| case UMLPackage.STATE__DEFERRABLE_TRIGGER : |
| case UMLPackage.STATE__DO_ACTIVITY : |
| case UMLPackage.STATE__ENTRY : |
| case UMLPackage.STATE__EXIT : |
| case UMLPackage.STATE__STATE_INVARIANT : |
| case UMLPackage.STATE__REGION : |
| 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( |
| UMLPackage.Literals.STATE__CONNECTION, |
| UMLFactory.eINSTANCE.createConnectionPointReference())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__CONNECTION_POINT, |
| UMLFactory.eINSTANCE.createPseudostate())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER, |
| UMLFactory.eINSTANCE.createTrigger())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createProtocolStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createOpaqueBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createFunctionBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, |
| UMLFactory.eINSTANCE.createInteraction())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createProtocolStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createOpaqueBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createFunctionBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, |
| UMLFactory.eINSTANCE.createInteraction())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createProtocolStateMachine())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createOpaqueBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createFunctionBehavior())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, |
| UMLFactory.eINSTANCE.createInteraction())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, |
| UMLFactory.eINSTANCE.createConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, |
| UMLFactory.eINSTANCE.createInteractionConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, |
| UMLFactory.eINSTANCE.createIntervalConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, |
| UMLFactory.eINSTANCE.createDurationConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, |
| UMLFactory.eINSTANCE.createTimeConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__REGION, |
| UMLFactory.eINSTANCE.createRegion())); |
| } |
| |
| /** |
| * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getCreateChildText(Object owner, Object feature, |
| Object child, Collection<?> selection) { |
| Object childFeature = feature; |
| Object childObject = child; |
| |
| boolean qualify = childFeature == UMLPackage.Literals.NAMESPACE__OWNED_RULE |
| || childFeature == UMLPackage.Literals.STATE__STATE_INVARIANT |
| || childFeature == UMLPackage.Literals.STATE__DO_ACTIVITY |
| || childFeature == UMLPackage.Literals.STATE__ENTRY |
| || childFeature == UMLPackage.Literals.STATE__EXIT; |
| |
| if (qualify) { |
| return getString("_UI_CreateChild_text2", //$NON-NLS-1$ |
| new Object[]{getTypeText(childObject), |
| getFeatureText(childFeature), getTypeText(owner)}); |
| } |
| return super.getCreateChildText(owner, feature, child, selection); |
| } |
| |
| /** |
| * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected Command createRemoveCommand(EditingDomain domain, EObject owner, |
| EStructuralFeature feature, Collection<?> collection) { |
| if (feature == UMLPackage.Literals.NAMESPACE__OWNED_RULE) { |
| return new SupersetRemoveCommand( |
| domain, |
| owner, |
| feature, |
| new EStructuralFeature[]{UMLPackage.Literals.STATE__STATE_INVARIANT}, |
| collection); |
| } |
| return super.createRemoveCommand(domain, owner, feature, collection); |
| } |
| |
| /** |
| * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, java.util.Collection) |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected Command createReplaceCommand(EditingDomain domain, EObject owner, |
| EStructuralFeature feature, Object value, Collection<?> collection) { |
| if (feature == UMLPackage.Literals.NAMESPACE__OWNED_RULE) { |
| return new SubsetSupersetReplaceCommand( |
| domain, |
| owner, |
| feature, |
| null, |
| new EStructuralFeature[]{UMLPackage.Literals.STATE__STATE_INVARIANT}, |
| value, collection); |
| } |
| return super.createReplaceCommand(domain, owner, feature, value, |
| collection); |
| } |
| |
| /** |
| * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createSetCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object) |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected Command createSetCommand(EditingDomain domain, EObject owner, |
| EStructuralFeature feature, Object value) { |
| if (feature == UMLPackage.Literals.STATE__STATE_INVARIANT) { |
| return new SubsetSupersetSetCommand( |
| domain, |
| owner, |
| feature, |
| new EStructuralFeature[]{UMLPackage.Literals.NAMESPACE__OWNED_RULE}, |
| null, value); |
| } |
| if (feature == UMLPackage.Literals.NAMESPACE__OWNED_RULE) { |
| return new SubsetSupersetSetCommand( |
| domain, |
| owner, |
| feature, |
| null, |
| new EStructuralFeature[]{UMLPackage.Literals.STATE__STATE_INVARIANT}, |
| value); |
| } |
| return super.createSetCommand(domain, owner, feature, value); |
| } |
| |
| } |