throw new CaoException(e1);
}
final JackEditorInput editorInput = new JackEditorInput(jack.getNode(),new Path(tmpFile.getAbsolutePath()));
// IEditorReference[] editorRefs = page.findEditors(editorInput,null,IWorkbenchPage.MATCH_INPUT);
IEditorDescriptor desc = window.getWorkbench().getEditorRegistry().getDefaultEditor(editorInput.getName());
if (desc == null) {
System.out.println("User default txt editor");
desc = window.getWorkbench().getEditorRegistry().getDefaultEditor("text.txt");
}
System.out.println(desc);
if (desc != null) {
final IEditorDescriptor descFinal = desc;
window.getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
try {
final IEditorPart editor = page.openEditor(
editorInput, descFinal.getId());
editor.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source,
int propId) {
if (IEditorPart.PROP_DIRTY == propId) {
if (editor instanceof AbstractDecoratedTextEditor && (!editor.isDirty())) {