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 void addModelListener(IXtextModelListener listener) { Assert.isNotNull(listener); synchronized (modelListeners) { if (modelListeners.contains(listener)) return; if (listener instanceof DirtyStateEditorSupport) { modelListeners.add(0,listener); } else { modelListeners.add(listener); } } }
/** * A custom {@link DirtyStateEditorSupport} that uses a custom JobFamily. */ public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() { return N4JSDirtyStateEditorSupport.class; }
public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() { return SadlDirtyStateEditorSupport.class; }
/** * Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=383919 (honor container visibility). * * @return FixedDirtyStateEditorSupport */ @Override public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() { return FixedDirtyStateEditorSupport.class; }