Bug 462513 - Project explorer - Hierarchical Presentation - close parent doesn't close children projects
Summary: Project explorer - Hierarchical Presentation - close parent doesn't close chi...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows NT
: P3 normal with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-18 17:32 EDT by Gautier de SAINT MARTIN LACAZE CLA
Modified: 2020-05-26 16:15 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gautier de SAINT MARTIN LACAZE CLA 2015-03-18 17:32:50 EDT
In Eclipse Mars M5, I work on webtools.jsdt project with a hierarchical presentation. 

If I close the parent project with "Close Project" option (right click on the project then close project) then the project is closed but children are always open. 

I think that closing parent project should close children.
Comment 1 Mickael Istria CLA 2015-03-19 02:13:51 EDT
(In reply to Gautier de SAINT MARTIN LACAZE from comment #0)
> I think that closing parent project should close children.

I'm not sure the generic "Close" operation should do that. However, we could think of a new contextMenu, only visible when hierarchical view in enabled, called "Close project hierarchy" that would perform this operation.
What do you think?
@Dani @Lars: what's also your opinion about my proposal?
Comment 2 Andrey Loskutov CLA 2015-03-19 02:19:21 EDT
(In reply to Mickael Istria from comment #1)
> (In reply to Gautier de SAINT MARTIN LACAZE from comment #0)
> > I think that closing parent project should close children.
> 
> I'm not sure the generic "Close" operation should do that. However, we could
> think of a new contextMenu, only visible when hierarchical view in enabled,
> called "Close project hierarchy" that would perform this operation.
> What do you think?

Or open similar question as on opening projects: "schould nested projects be closed too ?"
Comment 3 Dani Megert CLA 2015-03-19 04:03:38 EDT
How about other operations like Delete, Move, etc.? It would be nice to find a common solution instead of duplicating the commands.
Comment 4 Gautier de SAINT MARTIN LACAZE CLA 2015-03-24 04:32:41 EDT
Personally I prefer Andrey proposal and I agree with Dani. It will be nice to have the same behaviour for each action about opening and closing a project with subproject.
Comment 5 Mickael Istria CLA 2015-03-24 04:33:56 EDT
I also prefer Andrey's and Dani's approach, although it's another level of difficulty.
Comment 6 Ben Tatham CLA 2016-08-05 09:21:55 EDT
We also need the inverse - to Open Hierarchy.  See Bug 499231.
Comment 7 Francois MAROT CLA 2018-09-20 10:06:18 EDT
For the record, Mickael Istria implemeted in Eclipse Photon the feature to delete the children when the parent is deleted.

Bug 525882 - Delete project dialog to also allow to delete "children" projects : https://bugs.eclipse.org/bugs/show_bug.cgi?id=525882

I think this "recursive close" feature would be very usefull and I can imagine its implementation would be very similar to the "recursive delete" one.
Comment 8 Samir Huremovic CLA 2020-05-26 13:56:03 EDT
Any news on this feature? I think having to manually close every project should be a no go, in my case it would be 20-30 projects.

Mosly I leave the projects open although I do not want to, or just delete them. Just because it is not possible to close child projects automatically.
Comment 9 Mickael Istria CLA 2020-05-26 14:48:10 EDT
Have you tried to just delete them? It's actually not so different from closing in term of result. The only difference is that you'll need to reimport instead of reopening, but imoorting projects is an easy operation with File > Open Projects from Filesystem... So there is no big overhead with deleting instead of closing.
That said, if you want to contribute the code to close a hierarchy of projects, it would be welcome.
Comment 10 Samir Huremovic CLA 2020-05-26 16:08:15 EDT
That is actually a good enough workaround, deleting the projects but not the contents on the disk, did not think of that.

I have no experience with the technologies used within eclipse, I'm just a regular Java EE developer. Can you point me to resources so I can give it a try in my free time?

For example, looking at the eclipse git repositories, I have no idea where the relevant code is.
Comment 11 Mickael Istria CLA 2020-05-26 16:15:38 EDT
(In reply to Samir Huremovic from comment #10)
> I have no experience with the technologies used within eclipse, I'm just a
> regular Java EE developer. Can you point me to resources so I can give it a
> try in my free time?

I suggest you start by some tutorial about plugin development so you'll see how to run and debug a modified Eclipse IDE from your development IDE with simple example.
Then, you can start opening some bits of the IDE code in your workspace and can modify/run/debug them.
 
> For example, looking at the eclipse git repositories, I have no idea where
> the relevant code is.

The relevant code is probably https://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CloseResourceAction.java