public static Resource getResource(EObject object) { InsertionAdapter adapter = AdapterUtil.adapt(object, InsertionAdapter.class); if (adapter != null) { return adapter.getResource(); } if (object != null) return object.eResource(); return null; }
public Resource getResource() { if (resource == null) { Resource res = object.eResource(); if (res != null) return res; InsertionAdapter insertionAdapter = AdapterUtil.adapt(object, InsertionAdapter.class); if (insertionAdapter != null) return insertionAdapter.getResource(); } return resource; }