Eclipse: How do I refresh an entire workspace? F5 doesn't do it - eclipse

I have a workspace with a bunch of java projects. If I go to File->Refresh, it doesn't really refresh anything (perhaps the currently selected project). How do I get eclipse to refresh all of the projects?

It will indeed only refresh the current project (or, more specifically, the current selection in the project explorer). I just click somewhere in the project explorer, do Ctrl+A to select all projects and then press F5 to achieve a complete refresh.

If you want to refresh all Projects, ignoring closed projects, then the easiest way is to:
ctrl-click and item in the Project Explorer (to ensure the P. Explorer has focus)
ctrl-click the item again so that it's no longer highlighted (but the P. Explorer still has focus)
F5 will now Refresh the entire workspace
Effectively F5 refreshes the Workspace when a navigation view has focus and nothing is selected.

Ctrl-A, then F5.
You can set up the workspace to automatically refresh when it detects changes in the preferences. (Window > Preferences > General > Workspace > Refresh Automatically)

Easy.
Create an external tool: Run > External Tools > External Tools
Configuration...
Create a new Program configuration Point the location to an exe that is very fast (I use Cygwin's 'ls')
On the Refresh tab, choose Refresh Resources upon completion, The Entire Workspace
On the Build tab, deselect Build before launch
Run the tool to refresh all projects.

Control click all your projects together, then right click and hit refresh.
Usually I refresh all like that, then i make sure to clean all projects and rebuild in eclipse.

For anyone curious how to select all of those projects on OS X where Ctrl+A doesn't work:
Click the first project
Hold down Shift
Hold the ↓ key until they are all selected
Now press F5

This answer led me to an even simpler solution, no configuration necessary.
Cmd-3 build all (control-3 on windows)
Edit: Correction -- I need to both refresh and build. Build does not automatically refresh. I'm currently using two actions, "echo" from my comment in the linked answer I just referred to (an External Tool configuration with a hook to refresh all), followed by cmd-3 "build all"

Related

Can't see project explorer in STM32CubeIDE [duplicate]

Suddenly my project explorer window has disappeared from Eclipse. I try selecting Windows > Show View > Project Explorer, but nothing happens. What can I do?
Try Window --> Perspective --> Reset Perspective.... Remember that your own settings, if any, will also be reset.
Try to close Eclipse IDE and reopen it and
click on window->show view->project explorer
For me it was like this...
Window->Show View->Other->General->Project Explorer
Or
Window->Open Perspective->Other->Java (default)
Open Eclipse IDE
Enter "Project Explorer" on Quick Access (Search text box).
Either select from drop-down or press Enter
Window -> Perspective -> Reset
Reset the IDE
Window -> Show View -> Project Explorer
Select Window->Show View, if it is not shown there then select other. Under General you can see Project Explorer.
If none of the above solutions work, Try Window-> New Window
I had encountered the same problem as well. The following solution helped me to get over it:
Window -> Show View -> Package Explorer.
You can use the shortcut as well. It's Alt + Shift + Q, P
Using the latest Luna upgrade.
The only solution that worked was Window >> New Window.
It's very easy to lose that critical bar.
If you are on either Eclipse or Spring tool suite then follow the below steps.
(1) Go to 'Window' on the top of the editor. Click on it
(2) Select show view. You should see an option 'Project Explorer'. Click on it.
You should be able to do it.
Close the current perspective:
Reopen it using Window -> Open perspective.
i had also encountered this issue.
.
This Solution worked for me....
windows->navigation->maximize active View or Editor(ctrl + M)
.
in the screen you can see on left side navigation menus ... now click on those buttons one by one ....you will get your solution...
Try changing the perspective to JavaEE and then check.
Not sure if this is problem but, this ticked me off for a while since I did not realize what was happening at first - maybe this will help others.
Its not really a problem, just the way Eclipse works. (I'm use to Visual studio)
Its all about Perspectives!
I set up an (existing) PHP project in eclipse(neon) and then tried to configure and run debug. A Popup "Confirm Perspective Switch" is shown - I selected "Yes", not realizing what it actually does. The "perspective" then changes and you no longer see the project explorer anywhere. You cant "open" the project explorer window from top nav > window > show view, since its no longer there (which is BS, it should show something that gives you indication of current and other "perspectives" - at least for newbie.) No where now does it give project explore options.
Now you must change the "perspective" back from debug to PHP (at least in in my case).
This can be done a couple ways, easiest is from the icons on right top right side side. One icon would be the "bug", and next to it is the PHP icon. Just click the icon "perspective" you want. The other way is from top nav bar > window > Perspective > open Perspective, then select PHP. Could they hide this any deeper?
I know this is likely second nature to those who have used eclipse for a while, but was frustrating to me (on day one) till I figured out what was going on.
Please Select window in tool bar
Move to show view
Select project explorer
applied the same method to reset the perspective, no changes appaired then I restart the Eclipse IDE which was fine then.

How do you isolate a single project in Eclipse?

Whenever I Ctrl+Shift+W (close all tabs) in Eclipse and start or open a fresh project, the warnings and errors in the Problems view persist (from the previous projects in my workspace that were open in the past). How can I let Eclipse know that I want to focus on the current project only?
This varies by release, but there is a filters dialog (Try using the down arrow in the Problems toolbar and choose "Filter Content"). You can set the scope to be "On any element in the same project". The scope is determined using the current selection in one of the navigator views (Packager Explorer, Navigator, etc)

Eclipse reverts perspective on startup

Every time I start up Eclipse (Juno SR2), it reverts to the Java EE perspective, regardless of what perspective I was using before. When I add and switch back the the Java perspective, it has also reset all my windows (Search, JUnit etc.), and all my opened files has been closed as well.
We are a few people here who experience the same problems. Does anyone know how to prevent it?
Try setting up your perspective and configure it as you want it, and then select Window > Save Perspective As... Give the perspective a name and press OK.
Then go to Window > Preferences > General > Perspectives
Find your newly saved perspective in the list, select it and then press Make Default.

Eclipse Shortcut for Team - Synchronize with Repository

What are the shortcuts for the context menu actions "Team -> Synchronize with Repository" and "Team -> Update" on the whole project?
I have already found shortcuts, but these are executed only on the file i have currently opened. But I want to execute it on the whole project without having to scroll the project explorer to the top and right-clicking on the project.
If there are no such shortcuts, how can I create them?
As john.k.doe indicates, that's the right solution, but you also need to do something else in order to make the shortcut actually work, which is go to Window > Customize Perspective > Command Groups Availability and there just check the SVN box ;)
you can almost always get the key shortcuts you want by
go to preferences type "keys" or go to General -> Keys
in the field presented when you click on "Keys"
in the left pane, type the command you are interested in setting up a shortcut for:
the image below is from my mac, but it works the same way on windows/linux, you just might choose something besides Cmd-Y as your shortcut modifier. the U under User indicates that i was the one to add that modification.
I have written a small Eclipse plug-in which selects the active project in the Package Explorer so you can execute other actions (like 'Sync with repo' and 'Update') on it. I think this approach is more flexible compared to writing a plug-in that selects the project and executes a predefined action.
You can get the plug-in at http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/downloads/list, it is named "com.xakcop.select". Download it and put it in the dropins/ folder of your Eclipse installation. Then when you restart Eclipse, you will find a new command Select project in Windows->Preferences->Keys. The default key binding is Ctrl+Shift+Backspace but you can change it to whatever you want.
When you are in the Java editor just press Ctrl+Shift+Backspace, this will select the project that the current file belongs to in Package Explorer. Then press the shortcut for "Synchronize with repository" and you are done.
The source code of the plug-in is also available as part of my eclipse-tweaks project: http://code.google.com/a/eclipselabs.org/p/eclipse-tweaks/source/browse/com.xakcop.select
I think the answer to this question adresses the issue.
The quickest way I've found to update/synchronize, after having set the shortcut keys, is to click on the minimize button in the Project/Package Explorer and then press the keys. After the update, simply clicking on the last used file in the editor returns to the previous workspace state (provided the "Link with Editor" button in Project Explorer is selected).
I should clarify: I use a working set for each project. The working sets are displayed as default Top Level Elements in the Package Explorer so, by clicking on the minimize button the desired Project' working set, they collapse and are easy to select. Then, I apply the shortcut on the selected working set.
From my point of view, the problem is the focus of the commands you execute.
The Team commands Snychronize and Update are executed on the current object (In my case). As you noticed, when you execute the command on the project, the project is synchonized - when you do it on a file, only the file is synchronized.
What I did as workaround is the following:
I created Key-Bindings for the commands Show in (Navigator) (Alt-N), Go to (Alt-G), and Show View (Naviator) (CTRL+SHIFT+Q, N).
With Alt-N I show the current File in the Navigator. I can then use the keys to navigate to the root that I want to synchronize (it's not always the whole project for me). If the root is to far away I use Alt-G and type the Project or Folder where I want to go to and execute afterwards the Synchronize commands.
(Go to works only in the current view)
If you have selected the Project once you just have to switch to the navigator (Show View command) and execute your synchronize commands.
You could also use rgerganov's plugin then you would not have to execute as many commands.
The procedure works also with other views (package explorer, project explorer)
What about this approach? It should also work for other SCM's or commands you want to execute on any object in the explorer views.

package explorer is broken

this is what I`ve done
I clicked on a project with right button and I`ve selected open in new window. I had 2 windows. First I've closed the primary one, then the new one. After that every time when I run eclipse the project that I've selected to open in new window was the default one. My package explorer every time was in it and I had to click back. I just deleted this project and now I can't navigate in package explorer. It is still set to this project but I can't go back. What can I do ? How can I select the basic package explorer view ?
There should be an Up one level or a Back button enabled on the Package explorer view toolbar - I am not talking about the main toolbars similar buttons but one just under the view header. These buttons shall allow you to return to the original level with multiple projects visible.
This is the Up One Level button that Zoltan is referring to:
Symptom:
The package explorer dialog looks as if you have drilled down into an end node but the dialog is blank and there is no "Up One Level"/"Back Button" to click.
Solution:
Ensure eclipse is not running
Delete the following file:
workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
Start Eclipse
The workbench.xml file contains settings for the state of the package explorer among other things. I suspect that the package explorer settings get corrupted somehow.
Top right there is ViewMenu option menu (triangle downside oriented) - try some options there, or click project explorer tab(top left) and try refresh etc. It is hard to see what exactly happened to you.
In Eclipse, Window → Reset Perspective...