1 | package de.uka.ipd.sdq.pcm.gmf.seff.helper; |
2 | |
3 | import org.eclipse.emf.common.notify.AdapterFactory; |
4 | import org.eclipse.emf.edit.provider.IItemLabelProvider; |
5 | import org.eclipse.emf.edit.provider.ItemProviderDecorator; |
6 | |
7 | import de.uka.ipd.sdq.pcm.repository.DataType; |
8 | import de.uka.ipd.sdq.pcm.repository.Parameter; |
9 | |
10 | /** @author roman */ |
11 | public class CollectionIteratorLabelProvider extends ItemProviderDecorator |
12 | implements IItemLabelProvider { |
13 | |
14 | public CollectionIteratorLabelProvider(AdapterFactory adapterFactory) { |
15 | super(adapterFactory); |
16 | } |
17 | |
18 | /* (non-Javadoc) |
19 | * @see org.eclipse.emf.edit.provider.ItemProviderDecorator#getText(java.lang.Object) |
20 | */ |
21 | @Override |
22 | public String getText(Object object) { |
23 | if (object instanceof Parameter) { |
24 | Parameter parameter = (Parameter) object; |
25 | DataType dataType = parameter.getDataType__Parameter(); |
26 | if (dataType == null) |
27 | return parameter.getParameterName() + ": null"; |
28 | return parameter.getParameterName() + ": " + super.getText(dataType); |
29 | } |
30 | return super.getText(object); |
31 | } |
32 | } |