|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2005, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2010 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 14-19
Link Here
|
| 14 |
import org.eclipse.core.runtime.CoreException; |
14 |
import org.eclipse.core.runtime.CoreException; |
| 15 |
import org.eclipse.core.runtime.content.IContentDescription; |
15 |
import org.eclipse.core.runtime.content.IContentDescription; |
| 16 |
import org.eclipse.core.runtime.content.IContentType; |
16 |
import org.eclipse.core.runtime.content.IContentType; |
|
|
17 |
import org.eclipse.core.runtime.jobs.Job; |
| 17 |
import org.eclipse.jface.resource.ImageDescriptor; |
18 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 18 |
import org.eclipse.jface.viewers.IDecoration; |
19 |
import org.eclipse.jface.viewers.IDecoration; |
| 19 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
20 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
|
Lines 39-48
Link Here
|
| 39 |
IFile file = (IFile) element; |
40 |
IFile file = (IFile) element; |
| 40 |
IContentDescription contentDescription = null; |
41 |
IContentDescription contentDescription = null; |
| 41 |
try { |
42 |
try { |
|
|
43 |
Job.getJobManager().beginRule(file, null); |
| 42 |
contentDescription = file.getContentDescription(); |
44 |
contentDescription = file.getContentDescription(); |
| 43 |
} catch (CoreException e) { |
45 |
} catch (CoreException e) { |
| 44 |
// We already have some kind of icon for this file so it's ok to not |
46 |
// We already have some kind of icon for this file so it's ok to not |
| 45 |
// find a better icon. |
47 |
// find a better icon. |
|
|
48 |
} finally { |
| 49 |
Job.getJobManager().endRule(file); |
| 46 |
} |
50 |
} |
| 47 |
if (contentDescription != null) { |
51 |
if (contentDescription != null) { |
| 48 |
IContentType contentType = contentDescription.getContentType(); |
52 |
IContentType contentType = contentDescription.getContentType(); |