/*******************************************************************************
 * Copyright (c) 2008, 2018 Red Hat, Inc.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Kent Sebastian <ksebasti@redhat.com> - initial API and implementation,
 *        adapted from Keith Seitz's ProfileLabelProvider
 *******************************************************************************/
package org.eclipse.linuxtools.internal.oprofile.ui.view;

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.linuxtools.oprofile.ui.model.IUiModelElement;
import org.eclipse.swt.graphics.Image;

/**
 * Content provider for OprofileView's tree viewer.
 */
public class OprofileViewLabelProvider extends LabelProvider {

    @Override
    public Image getImage(Object element) {
        Assert.isLegal(element instanceof IUiModelElement, "in OprofileViewLabelProvider"); //$NON-NLS-1$
        return ((IUiModelElement) element).getLabelImage();
    }

    @Override
    public String getText(Object element) {
        Assert.isLegal(element instanceof IUiModelElement, "in OprofileViewLabelProvider"); //$NON-NLS-1$
        return ((IUiModelElement) element).getLabelText();
    }

    @Override
    public boolean isLabelProperty(Object element, String property) {
        return false;
    }

}
