source: trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/lecturer/LecturerLabelProvider.java @ 3

Last change on this file since 3 was 3, checked in by zeiss, 15 years ago
  • Property svn:mime-type set to text/plain
File size: 848 bytes
Line 
1package de.ugoe.cs.swe.exercises.lecturer;
2
3import org.eclipse.jface.viewers.ITableLabelProvider;
4import org.eclipse.jface.viewers.LabelProvider;
5import org.eclipse.swt.graphics.Image;
6import org.eclipse.ui.ISharedImages;
7import org.eclipse.ui.PlatformUI;
8
9public class LecturerLabelProvider extends LabelProvider implements
10                ITableLabelProvider {
11        public String getColumnText(Object obj, int index) {
12
13                Lecturer lecturer = (Lecturer) obj;
14
15                switch (index) {
16                case 0:
17                        return lecturer.getTitle();
18                case 1:
19                        return lecturer.getFirstName();
20                case 2:
21                        return lecturer.getLastName();
22                }
23
24                return getText(obj);
25        }
26
27        public Image getColumnImage(Object obj, int index) {
28                return null;
29        }
30
31        @Override
32        public Image getImage(Object obj) {
33                return PlatformUI.getWorkbench().getSharedImages().getImage(
34                                ISharedImages.IMG_OBJ_ELEMENT);
35        }
36}
Note: See TracBrowser for help on using the repository browser.