| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.core.composition.provider; |
| 7 | |
| 8 | |
| 9 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
| 10 | import de.uka.ipd.sdq.pcm.core.composition.EventChannelSourceConnector; |
| 11 | |
| 12 | import java.util.Collection; |
| 13 | import java.util.List; |
| 14 | |
| 15 | import org.eclipse.emf.common.notify.AdapterFactory; |
| 16 | import org.eclipse.emf.common.notify.Notification; |
| 17 | |
| 18 | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; |
| 19 | import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
| 20 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
| 21 | import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
| 22 | import org.eclipse.emf.edit.provider.IItemPropertySource; |
| 23 | import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
| 24 | import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
| 25 | |
| 26 | /** |
| 27 | * This is the item provider adapter for a {@link de.uka.ipd.sdq.pcm.core.composition.EventChannelSourceConnector} object. |
| 28 | * <!-- begin-user-doc --> |
| 29 | * <!-- end-user-doc --> |
| 30 | * @generated |
| 31 | */ |
| 32 | public class EventChannelSourceConnectorItemProvider |
| 33 | extends ConnectorItemProvider |
| 34 | implements |
| 35 | IEditingDomainItemProvider, |
| 36 | IStructuredItemContentProvider, |
| 37 | ITreeItemContentProvider, |
| 38 | IItemLabelProvider, |
| 39 | IItemPropertySource { |
| 40 | /** |
| 41 | * <!-- begin-user-doc --> |
| 42 | * <!-- end-user-doc --> |
| 43 | * @generated |
| 44 | */ |
| 45 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 46 | |
| 47 | /** |
| 48 | * This constructs an instance from a factory and a notifier. |
| 49 | * <!-- begin-user-doc --> |
| 50 | * <!-- end-user-doc --> |
| 51 | * @generated |
| 52 | */ |
| 53 | public EventChannelSourceConnectorItemProvider(AdapterFactory adapterFactory) { |
| 54 | super(adapterFactory); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * This returns the property descriptors for the adapted class. |
| 59 | * <!-- begin-user-doc --> |
| 60 | * <!-- end-user-doc --> |
| 61 | * @generated |
| 62 | */ |
| 63 | @Override |
| 64 | public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { |
| 65 | if (itemPropertyDescriptors == null) { |
| 66 | super.getPropertyDescriptors(object); |
| 67 | |
| 68 | addSourceRole__EventChannelSourceRolePropertyDescriptor(object); |
| 69 | addAssemblyContext__EventChannelSourceConnectorPropertyDescriptor(object); |
| 70 | addEventChannel__EventChannelSourceConnectorPropertyDescriptor(object); |
| 71 | } |
| 72 | return itemPropertyDescriptors; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * This adds a property descriptor for the Source Role Event Channel Source Role feature. |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @generated |
| 80 | */ |
| 81 | protected void addSourceRole__EventChannelSourceRolePropertyDescriptor(Object object) { |
| 82 | itemPropertyDescriptors.add |
| 83 | (createItemPropertyDescriptor |
| 84 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| 85 | getResourceLocator(), |
| 86 | getString("_UI_EventChannelSourceConnector_sourceRole__EventChannelSourceRole_feature"), |
| 87 | getString("_UI_PropertyDescriptor_description", "_UI_EventChannelSourceConnector_sourceRole__EventChannelSourceRole_feature", "_UI_EventChannelSourceConnector_type"), |
| 88 | CompositionPackage.Literals.EVENT_CHANNEL_SOURCE_CONNECTOR__SOURCE_ROLE_EVENT_CHANNEL_SOURCE_ROLE, |
| 89 | true, |
| 90 | false, |
| 91 | true, |
| 92 | null, |
| 93 | null, |
| 94 | null)); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * This adds a property descriptor for the Assembly Context Event Channel Source Connector feature. |
| 99 | * <!-- begin-user-doc --> |
| 100 | * <!-- end-user-doc --> |
| 101 | * @generated |
| 102 | */ |
| 103 | protected void addAssemblyContext__EventChannelSourceConnectorPropertyDescriptor(Object object) { |
| 104 | itemPropertyDescriptors.add |
| 105 | (createItemPropertyDescriptor |
| 106 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| 107 | getResourceLocator(), |
| 108 | getString("_UI_EventChannelSourceConnector_assemblyContext__EventChannelSourceConnector_feature"), |
| 109 | getString("_UI_PropertyDescriptor_description", "_UI_EventChannelSourceConnector_assemblyContext__EventChannelSourceConnector_feature", "_UI_EventChannelSourceConnector_type"), |
| 110 | CompositionPackage.Literals.EVENT_CHANNEL_SOURCE_CONNECTOR__ASSEMBLY_CONTEXT_EVENT_CHANNEL_SOURCE_CONNECTOR, |
| 111 | true, |
| 112 | false, |
| 113 | true, |
| 114 | null, |
| 115 | null, |
| 116 | null)); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * This adds a property descriptor for the Event Channel Event Channel Source Connector feature. |
| 121 | * <!-- begin-user-doc --> |
| 122 | * <!-- end-user-doc --> |
| 123 | * @generated |
| 124 | */ |
| 125 | protected void addEventChannel__EventChannelSourceConnectorPropertyDescriptor(Object object) { |
| 126 | itemPropertyDescriptors.add |
| 127 | (createItemPropertyDescriptor |
| 128 | (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), |
| 129 | getResourceLocator(), |
| 130 | getString("_UI_EventChannelSourceConnector_eventChannel__EventChannelSourceConnector_feature"), |
| 131 | getString("_UI_PropertyDescriptor_description", "_UI_EventChannelSourceConnector_eventChannel__EventChannelSourceConnector_feature", "_UI_EventChannelSourceConnector_type"), |
| 132 | CompositionPackage.Literals.EVENT_CHANNEL_SOURCE_CONNECTOR__EVENT_CHANNEL_EVENT_CHANNEL_SOURCE_CONNECTOR, |
| 133 | true, |
| 134 | false, |
| 135 | true, |
| 136 | null, |
| 137 | null, |
| 138 | null)); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * This returns EventChannelSourceConnector.gif. |
| 143 | * <!-- begin-user-doc --> |
| 144 | * <!-- end-user-doc --> |
| 145 | * @generated |
| 146 | */ |
| 147 | @Override |
| 148 | public Object getImage(Object object) { |
| 149 | return overlayImage(object, getResourceLocator().getImage("full/obj16/EventChannelSourceConnector")); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * This returns the label text for the adapted class. |
| 154 | * <!-- begin-user-doc --> |
| 155 | * <!-- end-user-doc --> |
| 156 | * @generated |
| 157 | */ |
| 158 | @Override |
| 159 | public String getText(Object object) { |
| 160 | String label = ((EventChannelSourceConnector)object).getId(); |
| 161 | return label == null || label.length() == 0 ? |
| 162 | getString("_UI_EventChannelSourceConnector_type") : |
| 163 | getString("_UI_EventChannelSourceConnector_type") + " " + label; |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * This handles model notifications by calling {@link #updateChildren} to update any cached |
| 168 | * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. |
| 169 | * <!-- begin-user-doc --> |
| 170 | * <!-- end-user-doc --> |
| 171 | * @generated |
| 172 | */ |
| 173 | @Override |
| 174 | public void notifyChanged(Notification notification) { |
| 175 | updateChildren(notification); |
| 176 | super.notifyChanged(notification); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children |
| 181 | * that can be created under this object. |
| 182 | * <!-- begin-user-doc --> |
| 183 | * <!-- end-user-doc --> |
| 184 | * @generated |
| 185 | */ |
| 186 | @Override |
| 187 | protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { |
| 188 | super.collectNewChildDescriptors(newChildDescriptors, object); |
| 189 | } |
| 190 | |
| 191 | } |