}
private IEditorInput doOpenBuffer(IEditorInput input, boolean force,
boolean reuseSource) {
if (input instanceof IClassFileEditorInput) {
IClassFile cf = ((IClassFileEditorInput) input).getClassFile();
String origSrc = getAttachedJavaSource(cf, force);
if (origSrc != null && !hasMappedSource) {
// remember, that the JDT knows where the real source is and can show it
setHasMappedSource(true);
}
if (origSrc == null || (force && !reuseSource)) {
setDecompiled(true);
char[] src;
if (input instanceof ExternalClassFileEditorInput) {
ExternalClassFileEditorInput extInput = (ExternalClassFileEditorInput) input;
src = getSourceMapper().getSource(
extInput.getFile(), cf, decompilerFlags);
} else {
src = getSourceMapper().getSource(cf, decompilerFlags);
}
changeBufferContent(cf, src);
} else {
setDecompiled(false);
}
} else if (input instanceof FileEditorInput) {
FileEditorInput fileEditorInput = (FileEditorInput) input;
// make class file from that
IClassFileEditorInput cfi = (IClassFileEditorInput) transformEditorInput(input);
// return changed reference
input = cfi;
setDecompiled(true);
IClassFile cf = cfi.getClassFile();
char[] src = getSourceMapper().getSource(
fileEditorInput.getFile(), cf, decompilerFlags);
changeBufferContent(cf, src);
}
return input;