class view in eclipse - eclipse

In Eclipse, is there a way to have a Package Explorer like view that shows the classes without having to open the files individually.
I have this project where many classes are written in same files, and that makes navigating them so annoying. Is there some sort of ClassView in Eclipse that disregards file names.
Regards

This question is currently almost 2 years old, but for anyone ending up here through a Google search (like me):
Eclipse offers a "Java Browsing" perspective which is probably what you want. To see this, go to Window -> Open Perspective, and select Java Browsing.

You can use the Outline view.
Window > Show View > Other. Filter by the word 'Outline' (it's under General folder)

window->show view->outline was helpful for me as this was the only window missing in existing perspective.

Yes you can use F3 key if you're seeing this class, o you can use Ctrl+Shift+T shortcut to open 'Open Type' and write in it the name class

Okay, it's been asked a long time ago. You may be looking for the Breadcrumb. Searching for it and got this question. Suddenly I did it unknowingly and shared here. There is a button beside "Save", "Print" buttons; "Toggle Breadcrumb". :)

Related

Show the name of the containing folder in the Eclipse tab of a file

I have the same set of files in N folders, one of them, say, blank.xhtml. The files contain somewhat similar information and it is becoming overwhelming to figure out which file comes from which folder every time I switch between the tabs. When I open one of them to edit and happen to open a file with the same name from another folder I get confused and more often than not end up editing the wrong file: nullifying my hard work. So I am wondering if there is a way to show the name of a containing folder in the tab like this G-06/blank.xhtml or G-07/blank.xhtml. I will be very very thankful to anybody who has pointers to how I can make this happen.
As an addition to the Maroun's answer there is an alternative solution.
It's not exactly what you want (full name in the tab's title), but may be useful sometimes.
In the "Project Explore" view (the same goes to "Navigator" view) click the "Link with Editor" button. That way, whenever you choose some file opened in the editor, it will be automatically selected/highlighted (see the picture) in the "Project Explorer" view.
Here is the picture:
Maybe this will be useful to you too.
If you hover the mouse over the tab containing the file name then a popup appears showing the full path. Not exactly what you wanted, but it should help. (This with Eclipse Neon.3 Release 4.6.3 on a Mac).
Not quite what you're looking for, but ctrl+shft+e will open the switch editor window that shows all the open editors with their filepaths. I use this shortcut for the same reason. I'll have multiple build.gradle files open from multiple projects and this helps pick the correct one

Display Eclipse tabs on several lines

I'm using eclipse galileo. Is it possible to display the tabs of my open files on several lines instead of using the >> sign. I still want a unique window to view the code though.
If there is no such settings, do any plugin exists ?
No.
Bug 58945: CTabFolder should support multi row and vertical style options, opened since 2004! (other bugs exist on the same topic)
(Update Feb. 2017: it seems to be assigned, with Oxygen 4.7 as target!
Thank you specializt for mentioning that in the comments)
CTRL+F6 is one workaround for now.
Other "workarounds" are listed in this thread:
turn on the "close editors automatically" option (preferences > General > editors), which will close editors automatically when the limit is reached an a new editor is to be opened.
make use of multiple windows each with a set of editors for areas you are editing or browsing or searching
CTRL+Shift+W to close all tabs quickly
As mention by Big Chair in the comments:
Someone made a workaround here: "Eclipse multiple tab rows"
Wes explains:
I've discovered that while it is true that you cannot have multiple rows of tabs for the same code-space, it is possible to have multiple rows of tabs showing on your window at the same time:
To accomplish this, simply drag a tab up to your title bar and release. It will create another row of tabs.
ctrl+shift+e gives a nice dialog with all open windows.
ctrl+e gives the "quick" version of this dialog.
I found this plugin, which lists all open windows in a separate tab, and lets you open windows with a single click:
http://sourceforge.net/projects/editorviewer/
As far as I know, there is neither such setting nor plug-in (at least freely available). But if there is, I'd like to be corrected.
The Open-Editor plugin does it. But it has issue.

How can I close an empty pane in Eclipse

I often end up with lots of empty panes in Eclipse that can only be minimized but not destroyed. How do I close these?
Update:
In this screenshot you can see two minimized on the upper left and several on the right hand side. In the center are four more. They only seem to be restorable in the Debug mode.
http://img406.imageshack.us/img406/9900/eclipse1.png
this happened to me, too. What worked for me (based on FilmJ and douncon's comments) was to open a class file, then drag that tab over the top of the empty pane.
Select Window -> Reset Perspective. That should reset the current perspective (what you call "mode") to its' initial state, (hopefully) closing all irrelevant views.
Something seems terribly wrong with your Eclipse. Maybe you should reinstall it. It is possible that you installed a buggy plugin.
First of all, what do you mean by pane? Eclipse has:
Windows (Eclipse itself, e.g. instance)
Documents (tabs)
Views (properties, tasks, explorer, etc)
If by 'pane' you mean document editors, you have problems either with your Eclipse version or most likely one of the installed plugins.
Each View also can be closed (except maybe some project types (perspectives) of which I'm not aware). For CDT (C/C++) you can close practically everything.
I'll recommend you download latest Eclipse version with no plugins, extract it to different folder, and check if that happens again. If yes, please explain more in details (like Eclipse version, perspective you are using, any side plugins, etc).
Also a good places are Eclipse community forum, mailing list and bugz :-)
I had the same problem. For me it helped to go into the right perspective and activate the functionality that caused the window in the first place. Once I reactivated the functionality, in my case "QNX Memory Analysis perspective", I was able to close all the windows one by one.
The conclusion is you have to refill the empty windows with content and then you will be able to close them properly.
So, it's really very easy for this to happen, if you open an editor that's incompatible with the existing editor, you can often end up having to place it outside of the tab list in one of your editor panes, then you might clear or copy that, typically while trying to add that view to a tab list.
In any case, what it's done is create a new editor, and all you need to do is drag some file to that empty editor window giving it some form of context, then close it.
I had the same issue. I followed #zvikico, but instead of just resetting, I first reset and then closed all the perspectives. Please follow the following to fix the problem. It worked for me:
Window -> Perspective -> Reset perspective..
After resetting follow below:
Window -> Perspective -> Close All Perspectives

Eclipse: shortcut for "open project"?

Is there a shortcut in Eclipse for "open project"? Ideally, I'd like something like the "Open Resource" dialog.
I want this because I have a "testing" project, which I use whenever I want to try something out… But it's annoying to scroll through the massive Navigator trying to find it and click it when it gets closed.
Not by default. The action is defined here, with no keyboard shortcut.
http://eclipse-tools.sourceforge.net/Keyboard_shortcuts_(3.0).pdf
You could add a Working Set that contains only your test project, and use 'Select Working Set...' functionality from the Navigator tab's view menu:
While this won't open the project for you, it WILL make it the only thing you see in navigator or package explorer.
Once you've added it, it will be in a list and you won't need to open the 'Select Working Set...' dialog, just select 'my test project' from the popup menu. It's triggered by that small triangle in the upper right of Navigator, I'm not sure if there is a shortcut.
To switch back to your normal work, simply 'Deselect Working Set' and you will then see everything again.
I also find the 'Collapse All' button/shortcut to be handy when finding things in the Package Explorer or Navigator tabs.
I'll offer a solution to a problem I've had which, if I've interpreted the question correctly, is very similar to yours.
I find that when I have a lot of projects with loads of expanded directories/packages inside Project Explorer, trying to find a particular project is irritating because I have to scroll through all this. I could collapse all projects down but then I also lose my current position in every project.
I'd just like to be able to search for a particular project by name and open it, in the Project Explorer tree. Opening a file inside the project using Open Resource isn't a good enough workaround, as having to think of the name of a file inside that project completely out of context is often equally annoying!
A solution that works great (at least in Eclipse Juno, Mac OSX) is, with the Project Explorer focused, to hold Shift and start typing the project name. This dynamically selects the best matching project in the Explorer as you type. Then with your hands still on the keyboard you can use the arrow keys to open up and browse the project.
It ain't pretty but it gets the job done, and saves some valuable seconds :)
You could also:
switch workspace (in a workspace with only this test project in it) (no shortcut: you can define one)
install mylyn and select a "test" task (which would immediately empty your Navigator view, leaving only the relevant classes/methods).
If the test project is already opened and you know the name of the class in it, you could go to this class with Navigate -> Open Type (There is a shorcut also, on mac osx is Shift + Command + T)
I find it easier to move with this method, but I didn't know it until someone else showed me, maybe it helps.
You can set a shortcut at Preferences->General->Keys, search for Open Project. However, for me it does not work from the editor itself. I have to click the package explorer, for example. Also, if you have a lot of projects, there will be a huge list of them as well, as expected.

Is it possible to work in Eclipse with keyboard only?

as most of us surely do every now and then, I try to improve my workflow. As Eclipse is my main IDE, I wondered if it may be possible to use it without mouse. I browsed the available shortcuts and tried to use them instead of my mouse. I found interesting features like Ctrl+3 which opens something like the Apple spotlight.
I know there are a lot of questions concerning favorite shortcuts etc. but I'd like to know if it works because at the moment it feels a bit squishy 100% without mouse.
So is anyone out there using Eclipse like that? And are there some hints to ease the change?
Yes, it is possible. For a start, check out 10 Eclipse navigation shortcuts every java programmer should know. When you use these 10 shortcuts and some of the shortcuts of the comments, you will already see a big performance boost.
The "open type" and "open resource" dialogs are CamelCase-sensitive, so when typing "NPE" in the open type dialog, I get two matching items NoPermissionException and NullPointerException. So using good names with consistent spelling is a must.
Ctrl+F11 starts a program, F11 debugs it. Note howewer to check if in Window-Preferences-Run/Debug-Launching the value of "Launch Operation" is set to your needs.
You may want to customize the search dialog (Ctrl+h) to only show the file search (default is to context sensitively present you with different search tabs).
Ctrl+n allows you to create something new (opens a wizard with an initial filter text to filter the possible next pages).
I'm a blind programmer who uses eclipse. While there are plenty of shortcuts I find people often overlook using menus from the keyboard. If there's a function you use a lot that doesn't appear to be supported with keyboard shortcuts you can either create a shortcut to it in prefferences or use keyboard shortcuts such as alt+f to access the file menu and a one letter combination that allows you to access the item. For example hit alt+f then a to access the save as dialog. The underlined letter is the one you want to hit once in the menu.
There are a couple of things you can do to improve your keyboard:mouse usage ratio with Eclipse.
First off, if you push Ctrl-Shift-L, it shows you a master list of all the shortcuts you can use. If you know what you want to do, this is usually a quicker way of doing it without having to dig through menus, and as a bonus, you will learn some shortcuts you didn't know before.
The other thing you can try is a plugin called MouseFeed which looks promising. It tells you the shortcut for any menu item you use and if there isn't one, reminds you to create one. It essentially acts as training wheels until you become as close to 100% keyboard use as possible. I'm not sure how well it works in 3.4, but you can give it a shot.
Hope that helps.
Here you get an Eclipse Shortcut Overview PDF file of all key bindings. This file you can print and put beside your keyboard if you wish.