Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 77014

Summary: [Commands] request: Provide close view command and binding
Product: [Eclipse Project] Platform Reporter: David W Campbell <dcampbell>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse, john.arthorne, markus.kell.r, tlroche
Version: 3.0.1Keywords: helpwanted
Target Milestone: 3.3 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch implementing close part action
none
close part patch v02 none

Description David W Campbell CLA 2004-10-26 10:30:47 EDT
In Eclipse 3.0.1, the key sequence CTRL+F4 will close an editor view.

However, the same key sequence will not close a non-editor view.

I think that CTRL+F4 should close the active view; editor view or non-editor 
view.
Comment 1 Douglas Pollock CLA 2004-10-26 11:22:42 EDT
There is no command for this yet, so one would need to be added. 
Comment 2 Douglas Pollock CLA 2005-02-21 15:36:35 EST
*** Bug 81466 has been marked as a duplicate of this bug. ***
Comment 3 Douglas Pollock CLA 2005-05-11 12:30:51 EDT
*** Bug 94722 has been marked as a duplicate of this bug. ***
Comment 4 Michael Van Meekeren CLA 2006-04-21 13:22:04 EDT
Moving Dougs bugs
Comment 5 Paul Webster CLA 2006-09-28 11:00:38 EDT
There are currently no plans to work on this feature.

PW
Comment 6 John Arthorne CLA 2006-09-28 11:41:37 EDT
Created attachment 51093 [details]
Patch implementing close part action

You said helpwanted, so here you go. I wrote this one day after despairing over typing "Alt+-, c" to close a view for the nth time - this is my most frequently used action that is currently not key-bindable.

This patch adds a new "close part" command that will close the active part, either an editor or view.  I then manually switch the Ctrl+W key binding to this command instead of the "close editor" command. I took this approach rather than changing the current CloseEditorAction, because I'm sure some people would not want this change in behaviour (if they hit Ctrl+W when the Navigator is in focus, they might really want to close the current editor rather than the Navigator).
Comment 7 Paul Webster CLA 2006-09-28 13:53:58 EDT
excellent.

PW
Comment 8 Paul Webster CLA 2006-10-31 09:34:58 EST
Ooops, missed M3, I'll put it in first thing next week.

PW
Comment 9 John Arthorne CLA 2006-10-31 09:47:16 EST
I've still got this in my workspace, so ping me when you're ready for a patch. There have been conflicting changes since the original patch so you would have difficultly applying as is.
Comment 10 Paul Webster CLA 2006-11-08 13:38:46 EST
Created attachment 53478 [details]
close part patch v02

John, I've converted your patch to a command+handler.  Could you have a quick look?

You still bind to it in the keys preference page.

PW
Comment 11 John Arthorne CLA 2006-11-08 14:17:25 EST
But... your patch is too simple!  No action factory, no action builder... Can the new command story really be this simple?  How am I supposed to impress people with my knowledge of the ten arcane steps needed to add an action to the workbench?

+1

Although I think it should be moved to the Window menu (next to Close Perspective) rather than the File menu...
Comment 12 Paul Webster CLA 2006-11-09 07:18:41 EST
I've moved the command into the Window Category from File.  I haven't actually placed the command in a menu, and any user that wants it will have to bind the key of their choice to it.

Released in HEAD >20061109

PW
Comment 13 Paul Webster CLA 2006-11-09 07:19:36 EST
fixed

PW
Comment 14 Paul Webster CLA 2006-12-12 09:43:00 EST
in I20061212-0010

PW