|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2005 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2008 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 16-33
Link Here
|
| 16 |
import java.util.Iterator; |
16 |
import java.util.Iterator; |
| 17 |
import java.util.Map; |
17 |
import java.util.Map; |
| 18 |
|
18 |
|
| 19 |
import org.eclipse.core.resources.IFile; |
|
|
| 20 |
import org.eclipse.core.runtime.IAdaptable; |
19 |
import org.eclipse.core.runtime.IAdaptable; |
| 21 |
import org.eclipse.emf.ecore.EObject; |
20 |
import org.eclipse.emf.ecore.EObject; |
|
|
21 |
import org.eclipse.hyades.models.common.common.CMNNamedElement; |
| 22 |
import org.eclipse.hyades.test.core.util.EMFUtil; |
22 |
import org.eclipse.hyades.test.core.util.EMFUtil; |
| 23 |
import org.eclipse.jface.resource.ImageDescriptor; |
23 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 24 |
import org.eclipse.jface.viewers.LabelProvider; |
24 |
import org.eclipse.jface.viewers.LabelProvider; |
| 25 |
import org.eclipse.swt.graphics.Image; |
25 |
import org.eclipse.swt.graphics.Image; |
| 26 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
26 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
| 27 |
|
27 |
|
| 28 |
|
|
|
| 29 |
/** |
28 |
/** |
|
|
29 |
* EObjectResourceLabelProvider.java |
| 30 |
* </p> |
| 31 |
* |
| 30 |
* |
32 |
* |
|
|
33 |
* @author Paul E. Slauenwhite |
| 34 |
* @version April 15, 2008 |
| 35 |
* @since February 1, 2005 |
| 31 |
*/ |
36 |
*/ |
| 32 |
public class EObjectResourceLabelProvider extends LabelProvider |
37 |
public class EObjectResourceLabelProvider extends LabelProvider |
| 33 |
{ |
38 |
{ |
|
Lines 94-101
Link Here
|
| 94 |
|
99 |
|
| 95 |
if(element instanceof EObject) |
100 |
if(element instanceof EObject) |
| 96 |
{ |
101 |
{ |
| 97 |
IFile file = EMFUtil.getWorkspaceFile((EObject)element); |
102 |
if(element instanceof CMNNamedElement){ |
| 98 |
text = file.getName(); |
103 |
text = ((CMNNamedElement)(element)).getName(); |
|
|
104 |
} |
| 105 |
else{ |
| 106 |
text = EMFUtil.getWorkspaceFile(((EObject)(element))).getName(); |
| 107 |
} |
| 99 |
} |
108 |
} |
| 100 |
else if(element instanceof IAdaptable) |
109 |
else if(element instanceof IAdaptable) |
| 101 |
{ |
110 |
{ |