| 1 | /* |
| 2 | *Copyright 2007, SDQ, IPD, University of Karlsruhe |
| 3 | */ |
| 4 | package de.uka.ipd.sdq.pcm.gmf.usage.providers; |
| 5 | |
| 6 | import org.eclipse.core.runtime.IAdaptable; |
| 7 | import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; |
| 8 | import org.eclipse.gmf.runtime.common.core.service.IOperation; |
| 9 | import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation; |
| 10 | import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; |
| 11 | import org.eclipse.swt.graphics.Image; |
| 12 | |
| 13 | /** |
| 14 | * @generated |
| 15 | */ |
| 16 | public class PalladioComponentModelIconProvider extends AbstractProvider |
| 17 | implements IIconProvider { |
| 18 | |
| 19 | /** |
| 20 | * @generated |
| 21 | */ |
| 22 | public Image getIcon(IAdaptable hint, int flags) { |
| 23 | return PalladioComponentModelElementTypes.getImage(hint); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @generated |
| 28 | */ |
| 29 | public boolean provides(IOperation operation) { |
| 30 | if (operation instanceof GetIconOperation) { |
| 31 | return ((GetIconOperation) operation).execute(this) != null; |
| 32 | } |
| 33 | return false; |
| 34 | } |
| 35 | } |