/******************************************************************************* | |
* Copyright (c) 2017 QNX Software Systems 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 | |
*******************************************************************************/ | |
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); | |
} | |
} |