1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.dialogs.exception; |
5 | |
6 | import org.eclipse.jface.viewers.ILabelProviderListener; |
7 | import org.eclipse.jface.viewers.ITableLabelProvider; |
8 | import org.eclipse.swt.graphics.Image; |
9 | |
10 | import de.uka.ipd.sdq.pcm.repository.ExceptionType; |
11 | import de.uka.ipd.sdq.pcm.repository.Signature; |
12 | |
13 | /** |
14 | * @author admin |
15 | * |
16 | */ |
17 | public class TestLabelProvider implements ITableLabelProvider { |
18 | |
19 | /* (non-Javadoc) |
20 | * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) |
21 | */ |
22 | public Image getColumnImage(Object element, int columnIndex) { |
23 | // TODO Auto-generated method stub |
24 | return null; |
25 | } |
26 | |
27 | /* (non-Javadoc) |
28 | * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) |
29 | */ |
30 | public String getColumnText(Object element, int columnIndex) { |
31 | String result = ""; |
32 | ExceptionType exceptionType = (ExceptionType) element; |
33 | |
34 | switch (columnIndex) { |
35 | case ExceptionsDialog.ICON_COLUMN_INDEX: |
36 | break; |
37 | case ExceptionsDialog.CONTEXT_COLUMN_INDEX: |
38 | result = ((Signature) exceptionType.eContainer()).getEntityName(); |
39 | break; |
40 | case ExceptionsDialog.NAME_COLUMN_INDEX: |
41 | result = getExceptionName(exceptionType); |
42 | break; |
43 | default: |
44 | break; |
45 | } |
46 | return result == null ? "" : result; |
47 | } |
48 | |
49 | private String getExceptionName(ExceptionType type){ |
50 | String exceptionName = type.getExceptionName(); |
51 | if (exceptionName != null) |
52 | return exceptionName; |
53 | return "null"; |
54 | } |
55 | |
56 | /* (non-Javadoc) |
57 | * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) |
58 | */ |
59 | public void addListener(ILabelProviderListener listener) { |
60 | // TODO Auto-generated method stub |
61 | |
62 | } |
63 | |
64 | /* (non-Javadoc) |
65 | * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() |
66 | */ |
67 | public void dispose() { |
68 | // TODO Auto-generated method stub |
69 | |
70 | } |
71 | |
72 | /* (non-Javadoc) |
73 | * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) |
74 | */ |
75 | public boolean isLabelProperty(Object element, String property) { |
76 | // TODO Auto-generated method stub |
77 | return false; |
78 | } |
79 | |
80 | /* (non-Javadoc) |
81 | * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) |
82 | */ |
83 | public void removeListener(ILabelProviderListener listener) { |
84 | // TODO Auto-generated method stub |
85 | |
86 | } |
87 | |
88 | |
89 | } |