views:

200

answers:

2

I just started using eclipse for some personal projects and am finding the transition from IntelliJ (what I use at work) kind of annoying. I hope it's kosher to ask a few different questions in the same thread. Here goes:

1) How do I get "views" (I'm not sure if this is the term. I mean windows such as Project Explorer, Servers, Console, etc) to stay expanded and on top even after I've clicked back on the editor or another view. I'm pretty sure that right now all of these tabs are "quick views" that I have minimized and then docked, so I may not be doing this right to begin with. In intelliJ, I would simply just pin the tab.

2) How can I open a file (for instance, an ant build.xml) without having to make it part of an eclipse project? I want the syntax highlighting and ctrl-click ability that the IDE will give me (not to mention being able to use eclipse's built-in ant), but I dont need to associate the file with any others and so dont see the point of having to make it a part of a project.

3) Is it just me (wouldnt be surprised) or does eclipse have a bug with parsing empty html tags within the body of html tags of the same type. I've only tested this in a JSP, and it doesnt happen with JSF tags. For example: <div id="foo"><div id="bar"/></div>. Eclipse will give a warning saying the first div tag has no end tag. This is with the most recent version of eclipse for Java EE, no plugins have been installed.

4) Finally, a general question: Any best practices or resources to look at for organizing the eclipse interface and perspectives/views? What about workspaces/projects? Is there some tutorial out there that would be really informative that I could read through in less than an hour?

I appreciate any answers and tips/tricks. Thanks

+3  A: 

First of all, please acknowledge that there are different people in the world and there are people who don't work the "Eclipse way". Even if I was paid for it (and I am), I couldn't work with IDEA. So if Eclipse rubs you the wrong way, it may not be for you. That out of the way, your answers:

  1. In Eclipse, you open a view and let it stay where it is. In IDEA, the view changes all the time, things pop up and go away. Eclipse is static unless you specifically move things around. There are two ways to move things: You can minimize a part (a part is something which contains tabbed views). This moves the part into the closest border. Or you can maximize the current part (Ctrl-M). This pushes all other parts out of the way. Another Ctrl-M will restore the view.

    This is a good place to show the difference between IDEA and Eclipse. IDEA tries to anticipate what you're doing and to be helpful. For me, this means it always gets in my way. It will start to format source as I type, things move, etc. That freaks me out. Eclipse is like a toolbox. Everything is there but you have to pick it up. A toolbox doesn't move on its own accord and it doesn't try to be smart.

  2. Eclipse is based on the idea of a workspace. The workspace is the universe and nothing outside exists. If you need to go outside, you must first create a file or folder. In the "New File/Folder" wizard, you can open the advanced options (at the bottom) and link this resource to a real file/folder in the file system. May sound like a lot of effort but it allows Eclipse to display virtually anything in the explorer since it just shows "resources" in there, not actually files.

  3. Smells like a bug. Please report it at https://bugs.eclipse.org/bugs/

  4. I'm not aware of anything.

[EDIT] 3. As cletus pointed out, is not valid HTML. So that might cause the warning.

Aaron Digulla
Regarding #1 - Eclipse has a notion of perspectives which contains views as described. By switching between perspectives the views collection is kept.
Thorbjørn Ravn Andersen
+1 for universe.
Thorbjørn Ravn Andersen
thanks for your answer. there are a couple of things i'd like to clarify. (a) i definitely dont wanna frame this as an eclipse vs. intelliJ flamewar. ive had a lot of experience with intelliJ and not a lot with eclipse, which explains why I might not be "getting" things that are done "the eclipse way". (b) you gave a great answer but i hesitate to mark yours as accepted, because yours is the only one. perhaps a deficiency in the way SO works?
john
@john: a) give it a whirl but don't blame it on the tool when it doesn't feel right for you. Tools are different and people are different and some things just don't mix'n'match :) b) 45 people had a look and no one had a better answer.
Aaron Digulla
A: 
  1. An Eclipse Perspective is a collection Views and their position. You can customize or create new perspectives, but the existing ones are good enough for a start (Java, J2EE, Java Browsing etc.). I recommend to stick with the default layout for a while until you've managed to use the quick view feature (which, personally, i find quite annoying). On small screens, i simply like to use Ctrl-M to switch the Editor to fullscreen mode and back, without the need of minimizing single views or move them around.
  2. Yes, you can run external build scripts as well and it's called External Tool in Eclipse. Go to Run > External Tools > External Tools Configurations. Create either a new Ant-based config or a native executable (Program). The location of the build script or executable can either be workspace-relative (Browse Workspace) or absolute on the file system (Browse File System)
mhaller