One, foreword

IntelliJ IDEA

If IntelliJ IDEA is a modern intelligent development tool, Eclipse is a Stone Age thing.

In fact, the author is also an explorer from Eclipse to IDEA. With the recent continuous development practice and debugging, I gradually realized the huge development convenience brought by this intelligent IDE. With the powerful plug-in function support, such as support for Git and Maven, it is almost impossible to stop. Finally, I had to be impressed by this amazing IDE. In order to let more partners around to participate in the decision to write this article.

Second, IDEA VS Eclipse core terms comparison

As can be seen from the following figure, the biggest change between them lies in the change of the concept of workspace. In IDEA, Project and Module are two different concepts, which are of great significance to the Project structure, which is exactly what many IDEA beginners find troubling.

Why cancel the workspace?

A: Simply put, IDEA does not require a workspace because every Project has a workspace!! For each IDEA Project, each sub-module can use a separate JDK and MAVEN configuration. This adds a great deal of convenience to the refactoring of traditional projects into new ones, a diversity of flexibility that is missing from Eclipse because it has tied up the workspace in its initial use.

2 In addition, many novices will ask why the sub-project of IDEA is called Module?

A: In fact, it is the concept of modularity. As an aggregate Project or a common root directory, it is called a Project, and the following sub-projects are called modules, and each sub-module may be associated with or without any association.

Iii. Introduction of plug-ins for IDEA

1. Install plug-ins

Open the setting file and select the Plugins option

  • Ctrl + Alt + S
  • File -> Setting

Install JetBrains plugin, third party plugin, locally downloaded plugin package. See the previous Settings article for more details.

2. Plugins

Activate-power-mode and Power Mode II

Migrate to IDEA according to the effect of Atom’s plugin activate-power-mode

Write code to make the whole screen shake, activate-power-Mode is white, power Mode II color is cooler.

#2.Background Image Plus

Idea background modification plug-in, let your IDEA out of the ordinary, you can set your favorite picture as the code background.

After the installation is successful and restart, click the VIew TAB on the menu bar and click Set Background Image(this TAB is not available if the plug-in is not installed). In the pop-up box, select the local Image and click OK.

#3.Grep console

Custom log colors. Idea console can display various levels of logs in color. After installation, right-click the console to open the log.

You can also set the display styles for different log levels.

You can search by keyword directly, the search terms are regular expression support.

#4.Free Mybatis plugin

Mybatis plugin lets you edit mybatis.xml like Java code. When we use Mybatis in development, we need to find the SQL statement in the corresponding XML through mapper interface. This plug-in is convenient for our operation.

After the installation is complete and IDEA is restarted, we will see a green arrow to the left of code or an extra column. Clicking on the arrow will direct us to the location of the corresponding XML file.

mapper

xml



#5.MyBatis Log Plugin

Mybatis is now the first choice for database manipulation in Java. During development, Mybatis scripts will be directly exported to the console, but by default, the output script is not a direct executable.

If we want to execute it directly, we need to convert it manually.

MyBatis Log Plugin this plug-in is to directly display the SQL script executed by MyBatis, without processing, can be directly copied out of the execution, as shown in the figure:

After executing the program, we can clearly see which SQL scripts we have executed, and the scripts can be executed and run.

#6.String Manipulation

Powerful string conversion tool. Use the shortcut key Alt+ M.

  • Hyphen-lowercase, hyphen-uppercase, snake_case, SCREAMING_SNAKE_CASE, dot. Case, words lowercase, Words Capitalized, PascalCase)
  • Convert to SCREAMING_SNAKE_CASE (or convert to camelCase)
  • Convert to snake_case (or convert to camelCase)
  • Convert to dot.case (or convert to camelCase)
  • Convert to hyphen-case (or convert to camelCase)
  • Convert to hyphen-case (or convert to snake_case)
  • Convert to camelCase (or convert to Words)
  • Convert to camelCase (or lowercase Words)
  • Convert to PascalCase (or convert to camelCase)
  • Select uppercase text
  • Style inversion


#7.Alibaba Java Coding Guidelines

Alibaba code specification check plug-in, of course, the specification can refer to the “Alibaba Java development manual”.

#8.Lombok

Java language, every time to write entity class need to write a lot of setter, getter, if the bean property once modified, deleted or added, need to generate or delete get/set and other methods, to increase the burden of code maintenance, which is also a reason Java is criticized. Lombok solves these problems for us by using Lombok annotations (@setter, @getter, @toString, @@Requiredargsconstructor, @equalSandhashCode or @data) There is no need to write or generate methods such as GET /set, which greatly reduces the amount of code and reduces the burden of code maintenance.

After installing Lombok, don’t forget to add maven as an example when using Lombok:



#9.Key promoter

Key Promoter is the shortcut prompt plug-in of IntelliJ IDEA. It counts the number of times you click on a function and prompts you what shortcut keys you should use. It helps you remember the shortcut keys and you can close the plug-in when you are familiar with it.

#10.Gsonformat

Java entity classes can be quickly generated from JSON data.

Create a custom javaBean(no content, just an empty class), copy the Json you want to parse, then use Alt+ INSERT to pop up the following interface or use the shortcut Alt+S to paste the Json you just copied, and click OK.



#11.Restfultoolkit

In the development of Spring MVC web page, we used requestMapping to define the URL of the page. In order to find the URL, we usually used CMD + Shift +F to search for it. Our URL is named requestMapping + method requestMapping, lookup is still a little bit of a little bit of a convenience, restfulTooKit can be very convenient to help find.

For example: I want to find the controller corresponding to /user/add, so just Ctrl+ slash,

We can go directly to the controller we want. This is also really convenient, of course, restfultooKit also provides us with other features. Our controller generates default test data for us, and calls tests directly. This will solve the problem of assembling data every time we postman debug data, which is much clearer and much easier than looking for packets in console. (Photo from Internet)

#12.JRebel

JRebel is a hot-deployed productivity tool where code changes take effect without restarting the program. It skips the rebuild, restart, and redeploy cycles that are common in Java development.



Four, the last

Welcome to pay attention to my public number [programmer chasing wind], the article will be updated in it, sorting out the data will be placed in it.