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;
}
项目:bts
文件:XtextDocument.java
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);
}
}
}
项目:n4js
文件:N4JSUiModule.java
/**
* A custom {@link DirtyStateEditorSupport} that uses a custom JobFamily.
*/
public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() {
return N4JSDirtyStateEditorSupport.class;
}
项目:sadlos2
文件:SadlUiModule.java
public Class<? extends DirtyStateEditorSupport> bindDirtyStateEditorSupport() {
return SadlDirtyStateEditorSupport.class;
}
项目:dsl-devkit
文件:CheckUiModule.java
/**
* 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;
}
/**
* 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;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。