IntelliJ file new move Java Class on top - intellij-idea

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

Related

Cannot add menu to org.eclipse.ui.main.menu through Model Fragment Definition in Eclipse 4 model editor

I have a eclipse-rcp application developed with Eclipse 4. This application is modularized with several plugins and features. This application is built with maven-tycho using pomless. The project structure follows the guidelines proposed by vogella for Eclipse Tycho.
This project has a main Application model defined in the plugin app.rcp (Application.e4xmi). It has several plugins that extend this application model through several fragment.e4xmi files. Specifically, in one of them, I modify the application model to add a menu to the application main menu with the following line in the frament.e4xmi:
Extended Element-ID: org.eclipse.ui.main.menu
Feature Name: children
Position in list: index:1000
This model fragment allows me to add menus, handled menus and so on without any problem through the Eclipse 4 model editor.
At this point, my objective is to build a separate feature, which is not in the same project, to add a similar menu to the application main menu, which will be installed in the original application using a p2 update site.
For this, I have created a plug-in with an application model fragment (fragment.e4xmi). I try to modify the file with the Eclipse 4 model editor pushing Find... of Extended Element-ID field. However, when I select Menu in Container-Type, there is no item that I can select. In the other plugin I can select the Main menu (org.eclipse.ui.main.menu) and other created menus.
I have tried to add dependencies to the plugins of the main application. The project compiles in the command line (mvn clean verify), but in Eclipse IDE it shows that it cannot find the plug-ins of the main application.
EDIT:
The problem here is that the combo to add Menu, MenuSeparator, HandledMenuItem, etc is disabled, so I have no way of adding any of it. When I push the add button, it does nothing. I have tried to use a text editor to change the fragment.e4xmi file directly, but I haven't been able to test if that works.
The combo box that I refer to is located below the "Position in list" field of the model fragment ( see Model Fragment editor image)
You must add the menu to the 'Imports' section in the fragment.e4xmi to make the 'Find' dialog work.
You can also just add the id manually, it should still be resolved properly when the model is being loaded.

IntelliJ IDEA Ultimate: how to build UML diagram for the whole project?

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.

View Source on File Double-Click?

I added Foo.scala as a new Scala class within my IntelliJ 14.1 project:
class Foo
object Foo
When I click on this file once in IntelliJ, it expands the Class and Object:
I find it to be a hassle to have to click the file (Foo.scala), and then double-click the Object/Class to view the source.
How can I configure IntelliJ to open the source file once I double-click on the file name, i.e. Foo.scala per this example?
You can't. Please file an issue at JetBrains if you want to have this improved.

How to reopen ViewPart?

I am working to make an Eclipse Plugin. I used a plugin project template that generated a View class which extends ViewPart. I think that it is part of SWT.
My problem is that the View is like a window inside of the main Frame which has buttons for close, minimize. I clicked on the X button of the View by mistake. Now I cannot make it visible again even if I relaunch the Eclipse Application.
Now, my Eclipse application looks like this:
It had some panels and buttons before. But I cannot make the View visible again. How should I make to bring it back? I have tried to delete the plugin project from Eclipse and import it again. But it did not work.
I bet that there it is an easy way to make the View visible again but I do not know how. Is there any setting through MANIFEST file? Or other file?
Specify the -clearPersistedState argument when you run the RCP (this assumes you are using Eclipse 4.x).
1) quick solution
restart workbench with clear workspace option checked under run configuration ..
2) Full Solution
you should add a menu in menu bar to open your view so that you can open your view when ever you want
create a command say openMyMenu
create a handler for it and call below code from handler execute method.
add that command to main menu bar..
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(<view ID>);

IntelliJ IDEA - New Template

I'm trying to create a set of custom file templates for IntelliJ.
I basically want to go right-click, "New > My File Template" similar to the "New > Java Class" bundled with IntelliJ.
I've added my own custom file template via "Settings > File Templates", but they don't appear in my "New" context menu.
This is a Java project, and my templates extension is java. Am I missing something?
All help greatly appreciated.
No My Template >>>
If you select Java Class you can then choose the template for your new class. This is a new feature, it used to be available when selecting New.
Actually you can, sort of.
I don't know know how to do it for Java files. but
if you set the extension to txt you it will show up in the right click menu.
and here it is in the menu:
the only issue is if you're creating a java class you'll have to rename the file after creation to ${name}.java