|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2015 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 11-16
Link Here
|
| 11 |
package org.eclipse.debug.internal.ui.sourcelookup; |
11 |
package org.eclipse.debug.internal.ui.sourcelookup; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.core.resources.IResource; |
13 |
import org.eclipse.core.resources.IResource; |
|
|
14 |
import org.eclipse.core.runtime.IAdaptable; |
| 14 |
import org.eclipse.jface.viewers.ILabelProvider; |
15 |
import org.eclipse.jface.viewers.ILabelProvider; |
| 15 |
import org.eclipse.jface.viewers.LabelProvider; |
16 |
import org.eclipse.jface.viewers.LabelProvider; |
| 16 |
import org.eclipse.swt.graphics.Image; |
17 |
import org.eclipse.swt.graphics.Image; |
|
Lines 49-54
Link Here
|
| 49 |
*/ |
50 |
*/ |
| 50 |
@Override |
51 |
@Override |
| 51 |
public Image getImage(Object element) { |
52 |
public Image getImage(Object element) { |
|
|
53 |
if (element instanceof IAdaptable) { |
| 54 |
SourceElementLabelProvider lp = ((IAdaptable) element).getAdapter(SourceElementLabelProvider.class); |
| 55 |
if (lp != null) { |
| 56 |
return lp.getImage(element); |
| 57 |
} |
| 58 |
} |
| 52 |
return getWorkbenchLabelProvider().getImage(element); |
59 |
return getWorkbenchLabelProvider().getImage(element); |
| 53 |
} |
60 |
} |
| 54 |
/* (non-Javadoc) |
61 |
/* (non-Javadoc) |
|
Lines 58-63
Link Here
|
| 58 |
public String getText(Object element) { |
65 |
public String getText(Object element) { |
| 59 |
if (element instanceof IResource) { |
66 |
if (element instanceof IResource) { |
| 60 |
return SourceElementWorkbenchAdapter.getQualifiedName(((IResource)element).getFullPath()); |
67 |
return SourceElementWorkbenchAdapter.getQualifiedName(((IResource)element).getFullPath()); |
|
|
68 |
} else if (element instanceof IAdaptable) { |
| 69 |
SourceElementLabelProvider lp = ((IAdaptable) element).getAdapter(SourceElementLabelProvider.class); |
| 70 |
if (lp != null) { |
| 71 |
return lp.getText(element); |
| 72 |
} |
| 61 |
} |
73 |
} |
| 62 |
return getWorkbenchLabelProvider().getText(element); |
74 |
return getWorkbenchLabelProvider().getText(element); |
| 63 |
} |
75 |
} |