netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Add a "Close Right" in menu

Open fredericch opened this issue 3 years ago • 4 comments

Description

Add a "Close Right" function on the menu along "Close", "Close All" and "Close Other".

When at least 2 files have been opened, we could close all windows on the right of the current active one.

image

It would be the same implementation as in Chrome or FF.

Use case/motivation

When doing a search, I often open "new" windows which are actually not currently usefull and it clutters the tabs. So I spend a lot of time closing them individually. It would save a lot of time to be able to close them all at once.

I cannot use "Close Other" or "Close All", because the tabs on the left are usually the ones I am working on.

When a lot of windows have been opened if the search was too generic, I use this work around:

  • Close All
  • Open all modified files from the Git menu

Related issues

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

fredericch avatar Oct 01 '22 16:10 fredericch

makes sense. Added good first issue label in case someone wants to implement it.

I just checked how FF solved this and it has Close Tabs to Left, .. Right and Close Other Tabs in a sub menu.

NetBeans however also supports multi row tabs which would make this a bit more difficult to implement.

mbien avatar Oct 02 '22 04:10 mbien

When too much files is opened I like to use documents list format for manage it: image

but in that format would be good to have close button to group of documents: image

6PATyCb avatar Oct 09 '22 14:10 6PATyCb

@6PATyCb thats a good idea but next time, please open a new issue. I moved it to #4760

mbien avatar Oct 09 '22 15:10 mbien

@6PATyCb thats a good idea but next time, please open a new issue. I moved it to #4760

I thought this was just part of the discussion about usability of documents tabs, but since it looks good as a separate feature, why not :)

6PATyCb avatar Oct 09 '22 16:10 6PATyCb

Hello can @fredericch, @6PATyCb, or anyone assign me this issue please?

ghost avatar Oct 13 '22 16:10 ghost

@mbien can you please?

ghost avatar Oct 17 '22 23:10 ghost

@tc430gi Actually you can open a PR or a draft when ready so that a reviewer can take a look. :)

fredericch avatar Oct 17 '22 23:10 fredericch

Hello can @fredericch, @6PATyCb, or anyone assign me this issue please?

I don't have a rights

6PATyCb avatar Oct 18 '22 12:10 6PATyCb

you can simply open a PR if you want to contribute a change. You don't even need an issue for that or someone assigning an issue to you.

mbien avatar Oct 18 '22 14:10 mbien

Can you help me navigate a little bit in the project? @mbien

ghost avatar Nov 07 '22 18:11 ghost

@tc430gi I don't know that area well but after searching a bit around:

the logic for closing tabs seems to be here: https://github.com/apache/netbeans/blob/2c27f5a31b64dc0a8e3ddbd08a3223f7ed1d141e/platform/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java#L317-L333

actions are setup here (and the method below too): https://github.com/apache/netbeans/blob/c084119009d2e0f736f225d706bc1827af283501/platform/core.windows/src/org/netbeans/core/windows/actions/ActionUtils.java#L60-L77

If you need more info it is probably better to ask on the dev list or open a discussion on github.

mbien avatar Nov 07 '22 19:11 mbien

Once https://github.com/apache/netbeans/pull/4792 merges I'll submit a PR which does a few changes in related areas in ActionUtils.

Most likely you'd need a new action similar to CloseAllButThisAction and CloseAllDocumentsAction.

eirikbakke avatar Nov 07 '22 21:11 eirikbakke

this plugin sounds like it is covering exactly this features:

https://plugins.netbeans.apache.org/catalogue/?id=78

mbien avatar Dec 10 '22 13:12 mbien

I already have a plugin for this feature which is open source (originally implemented by @AlexanderYastrebov), maybe the code helps to implement this feature: https://github.com/funfried/nb-editor-close-left-right

Edit: Just saw @mbien already put a link to the plugin catalogue page of the plugin

funfried avatar Dec 01 '23 13:12 funfried

is this issue still open to contribute on? @mbien

ashwintemkar avatar Jan 22 '24 13:01 ashwintemkar