blob: 022e587ec1012eac41f63fb4699a7d5f28f701b7 [file] [log] [blame]
/*******************************************************************************
* 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.ote.ui.mux.datatable;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.ote.ui.mux.msgtable.MessageNode;
import org.eclipse.swt.graphics.Image;
/**
* @author Ky Komadino
*/
public class DatawordLabelProvider extends LabelProvider implements ITableLabelProvider {
@Override
public String getColumnText(Object obj, int index) {
if (obj != null && obj instanceof RowNode) {
if (index >= 0 && index <= 7) {
return String.valueOf(((RowNode) obj).getDataword(index));
} else {
return "";
}
} else {
return "";
}
}
@Override
public Image getColumnImage(Object obj, int index) {
return getImage(obj);
}
@Override
public String getText(Object obj) {
return ((MessageNode) obj).getName();
}
}