| /******************************************************************************* |
| * Copyright (c) 2009, 2014 Xored Software Inc and others. |
| * 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: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.internal.launching.ext.ui; |
| |
| import java.util.Map; |
| |
| import org.eclipse.jface.viewers.ITableLabelProvider; |
| import org.eclipse.jface.viewers.LabelProvider; |
| import org.eclipse.swt.graphics.Image; |
| |
| public class MapLabelProvider extends LabelProvider implements |
| ITableLabelProvider { |
| |
| public Image getColumnImage(Object element, int columnIndex) { |
| return null; |
| } |
| |
| @SuppressWarnings("unchecked") |
| public String getColumnText(Object element, int columnIndex) { |
| if (element instanceof Map.Entry) { |
| if (columnIndex == 0) { |
| return ((Map.Entry<String, String>) element).getKey(); |
| } else { |
| return ((Map.Entry<String, String>) element).getValue(); |
| } |
| } |
| return null; |
| } |
| } |