|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2005, 2009 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 42-51
Link Here
|
| 42 |
ImageDescriptor image = null; |
43 |
ImageDescriptor image = null; |
| 43 |
IContentDescription contentDescription = null; |
44 |
IContentDescription contentDescription = null; |
| 44 |
try { |
45 |
try { |
|
|
46 |
Job.getJobManager().beginRule(file, null); |
| 45 |
contentDescription = file.getContentDescription(); |
47 |
contentDescription = file.getContentDescription(); |
| 46 |
} catch (CoreException e) { |
48 |
} catch (CoreException e) { |
| 47 |
// We already have some kind of icon for this file so it's OK to not |
49 |
// We already have some kind of icon for this file so it's OK to not |
| 48 |
// find a better icon. |
50 |
// find a better icon. |
|
|
51 |
} finally { |
| 52 |
Job.getJobManager().endRule(file); |
| 49 |
} |
53 |
} |
| 50 |
if (contentDescription != null) { |
54 |
if (contentDescription != null) { |
| 51 |
IContentType contentType = contentDescription.getContentType(); |
55 |
IContentType contentType = contentDescription.getContentType(); |