| /* |
| * Copyright (c) 2005, 2007 IBM Corporation 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 |
| * |
| * $Id: StateItemProvider.java,v 1.9 2007/01/05 21:49:15 khussey Exp $ |
| */ |
| package org.eclipse.uml2.uml.edit.providers; |
| |
| 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.common.util.ResourceLocator; |
| |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| |
| import org.eclipse.emf.edit.command.CommandParameter; |
| import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
| import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
| import org.eclipse.emf.edit.provider.IItemLabelProvider; |
| import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
| import org.eclipse.emf.edit.provider.IItemPropertySource; |
| import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
| import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
| import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; |
| import org.eclipse.emf.edit.provider.ViewerNotification; |
| |
| import org.eclipse.uml2.uml.State; |
| import org.eclipse.uml2.uml.UMLFactory; |
| import org.eclipse.uml2.uml.UMLPackage; |
| |
| import org.eclipse.uml2.uml.edit.UMLEditPlugin; |
| |
| /** |
| * 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 |
| implements IEditingDomainItemProvider, IStructuredItemContentProvider, |
| ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { |
| |
| /** |
| * 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); |
| addOutgoingPropertyDescriptor(object); |
| addIncomingPropertyDescriptor(object); |
| addContainerPropertyDescriptor(object); |
| addIsCompositePropertyDescriptor(object); |
| addIsOrthogonalPropertyDescriptor(object); |
| addIsSimplePropertyDescriptor(object); |
| addIsSubmachineStatePropertyDescriptor(object); |
| addSubmachinePropertyDescriptor(object); |
| addConnectionPropertyDescriptor(object); |
| addConnectionPointPropertyDescriptor(object); |
| addRedefinedStatePropertyDescriptor(object); |
| addStateInvariantPropertyDescriptor(object); |
| addEntryPropertyDescriptor(object); |
| addExitPropertyDescriptor(object); |
| addDoActivityPropertyDescriptor(object); |
| addDeferrableTriggerPropertyDescriptor(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 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, true, false, true, null, |
| null, null)); |
| } |
| |
| /** |
| * 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, true, false, true, null, |
| null, null)); |
| } |
| |
| /** |
| * 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 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__STATE_INVARIANT); |
| childrenFeatures.add(UMLPackage.Literals.STATE__ENTRY); |
| childrenFeatures.add(UMLPackage.Literals.STATE__EXIT); |
| childrenFeatures.add(UMLPackage.Literals.STATE__DO_ACTIVITY); |
| childrenFeatures.add(UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER); |
| 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$ |
| } |
| |
| /** |
| * 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__STATE_INVARIANT : |
| case UMLPackage.STATE__ENTRY : |
| case UMLPackage.STATE__EXIT : |
| case UMLPackage.STATE__DO_ACTIVITY : |
| case UMLPackage.STATE__DEFERRABLE_TRIGGER : |
| case UMLPackage.STATE__REGION : |
| fireNotifyChanged(new ViewerNotification(notification, |
| notification.getNotifier(), true, false)); |
| return; |
| } |
| super.notifyChanged(notification); |
| } |
| |
| /** |
| * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s |
| * describing all of the children that can be created under this object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected void collectNewChildDescriptors( |
| Collection<CommandParameter> 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__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 |
| .createTimeConstraint())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__STATE_INVARIANT, UMLFactory.eINSTANCE |
| .createDurationConstraint())); |
| |
| 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 |
| .createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__ENTRY, UMLFactory.eINSTANCE |
| .createInteraction())); |
| |
| 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 |
| .createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__EXIT, UMLFactory.eINSTANCE |
| .createInteraction())); |
| |
| 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 |
| .createActivity())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DO_ACTIVITY, UMLFactory.eINSTANCE |
| .createInteraction())); |
| |
| newChildDescriptors.add(createChildParameter( |
| UMLPackage.Literals.STATE__DEFERRABLE_TRIGGER, UMLFactory.eINSTANCE |
| .createTrigger())); |
| |
| 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__ENTRY |
| || childFeature == UMLPackage.Literals.STATE__EXIT |
| || childFeature == UMLPackage.Literals.STATE__DO_ACTIVITY; |
| |
| 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); |
| } |
| |
| /** |
| * Return the resource locator for this item provider's resources. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ResourceLocator getResourceLocator() { |
| return UMLEditPlugin.INSTANCE; |
| } |
| |
| } |