| /******************************************************************************* |
| * Copyright (c) 2017 QNX Software Systems and others. |
| * |
| * This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| *******************************************************************************/ |
| package org.eclipse.cdt.launch.serial.ui.internal; |
| |
| import org.eclipse.jface.viewers.LabelProvider; |
| import org.eclipse.launchbar.core.target.ILaunchTarget; |
| import org.eclipse.swt.graphics.Image; |
| |
| public class SerialFlashLaunchTargetLabelProvider extends LabelProvider { |
| |
| @Override |
| public String getText(Object element) { |
| if (element instanceof ILaunchTarget) { |
| return ((ILaunchTarget) element).getId(); |
| } |
| return super.getText(element); |
| } |
| |
| @Override |
| public Image getImage(Object element) { |
| if (element instanceof ILaunchTarget) { |
| Image image = Activator.getImage(Activator.IMG_CDT_LOGO); |
| if (image != null) { |
| return image; |
| } |
| } |
| return super.getImage(element); |
| } |
| |
| } |