Community
Participate
Working Groups
I20090317-1745 "Close Unrelated Projects" is a dangerous operation with and hence needs a confirmation dialog (with a "don't nag me again" checkbox, if you want). I just inadvertently executed this action from the context menu, and now I have to manually restore my workspace state. Even if Undo would work, that would still cause a full build of all closed projects.
Created attachment 144254 [details] Proposed patch (confirmation dialog on closing unrelated projects) Proposed patch for a confirmation dialog on closing unrelated projects
Nice patch, it is good that you added a preferences to change the preference later on. I run into a small wrinkle when trying the updated version. When I select "Never" as the answer, the next time the action is executed it appears as nothing happens - "Close Unrelated Projects" action is enabled but nothing visible happens when it is selected. In theory, it is possible to imagine adding a message box for this case with the link to the preference page, but that probably would be overkill. Another option would be to use Yes/No indicator rather then Prompt/Always/Never. Something like: "[checkbox] Always close unrelated projects without prompt". Just like the prompt to exit Eclipse. Couple technicalities: - This will be the first change to the org.eclipse.ui.ide bundle in the 3.6. As such, its version needs to be incremented to 3.5.100. Bundle versions are somewhat confusing subject, here is a good writeup on it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=278064 - The "contributors" line in the copyrights. Its a bit different from team to team, for Platform/UI we usually add name, e-mail, company name, and, optionally, the bug fixed. - The years in the copyright headers: there are two dates in the copyright headers, something like: * Copyright (c) 2000, 2006 IBM Corporation and others. The first date is the year file was originally written; the second date is the last year the file was modified. People almost always overlook the need to update the second year :-). (Platform/UI runs a script before release to update ones that have been overlooked through the development cycle.)
> Another option would be to use Yes/No indicator rather then > Prompt/Always/Never. Something like: "[checkbox] Always close unrelated > projects without prompt". Just like the prompt to exit Eclipse. I agree that "Never" is confusing. I would expect a dialog that is similar to the confirmation dialog when you try to delete a resource i.e.: - Title: "Close Unrelated Projects" (the title of a dialog that has been triggered by an action should always be the name of the action) - Question: "Are you sure you want to close all project that are not related to '<name-of-selected-project>'?" ("Confirm closing projects" is not a question) - Checkbox: "Always close without prompt" - Buttons: "OK", "Cancel" > - The "contributors" line in the copyrights. Its a bit different from team to > team, for Platform/UI we usually add name, e-mail, company name, and, > optionally, the bug fixed. We don't list individual contributors from IBM there.
(In reply to comment #3) Markus, thanks for the suggested texts! I think they will fit perfectly. > > - The "contributors" line in the copyrights. Its a bit different from team to > > team, for Platform/UI we usually add name, e-mail, company name, and, > > optionally, the bug fixed. > We don't list individual contributors from IBM there. I believe the Eclipse rule is that we should list all individual contributors in the copyright headers unless they are committers on the same Eclipse top level project. (Myself, I am never sure what exactly is the "top level project" those days, but that does not apply here anyway.) I guess if the person is already a committer on a different Eclipse Platform component, they have all the paperwork already covering whatever they do on that project. Different projects adopted different standards as to what information goes in there. For instance, I think Equinox decided not to include company name, just the person's name. As a random example, see class Binding in the org.eclipse.core.databinding bundle.
Created attachment 145398 [details] Updated proposed patch patch is modified based on the comments.
(In reply to comment #5) > Created an attachment (id=145398) [details] > Updated proposed patch > patch is modified based on the comments. Thanks, it looks good! I like the way you handled possibility of multiple projects being selected. A few nitpicks: - The new checkboxes need keyboard accelerators ("&" signs in "Always close without prompt"; "Always close unrelated projects without prompt") - CloseUnrelatedProjectsAction: formatting seems to be off in the new code. In the #getSelectedProjectName() method - you only use the first name? Might be easier to merge that code into #promptForConfirmation() - Bundle version for "org.eclipse.ui.ide" in the manifest.mf needs to be incremented.
Created attachment 145560 [details] Modifed patch
Created attachment 145950 [details] Slightly modified Dina's patch Good patch. I made a slightly modified version of it: - #promptForConfirmation(): After the prompt dialog is cancelled it throws an OperationCanceledException. That shows in the Error log (Window -> Show View -> Error Log) as "Unhandled event loop exception". I changed it to return false if Cancel or ESC are pressed; - MessageDialogWithToggle stores preference as "always" / "never", not as boolean. That preference is overwritten by a boolean if "OK" is pressed, but not for Cancel/ESC. I changed the code to don't pass preference store information to it; - fixed formatting in the CloseUnrelatedProjectsAction - there was a mix of tabs and spaces. (To see the default formatting, select modified portion and press Shift+Ctrl+F.); - fixed tooltip message in the preferences dialog.
Patch applied to CVS Head, good work! One last thing left to do is to update documentation. There is an entry in the Eclipse help for the modified preference page under Workbench User Guide -> Reference -> Preferences -> Workspace. This is in the bundle "org.eclipse.platform.doc.user". The easiest way to find the page it to R-click on the entry in the Help and select "copy shortcut". In this case it is: /help/topic/org.eclipse.platform.doc.user/reference/ref-9.htm The file has a screenshot of the page and some text desribing options. This page has guidelines for the screenshots: http://wiki.eclipse.org/Eclipse_Doc_Style_Guide#graphics
Created attachment 147623 [details] Documentation update for ref-9.htm
Created attachment 147624 [details] Updated screen shot for the new option
That's perfect, thank you! Doc changes applied to CVS Head. Marking as fixed.
Verified in I20091027-0100.