blob: f5adeab843e82966d0cd62404bf465ce1cce3558 [file] [log] [blame]
/**
* Copyright (c) 2016 CEA LIST 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:
* CEA LIST - Initial API and implementation
*
*/
package org.eclipse.papyrus.interoperability.rpy.rpymetamodel.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 org.eclipse.papyrus.interoperability.rpy.rpymetamodel.CGIMscMessage;
import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.UMLRpyFactory;
import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.UMLRpyPackage;
/**
* This is the item provider adapter for a {@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.CGIMscMessage} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class CGIMscMessageItemProvider extends GraphElementsTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CGIMscMessageItemProvider(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);
addM_pModelObjectPropertyDescriptor(object);
addM_pParentPropertyDescriptor(object);
addM_pSourcePropertyDescriptor(object);
addM_sourceTypePropertyDescriptor(object);
addM_pTargetPropertyDescriptor(object);
addM_targetTypePropertyDescriptor(object);
addM_directionPropertyDescriptor(object);
addM_anglePoint1PropertyDescriptor(object);
addM_anglePoint2PropertyDescriptor(object);
addM_line_stylePropertyDescriptor(object);
addM_SourcePortPropertyDescriptor(object);
addM_TargetPortPropertyDescriptor(object);
addM_bLeftPropertyDescriptor(object);
addM_arrowPropertyDescriptor(object);
addMyStatePropertyDescriptor(object);
addM_pSourceExecPropertyDescriptor(object);
addM_pTargetExecPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the MpModel Object feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pModelObjectPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pModelObject_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pModelObject_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pModelObject(),
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the MpParent feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pParentPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pParent_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pParent_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pParent(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MpSource feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pSourcePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pSource_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pSource_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pSource(),
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Msource Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_sourceTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_sourceType_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_sourceType_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_sourceType(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MpTarget feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pTargetPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pTarget_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pTarget_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pTarget(),
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the Mtarget Type feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_targetTypePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_targetType_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_targetType_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_targetType(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Mdirection feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_directionPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_direction_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_direction_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_direction(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Mangle Point1 feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_anglePoint1PropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_anglePoint1_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_anglePoint1_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_anglePoint1(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Mangle Point2 feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_anglePoint2PropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_anglePoint2_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_anglePoint2_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_anglePoint2(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Mline style feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_line_stylePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_line_style_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_line_style_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_line_style(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MSource Port feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_SourcePortPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_SourcePort_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_SourcePort_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_SourcePort(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MTarget Port feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_TargetPortPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_TargetPort_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_TargetPort_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_TargetPort(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MbLeft feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_bLeftPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_bLeft_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_bLeft_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_bLeft(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the Marrow feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_arrowPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_arrow_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_arrow_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_arrow(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the My State feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addMyStatePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_myState_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_myState_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_MyState(),
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
/**
* This adds a property descriptor for the MpSource Exec feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pSourceExecPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pSourceExec_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pSourceExec_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pSourceExec(),
true,
false,
true,
null,
null,
null));
}
/**
* This adds a property descriptor for the MpTarget Exec feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addM_pTargetExecPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CGIMscMessage_m_pTargetExec_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_CGIMscMessage_m_pTargetExec_feature", "_UI_CGIMscMessage_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_pTargetExec(),
true,
false,
true,
null,
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(UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_rpn());
childrenFeatures.add(UMLRpyPackage.eINSTANCE.getCGIMscMessage_Properties());
}
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 CGIMscMessage.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/CGIMscMessage")); //$NON-NLS-1$
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((CGIMscMessage)object).getId();
return label == null || label.length() == 0 ?
getString("_UI_CGIMscMessage_type") : //$NON-NLS-1$
getString("_UI_CGIMscMessage_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* 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(CGIMscMessage.class)) {
case UMLRpyPackage.CGI_MSC_MESSAGE__MPPARENT:
case UMLRpyPackage.CGI_MSC_MESSAGE__MSOURCE_TYPE:
case UMLRpyPackage.CGI_MSC_MESSAGE__MTARGET_TYPE:
case UMLRpyPackage.CGI_MSC_MESSAGE__MDIRECTION:
case UMLRpyPackage.CGI_MSC_MESSAGE__MANGLE_POINT1:
case UMLRpyPackage.CGI_MSC_MESSAGE__MANGLE_POINT2:
case UMLRpyPackage.CGI_MSC_MESSAGE__MLINE_STYLE:
case UMLRpyPackage.CGI_MSC_MESSAGE__MSOURCE_PORT:
case UMLRpyPackage.CGI_MSC_MESSAGE__MTARGET_PORT:
case UMLRpyPackage.CGI_MSC_MESSAGE__MBLEFT:
case UMLRpyPackage.CGI_MSC_MESSAGE__MARROW:
case UMLRpyPackage.CGI_MSC_MESSAGE__MY_STATE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case UMLRpyPackage.CGI_MSC_MESSAGE__MRPN:
case UMLRpyPackage.CGI_MSC_MESSAGE__PROPERTIES:
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
(UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_rpn(),
UMLRpyFactory.eINSTANCE.createCGIText()));
newChildDescriptors.add
(createChildParameter
(UMLRpyPackage.eINSTANCE.getCGIMscMessage_Properties(),
UMLRpyFactory.eINSTANCE.createIPropertyContainer()));
}
/**
* 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 == UMLRpyPackage.eINSTANCE.getGraphElementsType_M_name() ||
childFeature == UMLRpyPackage.eINSTANCE.getCGIMscMessage_M_rpn();
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);
}
}