use of org.eclipse.xtext.xbase.ui.editor.StacktraceBasedEditorDecider.Decision in project xtext-eclipse by eclipse.
the class OriginalEditorSelector method findXbaseEditor.
public IEditorDescriptor findXbaseEditor(IEditorInput editorInput, boolean ignorePreference) {
IFile file = ResourceUtil.getFile(editorInput);
if (file == null)
return null;
if (!ignorePreference) {
if (file.exists()) {
try {
String favoriteEditor = file.getPersistentProperty(IDE.EDITOR_KEY);
if (favoriteEditor != null)
return null;
} catch (CoreException e) {
logger.debug(e.getMessage(), e);
}
}
}
// TODO stay in same editor if local navigation
Decision decision = decisions.decideAccordingToCaller();
if (decision == Decision.FORCE_JAVA) {
return null;
}
IEclipseTrace traceToSource = traceInformation.getTraceToSource(file);
return getXtextEditor(traceToSource);
}
Aggregations