Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264056 - [target] be able to open external target files using Open File...
Summary: [target] be able to open external target files using Open File...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 270674 (view as bug list)
Depends on: 264696
Blocks:
  Show dependency tree
 
Reported: 2009-02-07 17:35 EST by Chris Aniszczyk CLA
Modified: 2009-04-15 11:14 EDT (History)
5 users (show)

See Also:


Attachments
WIP Patch (21.93 KB, patch)
2009-04-03 16:43 EDT, Ankur Sharma CLA
no flags Details | Diff
Final Patch (25.11 KB, patch)
2009-04-14 16:45 EDT, Ankur Sharma CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2009-02-07 17:35:03 EST
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.
Comment 1 Curtis Windatt CLA 2009-03-12 16:10:22 EDT
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).
Comment 2 Curtis Windatt CLA 2009-03-12 16:20:25 EDT
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)
Comment 3 Curtis Windatt CLA 2009-03-31 17:46:03 EDT
*** Bug 270674 has been marked as a duplicate of this bug. ***
Comment 4 Curtis Windatt CLA 2009-03-31 17:47:31 EDT
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.
Comment 5 Ankur Sharma CLA 2009-04-03 16:43:29 EDT
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.
Comment 6 Curtis Windatt CLA 2009-04-08 17:18:37 EDT
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.
Comment 7 Ankur Sharma CLA 2009-04-08 17:36:09 EDT
> 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.

Comment 8 Curtis Windatt CLA 2009-04-09 09:34:13 EDT
(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.

Comment 9 Ankur Sharma CLA 2009-04-09 10:15:55 EDT
> 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.
Comment 10 Ankur Sharma CLA 2009-04-14 16:45:38 EDT
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
Comment 11 Curtis Windatt CLA 2009-04-15 11:14:20 EDT
Patch is good, applied to HEAD.