private DocumentBasedDirtyResource reflectiveGetInnerResource(final IDirtyResource dirtyResource) { Field[] declaredFields = dirtyResource.getClass().getDeclaredFields(); DocumentBasedDirtyResource myDirtyResource = null; try { Field field = declaredFields[0]; field.setAccessible(true); Object fieldValue = field.get(dirtyResource); if (fieldValue instanceof DirtyStateEditorSupport) { myDirtyResource = ((DirtyStateEditorSupport) fieldValue).getDirtyResource(); } } catch (IllegalArgumentException | IllegalAccessException e) { // ignore } return myDirtyResource; }
public Class<? extends DocumentBasedDirtyResource> bindDocumentBasedDirtyResource() { return PersistentDataAwareDirtyResource.class; }
@Override public Class<? extends DocumentBasedDirtyResource> bindDocumentBasedDirtyResource() { return PrevStateAwareDocumentBasedDirtyResource.class; }