How to prevent Eclipse from showing the opened file in package explorer - eclipse

somehow I've ended up in a situation such that when I navigate through source files with Eclipse, the Eclipse always selects (and expands) the opened file with package explorer. With this I end up
losing my location on Package Explorer
Having my Package explorer expanded and pretty confusing.
With brief googling/exploring on the preferences I couldn't find this one..
Eclipse version is 3.4 if that happens to matter.
Thanks in advance,
Touko

Turn off the "Link with Editor" option in the Package Explorer toolbar.
(the left/right arrow icon, turned on here)

Select a source file, right click on it, choose "Open with" and then "Java Editor". The Java Editor should be the default after that for all java files.

Related

Eclipse insists on opening java files in Sublime

We recently upgraded our copies of Sublime. Problem is now our developers that use eclipse are having trouble opening java files. It seems that Eclipse has for one reason or another decided that half of the java files should be opened with "Java Editor" (when you right click and go to Open With) and the other half should open in "System Default" which as it turns out, is Sublime.
Where is the button I press to reset this stupid thing so Eclipse will open java files in Eclipse?
Eclipse "remembers" when files were "Open with"-ed with a certain Viewer and opens that file always with that Viewer from than on (it gets highlighted in the Options list and overrides the file-association).
You could try to change it back to the default by choosing "Default Editor" in the "Open with" context menu option in Project Explorer for each file that behaves strange.
The default editor for a file type can be set through Window>Preferences>General>Editors>File Associations. If multiple editors are set for .java and it's bugging out then possibly removing all editors except the default will help.

Eclipse: Open in New Window

In Package Explorer I right-clicked on project and selected "Open in New Window". New Eclipse window was opened with that project. Then I closed old, "main" Eclipse window, so only new "project" window remained.
Now each time I launch Eclipse I have this "project" window with project name in window title and Package Explorer drilled down into this project. And I need to press "Up" button in Package Explorer to see all my projects.
How can I restore default behaviour and launch Eclipse with workspace scope and not project?
My original answer: Once you get the Package Explorer the way you want it, if you exit Eclipse cleanly it should come back that way.
My revised answer: It looks like a bug, even if you exit cleanly it comes back inside of the project. And in fact when you create a new window no matter what it puts you into the project. Even if you switch to the project explorer.
I found a way to fix it though, do a Window -> Close All Perspectives, then open the Java perspective and exit and come back in and you should be OK. I have filed this bug about it.
Close the project properly " File --> Close All", Then restart eclipse.
OR you can create a new work space " File --> Switch Workspace --> Other..."
Im not sure this is what you are looking for but the Documentation offers a command line option to select the start workspace:
The workspace is the physical location (file path) you are working in.
You can choose the workspace during startup of Eclipse or via the menu
( File → Switch Workspace → Others.

pydev plugin in eclipse not showing the files in the project explorer

I am using pydev plugin in eclipse. I can create the project, but I cannot see the files in the project explorer.
I am attaching the screenshot. Any idea how to fix it.
Thanks
Kiran
in Pydev explorer Ctrl+F10 then from Top Level Elements choose Projects. It will show the projects in your workspace
I got a little workaround. I'm not sure what the difference between "PyDev Package Explorer" and "Package Explorer" is supposed to be, but it's clear that one of them is buggy.
I'm well aware that this is from 2011, but I came across this question while searching for it. I hope my answer will help someone.
Ensure you are in the "PyDev" perspective.
Top menu bar > Window > Customize Perspective...
Menu Visibility tab
Under "Edit", tick the "Show views" box (it might be half-ticked somehow depending on how your OS displays that). Press OK.
Top menu bar > Window > Show view > Package Explorer
A new 'view' should now be visible, called "Package Explorer". Move Package Explorer to an appropriate space (click and drag).
Delete the old "PyDev Package Explorer".
It seems that Eclipse does not have the resources up to date...
Have you configured Eclipse to do automatic refresh of resources?
Preferences > General > Startup and Shutdown: check 'Refresh workspace on startup'
Preferences > Workspace: check: Refresh automatically (this depends on your Eclipse version -- in 3.7 the settings were changed a bit, but it should be easy to know which configurations are related).
You can also try making a manual refresh: either F5 or right-click: refresh.
Another thing to check is if the path of the project is actually the path you're expecting (i.e.: the path that has the resources) -- you can press Alt+Enter to open the properties for the project and check if the location is actually correct.

How to show all files in Eclipse navigator/explorer?

I do not see some of my files in the Eclipse Navigator view (or Projet Explorer or PyDev Package Explorer).
I tried to go to "Customize View..." and remove all filters. It didn't show *.pickle files, but it did unhide some other file types (.* resources).
Remember to refresh the view: Right-click the background of the Explorer/Navigator view to open a context menu, then choose "Refresh" (F5).
Restarting Eclipse doesn't help.
If you are using a Working Set, you can try the similar procedure that helped me with PHP Explorer and Navigator.
Look for the answer with pictures here:
Folders and files don't appear in PHP Explorer in Eclipse IDE

Eclipse folder Referenced Libraries disappears

In Java projects in Eclipse version 3.4.1 sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder. The project compiles and runs fine. It seems to be a GUI problem.
How can I get this folder back?
First, bring up the "Package Explorer" view (instead of the "Project Explorer" view).
Then, if the referenced .jar files still are visible in the root of the project, click on the little "down arrow" icon in the top-right corner of the Package Explorer view. In the context menu that appears, one of the items on the menu is "Show 'Referenced Libraries' Node." Click on that menu item.
I've been struggling with this thing for a while in Eclipse Juno because it's a little bit different.
click the little down arrow as before
click Customize view
check Libraries from external
For those hitting the issue today (Kepler): it is possible that you are in the "Java EE" perspective, which by default has the Project Explorer. Simply switch to the "Java" perspective and it will replace Project Explorer with Package Explorer, which will have the missing Referenced Libraries folder.
Make sure you're actually in Project Explorer and not in some other view like Navigator, like my friend was...
Use the Package Explorer view instead of the Project Explorer view.