use of org.eclipse.ui.IContributorResourceAdapter in project egit by eclipse.
the class LabelEventJob method getResource.
// -------- Helper methods --------
private static IResource getResource(Object actElement) {
Object element = actElement;
if (element instanceof ResourceMapping) {
element = ((ResourceMapping) element).getModelObject();
}
IResource resource = null;
if (element instanceof IResource) {
resource = (IResource) element;
} else if (element instanceof IAdaptable) {
final IAdaptable adaptable = (IAdaptable) element;
resource = AdapterUtils.adapt(adaptable, IResource.class);
if (resource == null) {
final IContributorResourceAdapter adapter = AdapterUtils.adapt(adaptable, IContributorResourceAdapter.class);
if (adapter != null)
resource = adapter.getAdaptedResource(adaptable);
}
}
return resource;
}
Aggregations