Is there a method you would recommend to create the class diagram (uml) of my java project in IntelliJ?
Yes, there is a method in IntelliJ.
If you select you package file and right click on it and select Diagrams, after that select the Show diagram options. After that click on Java Classes Diagram.
If you want to show more details right click on the corresponding package, and select.
[This is the package] -> https://i.stack.imgur.com/jRHjT.png
[This is the second step]-> https://i.stack.imgur.com/6fcNg.png
[This is the last step] -> https://i.stack.imgur.com/szHOt.png
[This is how you show more details] -> https://i.stack.imgur.com/aYx5H.png
Related
When I use the "Project Pane -> Project" view in IntelliJ, my Java package paths are collapsed based on the Modules in my Project Structure (e.g. com.company.project). I would like to use IntelliJ for code reviews, so I've checked out the changes locally and am looking at the "Project Pane -> Changed Files" view, but this doesn't pick up the project structure, so each folder takes an extra line. Can I get the best of both worlds here?
I figured this out with the help of this answer about expanding the folders (which I also wanted to do) How to expand folded package chain in Intellij IDEA?
Right click on "1:Project" to see the options for the project pane and then check "Flatten Packages".
I'm getting started with IDEA and new project. I want to see the whole project's class diagram. I searched, and it says on SO that I have to
click Diagrams > Show Diagram (Ctrl+Alt+Shift+U). You will see your package in diagram editor.
but I only see one box for the whole module. But I want to see all classes, relationship between them etc. How do I do this?
I'm using the latest version of IDEA Ultimate: 2017.3
When invoked on the whole Project - it builds the diagram for the modules, not for classes. To have the Java class diagram invoke show diagram action on a specific package or if you want to see all the packages and classes in project invoke it on a module's source root. To expand a package (show it's content), select it and invoke "Expand" (E default shortcut) action.
In Java source files, when I select a class or a method, then click the right button of mouse, in the pop up context menu, and run Find Usages, the files that use the class or methods are searched out.
But I would like to exclude certain files (e.g. JUnit test files) from the search results.
Where could I configure this?
From the docs; you can confgure the Find Usages scope by clicking on the tools icon in the top left hand corner of the Find Usages results.
Here are some screenshots:
Click on the tools icon here:
Click on the build button (... next to the Scope field) to create a Scope and define it like so (in this examples I have included production classes and excluded test classes):
Choose that scope in the Find Usages dialog:
Notes:
You can also chose the precanned scope named Project Production Files from the Scope dropdown
All subsequent searches will use this scope by default until you choose a different scope.
When I do a file new in my IntelliJ idea. I see a menu like this one
I want to see classes from Java and Scala on the top. I don't want to uninstall plugins for ruby etc. But these should not be on the top. I mostly code in java and scala and therefore want these classes to be one top.
When I want to create a new Java class, I activate the "Project" view. Then I select the package to which the new class shall belong to. Then press Alt+Insert. This popup menu is shown:
Please ensure that the directory you're creating a class in is under a module source root. You can navigate to it in Project View, right-click on it or any its parent and choose Mark As... | Source Root
I want to contribute a popup menu action to an existing editor which is provided by a 3rd party plugin. Inside my viewerContribution I need to specify targetID of the editor I want to add the menu entry to - but how do I get to that ID?
The sample code I found so far only contributes to self made editors but never to something that's already there.
This is pre Eclipse 3.5 so I use the "old" org.eclipse.ui.popupMenus extension point.
See Plug-in Spy.
Hit Alt + Shift + F1 on an editor to see its ID and contributers.
Plug-in Menu Spy
Press Alt + Shift + F2 will change the mouse cursor to spy mode. Now select an menu entry. It will reveal the menu ID and its contributers.
btw...you can not get ID for some platform contributed menu items because they don't have one.
You can find the interface summary and class summary of all the Eclipse IDE contents here.