/******************************************************************************* | |
* Copyright (c) 2016 KPIT Technologies. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* Jan Mauersberger- initial API and implementation | |
* Sascha Baumgart- initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.opencert.userguidance.autocomplete; | |
import org.eclipse.jface.fieldassist.IContentProposal; | |
import org.eclipse.jface.viewers.ILabelProvider; | |
import org.eclipse.jface.viewers.ILabelProviderListener; | |
import org.eclipse.swt.graphics.Image; | |
public class ProposalLabelProvider implements ILabelProvider { | |
public ProposalLabelProvider() { | |
} | |
@Override | |
public void addListener(ILabelProviderListener listener) { | |
} | |
@Override | |
public void dispose() { | |
} | |
@Override | |
public boolean isLabelProperty(Object element, String property) { | |
return false; | |
} | |
@Override | |
public void removeListener(ILabelProviderListener listener) { | |
} | |
@Override | |
public Image getImage(Object element) { | |
if (element instanceof ContentProposal2) { | |
return ((ContentProposal2) element).getImage(); | |
} | |
return null; | |
} | |
@Override | |
public String getText(Object element) { | |
if (element instanceof IContentProposal) { | |
return ((IContentProposal) element).getContent(); | |
} | |
return null; | |
} | |
} |