All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bndtools.editor.common.PropertiesTableLabelProvider Maven / Gradle / Ivy

The newest version!
package bndtools.editor.common;

import java.util.Map;

import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.ViewerCell;

public class PropertiesTableLabelProvider extends StyledCellLabelProvider {

	@Override
	public void update(ViewerCell cell) {
		ColumnViewer viewer = getViewer();
		@SuppressWarnings("unchecked")
		Map map = (Map) viewer.getInput();

		String key = (String) cell.getElement();

		if (cell.getColumnIndex() == 0) {
			cell.setText(key);
		} else if (cell.getColumnIndex() == 1) {
			cell.setText(map.get(key));
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy