Community
Participate
Working Groups
Currently, when you go to open an target definition located somewhere on disk, the target editor comes up blank. This should be working and we should support this workflow. My suspicion is that we don't handle IURIEditorInput for target definitions.
Here is what is needed to support this: 1) Handle IURIEditorInput in the editor so the files open 2) Create a new ITargetHandle for external files 3) Update TargetPlatformService to recognize if the active target is an external file and if so, include it in the list of known target definitions. 4) Update the pref page's label provider to handle the external location 5) Make sure we properly handle the external file being deleted/inaccessible (covered by bug 264696).
Note that an active target platform pointing at an external file will be visible and editable on the preference page. Hitting the remove button should remove the definition from the list of known definitions and set the target platform to null, however the actual file will not be deleted (or we could prompt)
*** Bug 270674 has been marked as a duplicate of this bug. ***
I know you have a lot to look at right now Ankur, but since you go the Save As functionality working perhaps you will want to look into this.
Created attachment 130885 [details] WIP Patch This is Work In Progress patch. Functionality wise complete except for the portion for bug #264696. Will attach the full patch once that is resolved.
A couple issues Ankur, 1) If I open up an external file and set it as the target platform, the preference page doesn't recognize that it is active. 2) Removing the definition from the preference page should not delete the file from the file system. Even if we had a warning, Eclipse shouldn't be deleting files outside of the workspace. 3) If a file is opened, and then the editor closed, the entry stays in the preference page. This is not helpful. We should onyl be keeping a handle around if the editor is open or if it is set as the target platform. In fact we don't even need to keep a handle around for the open editors if it is too much work.
> 3) If a file is opened, and then the editor closed, the entry stays in the > preference page. This is not helpful. We should onyl be keeping a handle > around if the editor is open or if it is set as the target platform. In fact > we don't even need to keep a handle around for the open editors if it is too > much work. Currently, it keeps the handle only for the current session. They are not persisted. That is, on restart (of eclipse/workspace) you won't find them on preference page. I feel keeping the handle only if the editor is open is bit harsh.
(In reply to comment #7) > Currently, it keeps the handle only for the current session. They are not > persisted. That is, on restart (of eclipse/workspace) you won't find them on > preference page. I feel keeping the handle only if the editor is open is bit > harsh. > Eclipse should not manage files outside of the workspace. In fact, even adding the files with open editors to the preference page goes beyond the expectations of Eclipse. That being said, I expect that few users will use the feature and a session cache is not too bad. Users may also complain that we aren't persisting things in the preference page between sessions. My problems (1) and (2) are far more important. If the user sets an external file as a target platform, then we need to care about it.
> My problems (1) and (2) are far more important. If the user sets an external > file as a target platform, then we need to care about it. > Completely agree. Will ensure 1 and 2 are fixed in next patch. In 3 I am inclined towards sessions cache. And we post 3.5 users feel the need, I don't see any issue in persisting that cache.
Created attachment 131845 [details] Final Patch Added a new class ExternalFileTargetHandle. Added test case to check its memento. Modified ITargetPlatformService to add a getTarget(URI) for external targets. Corrected TargetEditor to handle external targets too. InformationSection corrected for the TextValidator
Patch is good, applied to HEAD.