blob: 92e1cb63348a2b7da79da6142a2a09ac86e337be [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2015 CEA LIST.
*
*
* 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:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.moka.animation.presentation.control;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.papyrus.moka.animation.AnimationPlugin;
import org.eclipse.papyrus.moka.animation.presentation.data.AnimatingInstanceNode;
import org.eclipse.swt.graphics.Image;
public class AnimatingInstanceLabelProvider extends LabelProvider {
public static final String THREAD_ICON = "icons/thread_icon.png";
@Override
public String getText(Object element) {
if (element instanceof AnimatingInstanceNode) {
return ((AnimatingInstanceNode) element).instance.getIdentifier();
}
return null;
}
@Override
public Image getImage(Object element) {
if (element instanceof AnimatingInstanceNode) {
return AnimationPlugin.getDefault().getImageRegistry().get(THREAD_ICON);
}
return null;
}
}