Tips for using IDE artifacts

Download and install

Download address: https://www.jetbrains.com/idea/download/#section=mac

Operation shortcut keys

Switch

command + E: View the recently viewed files (application scenarios, when there are many editing windows)

command +, or command + shift + ,: project switching (used to switch between multiple projects)

command + shift + A + search plugins +: install plugins

Precise search

command + O: precise search for class (you can search all classes in jar package)

command + shift + O: precise search for file files (you can search all files in the jar package)

command + option + O: precise search function

command + shift + F: string precise search

Column operation

Example to write an enumeration class

Step 1: control + command + G (select all columns)

The second step: option + shift + right arrow to select the string to be processed

The third step: shift + command + U string case conversion

Live template operation (quickly create common Java statements)

postfix operation

Example 1:

100.for+回车:for (int i = 0; i < 100; i++) { }

Example 2:

public class User {

    public User(String userName){
        
        userName.field
    }
}

userName.field + Enter

public class User {

    private final String userName;

    public User(String userName){

        this.userName = userName;
    }
}

实例3:
public void test(User user){

   user.nn
}

user + point nn automatically add not equal to the judgment of null

public void test(User user){

    if (user != null) {
        
    }
}

alter + enter operation

Example 1: 
option + Enter: automatic creation method 
public void test (User user) { 

    test1 () 
} 

private void test1 () { 
}

Example 2:

Quickly create interface implementation class (option + Enter)

Example 3: Automatic package guide

option + Enter

 

Refactoring

Example 1:

shift + F6: modify all parameters (change parameter name)

Find code modification track

shift + command search show-history to view modification records

 

Connect everything

1. Database association

2. Spring association (each bean can be tracked after setting)

command + semicolon

 

Breakpoint debugging

1. Add a breakpoint: command + F9

2. F8 single line is executed one by one, F9 is skipped

3.shift + command + F8: view all breakpoints

File operations

1. Create an xml file

control + option + n select new File

2. View the structure diagram

1. command + F12 View methods and member variables in a class

2. View of maven structure diagram

 

 

 

 

 

 

 

 

 

 

 

Published 14 original articles · won 3 · views 2029

Guess you like

Origin blog.csdn.net/energy_tank/article/details/105509477