Skip to main content
summaryrefslogtreecommitdiffstats
blob: a501eae24632db2d021aa1658616f35247310a6e (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*******************************************************************************
 * Copyright (c) 2004, 2007 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ote.ui.mux.msgtable;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

/**
 * @author Ky Komadino
 */
public class MuxMsgLabelProvider extends LabelProvider implements ITableLabelProvider {
   @Override
   public String getColumnText(Object obj, int index) {
      if (obj != null && obj instanceof MessageNode) {
         switch (index) {
            case 0:
               return ((MessageNode) obj).getName();
            case 1:
               return ((MessageNode) obj).getRtRt();
            case 2:
               return String.valueOf(((MessageNode) obj).getWordCount());
            case 3:
               return ((MessageNode) obj).getStatusWord();
            case 4:
               return ((MessageNode) obj).getEmulation();
            case 5:
               return ((MessageNode) obj).getBus();
            case 6:
               return String.valueOf(((MessageNode) obj).getActivity());
            case 7:
               return String.valueOf(((MessageNode) obj).getErrCount());
            case 8:
               return ((MessageNode) obj).getErrType();
            default:
               return "";
         }
      } else {
         return "";
      }
   }

   @Override
   public Image getColumnImage(Object obj, int index) {
      return getImage(obj);
   }

   @Override
   public String getText(Object obj) {
      return ((MessageNode) obj).getName();
   }
}

Back to the top