Community
Participate
Working Groups
Created attachment 124863 [details] Initial implementation idea Currently, there is no way to specify an initial path to the project import wizard. We would like to bring up the Import Wizard, with a specific archive file pre-populated in the archive path field. Since 'Select archive file' is not the default action, this initial path would also select the 'Select archive file' radio button - it would determine which radio to select simply with: new File(initialPath).isDirectory(). I have drafted up a patch (based off the latest from HEAD) of what this would look like.
We are looking to replace what is essentially the same project import code with the eclipse version, but we need to be able to call it programmatically, seeding the file/zip path for the user.
Created attachment 125608 [details] Test for the Patch Patch looks good to me. Thanks Chris. Attaching the test for the patch.
I looks OK, but restoreWidgetValues() will have to be restructured so that only the restored values that need to be overridden when the initialPath is there are. The Copy check box will need to be persisted (in some but not all cases) PW
Yes, I can add some logic to whether the copy check box is selected - however, I am not certain what logic needs to go into place there - this is what I think: If there is an initial path, and it is an archive, the checkbox should be selected. If there is an initial path, and its a directory, the checkbox should default to the saved settings. If there is no initial path - just do what we did before. Also, I noticed that when you specify a long initial path, it stretches out the entire dialog to fit the whole path as viewable text, which I don't think is great. If anyone has an idea how to force the dialog to stay at its original size that would be helpful as well.
Created attachment 125691 [details] Second generation implementation I added a few changes to take care of the resizing problem I had mentioned. Instead of using Fill options with the GridData, I give the offending controls some static constants so they are generated an appropriate size - if this doesn't seem like the best fit I am certainly open to suggestions. The restoreWidgetValues seems to be filling in the appropriate value for the 'Copy projects into workspace' checkbox.
(In reply to comment #5) > Created an attachment (id=125691) [details] > Second generation implementation Chris, the rework looks good, but I'm not sure what TextContentAdapter is doing in there ... what purpose does it serve, as these are file paths? Prakash, the test needs to be updated to use ProjectRecords. PW
(In reply to comment #6) > (In reply to comment #5) > > Created an attachment (id=125691) [details] [details] > > Second generation implementation > > Chris, the rework looks good, but I'm not sure what TextContentAdapter is > doing in there ... what purpose does it serve, as these are file paths? Paul - I am using the TextContentAdapter as merely a way to set the cursor position to the end of the text for the path field - so instead of seeing "C:\Documents and settings\user\", you would see something like "\user\workspace\temparchive.zip" in the text box. The premise is that the archive name or end of the path would be more useful to see without scrolling through the whole textbox. This however may be a moot point, as I have noticed that the File -> Import -> Plugins and Fragments wizard actually expands the window based on an initial path as well. If you import a plugin using the Plugins and Fragments wizard that has a very long path, and then reopen the Plugins and Fragments wizard, you will see it has expanded out to fit the whole path used during the last successful import. All of this to say, perhaps we can let the dialog size be altered after all, since there is another case of it here.
Created attachment 126531 [details] Patch v03 + tests I've updated the patch & test to reflect the latest code in the head. Chris, I've also removed the TextContentAdapter, and used the setSelection trick to move the cursor to the end. Hope its fine.
(In reply to comment #8) > Created an attachment (id=126531) [details] > Patch v03 + tests > Released to HEAD (with @since tag) >20090224 Thanx, Prakash, Chris. PW
Great - thanks guys!
Verified in I20090310-0100