/******************************************************************************* | |
* <copyright> | |
* | |
* Copyright (c) 2013, 2013 SAP AG. | |
* 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: | |
* SAP AG - initial API, implementation and documentation | |
* | |
* </copyright> | |
* | |
*******************************************************************************/ | |
package org.eclipse.fmc.mm.navigator; | |
import org.eclipse.core.resources.IFile; | |
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; | |
import org.eclipse.swt.graphics.Image; | |
import org.eclipse.ui.ISharedImages; | |
import org.eclipse.ui.PlatformUI; | |
public class ProjectAdapterFactoryLabelProvider extends | |
AdapterFactoryLabelProvider { | |
public ProjectAdapterFactoryLabelProvider() { | |
super(ProjectAdapterFactoryProvider.getAdapterFactory()); | |
} | |
public Image getImage(Object object) { | |
if (object instanceof IFile) | |
return PlatformUI.getWorkbench().getSharedImages() | |
.getImage(ISharedImages.IMG_OBJ_FILE); | |
return super.getImage(object); | |
} | |
public String getText(Object object) { | |
if (object instanceof IFile) | |
return ((IFile) object).getName(); | |
return super.getText(object); | |
} | |
} |