Problem during restore of ClassFileEditor#2348
Conversation
- added delayed restoring of the IEditorInput. - added functionality to check if the IClasspathContainers are fully resolved for the given project. - added unit tests. See eclipse-jdt#2245
laeubi
left a comment
There was a problem hiding this comment.
I think this PR actually goes in the right direction but it is made to complicated and requires new API that is not necessary.
See the following PR:
if you have this, then all that is needed is here
if (!javaProject.exists() || !javaProject.isOnClasspath(file)) {
throw new CoreException(JavaUIStatus.createError(
IJavaModelStatusConstants.INVALID_RESOURCE,
JavaEditorMessages.ClassFileEditor_error_classfile_not_on_classpath,
null));
}
If one disables this check (and another one in Openable), then the class editor already is able to show the file (but without sources). If one now registers a listeners that informs the Editor on changes to the project one can refresh the editor document and everything works smooth (regardless of what is the problem that the input is not there).
|
@mehmet-karaman I have now created a example here that shows how the case can be handled without any additional public API as described in the previous comment, if one would handle the TODOs properly the Class Editor will work even in the event of early restore from memeto: |
|
Thanks I am going to check that. |
|
This can be also closed now. |
#2347