1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 package de.nierbeck.timeTrack.views;
29
30 import org.apache.commons.lang.ArrayUtils;
31 import org.eclipse.jface.viewers.IStructuredContentProvider;
32 import org.eclipse.jface.viewers.Viewer;
33
34 import de.nierbeck.timeTrack.model.Entries;
35
36 /***
37 * @author Achim
38 *
39 */
40 public class EntriesContentProvider implements IStructuredContentProvider {
41
42 /***
43 * @param inputElement - the given Element
44 *
45 * @return a array of the selected Entries
46 *
47 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
48 */
49 public final Object[] getElements(Object inputElement) {
50 if (inputElement instanceof Entries) {
51 Object[] objects = ((Entries) inputElement).getEntry().toArray();
52 ArrayUtils.reverse(objects);
53 return objects;
54 }
55 return new Object[0];
56 }
57
58 /***
59 *
60 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
61 */
62 public void dispose() {
63
64
65 }
66
67 /***
68 * @param viewer - does nothing
69 * @param oldInput - does nothing
70 * @param newInput - does nothing
71 *
72 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
73 * java.lang.Object, java.lang.Object)
74 */
75 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
76
77
78 }
79
80 }