Minor nit: Double clicking a source file containing multiple classes doesn't open the source file

Answered

In the project pane view, or whatever that is called:

If I double click on a java file, it will open that file.  But only if there's only one class in that file.

If I double click on a java file that has multiple classes, the classes open up underneath the filename and I can't then get to the file itself without clicking on one of those classes.

I find this pseudo-annoying behavior while I can certainly see how some prefer it.

Can this be turned off?  I want to double click a source file and always have that file opened up without having to hit F4, or similar.

Thanks.

 
0
9 comments

Can't reproduce, double click opens the file for me even if it has multiple classes.

You can file a bug at https://youtrack.jetbrains.com/issues/IDEA with more details (idea.log, OS, window manager, screencast of the problem, etc).

0

Serge, here's something I just discovered.

IF the java file with multiple classes is part of a directory marked excluded, then double clicking it opens the file every time.  It seems as if it needs to be actively compiled in order for it to be recognized as having multiple classes.

IF the java file is part of the module normally, double clicking it merely expands out an indented listing of classes underneath it.

So PLEASE VERIFY: If double clicking the java file always opens it in a tab, how do *you* expand it out to the class list?  Double clicking is what normally does that.

 
0

For me double clicking both expands it and opens an editor tab.

0

So how do you expand it to get the list of classes then?

BTW, not inner classes, but co-existing top level classes.  I'm talking about files like this (in Example.java):

public class Example

{

.....

}

class One {...}     // still in Example.java

class Two {....}    // still in Example.java

class Three {.....}  // still in Example.java

 

And double clicking the file entry:

> Example

will produce this:

V Example

(indent)One

(indent)Two

(indent)Three

 

So how do you replicate the above if you double clicking the file opens it up in the editor?  Is there a setting?  Were you never able to get the above behavior?

0

Clicking on the triangle expands/collapses without opening the file.

Double clicking on the node both expands/collapses and opens the file in the editor.

https://i.imgur.com/nUZBtir.gifv

0

Almost 4 years later and I also have this issue. 

0

Almost 6 years later and I also have this issue. 

0

Ricardo Santos 
Please vote and follow this issue: https://youtrack.jetbrains.com/issue/IDEA-333276 for progress updates.
As a workaround you can enable Open Files with Single Click option in the Project tool window options. However, all files will then open on single mouse click, not only ones with multiple classes.

0

Please sign in to leave a comment.