I would like to have Eclipse (3.5, if that matters) close any open projects I have before I exit my workspace. Is this possible?
EDIT I forgot to mention that these projects are remotely stored and it would be nice for that reason as well.
Go to package Explorer , select all the projects then go to Project -> Close Project. This will close all the projects.So next time when you start Eclipse, it will not load all the projects and it will response earlier than before.
Closed Project in Package ExplorerA closed project is visible in the Package Explorer view but its contents cannot be edited using the Eclipse user interface. Also, an open project cannot have dependency on a closed project. The Package Explorer view uses a different icon to represent a closed project.
In response to "In the drop down menu of Package Explorer, you can select Filters and choose Closed Projects. This will automatically hide all the projects that are closed." Don't forget to right-click on the project and select close project. If you don't do this, it will not 'automatically hide'.
Update 2011:
To actually close all projects on exit, you need a plugin similar to the one mentioned in this thread:
I have implemented
shutdown()
of my plugin to close all the project and save the workspace.
Note: today, you would implement the stop()
method of an AbstractUIPlugin
, since shutdown()
has been deprecated in Eclipse3.0+.
In it, you would call IProject.close()
.
But you also need to set the org.eclipse.ui.IWorkbenchPreferenceConstants.CLOSE_EDITORS_ON_EXIT preference (the one I originally referenced below) for Eclipse to not try to restore those editors when you restart Eclipse again.
If you don't, you will get some exceptions like:
Could not restore workbench layout
Unable to restore editor -
createElement returned null for input element factory:
org.eclipse.ui.part.FileEditorInputFactory.
Original answer back in 2010 ;)
This preference is close you need (from this JavaTips) -- it does not close projects, but at least clean your workspace:
> General > Editors > Close editors automatically
When any workspace of the eclipse is closed without closing all its editors and again opens the same workspace, it opens all the editors again which were opened at the time of closing.
This might cause slow down the starting of the eclipse.
So it is better to close all the opened editors before closing the workspace.All open editors can be closed automatically with the closing of the eclipse workspace.
I guess you can write a plugin to do it but since you're the first person who seems to need this, nothing like this exists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With