[IntelliJ] 인텔리제이 단축키

2024. 1. 8. 10:36Pratice/IntelliJ

반응형

 

1. Alt + Insert

생성자 및 Getter/Setter

public enum UserRole {

  GUEST("고객"),
  MEMBER("회원"),
  ADMIN("관리자");

  private final String description;

  UserRole(String description) {
    this.description = description;
  }

  public String getDescription() {
    return description;
  }
}

 

 

2.  Ctrl + Alt + I

코드 구현부 즉시 보기

 

NoticeEntity를 열어 보지 않고도 Entity클래스 외에서도 코드 작성 내용 확인 가능

@Entity
@Getter @Setter
@AllArgsConstructor @NoArgsConstructor
@Builder
@Table(name = "notice")
@SequenceGenerator(
    name = "notice_SEQ",
    sequenceName = "notice_SEQ",
    initialValue = 1,
    allocationSize = 1)

public class NoticeEntity extends BaseEntity {

  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "notice_SEQ")   //SEQUENCE가 빠르기는 하나 테이블 따로 생성 해야하기 때문에, IDENTITY 많이 사용
  private Integer noticeNum;

  @Enumerated(EnumType.STRING)
  private NoticeRole noticeRole;

  @Column(name = "noticeTitle", length = 30, nullable = false)
  private String noticeTitle;

  @Column(name = "noticeWriter", length = 30, nullable = false)
  private String noticeWriter;

  @Lob
  @Column(name = "noticeContent", length = 30000, nullable = false)
  private String noticeContent;

  @Column(name = "noticeView")
  private Integer noticeView;

}

 

 

 

3.  Ctrl + Alt + V

변수 자동 완성

noticeDTO.getNoticeNum();

▼ ctrl + alt + v ▼

Integer noticeNum = noticeDTO.getNoticeNum();

 

 

 

4.  Ctrl + Alt + P

파라미터 자동 완성

  @PostMapping("/calculatorout")
  public String calculatoroutProc(Model model) throws Exception {

    Integer num1;
    Integer num2;
    String operator;
    
    ....
    
}


▼ ctrl + alt + p ▼

  @PostMapping("/calculatorout")
  public String calculatoroutProc(Integer num1, Integer num2, String operator, Model model, ) throws Exception {

	...
    
}

 

 

 

5. Ctrl + Alt + L

정렬

    if(operator.equals("add")) {
       result = num1 + num2;
                 oper = "+";
    }   else     if(operator.equals("minus")) {
       result = num1 - num2;
          oper = "-";
    } else     if(operator.equals("multiply")) {
            result = num1 * num2;
      oper = "*";
    }    else     if(operator.equals("divide")) {
            result = num1 / num2;
       oper = "/";
    }


▼ ctrl + alt + L ▼


    if (operator.equals("add")) {
      result = num1 + num2;
      oper = "+";
    } else if (operator.equals("minus")) {
      result = num1 - num2;
      oper = "-";
    } else if (operator.equals("multiply")) {
      result = num1 * num2;
      oper = "*";
    } else if (operator.equals("divide")) {
      result = num1 / num2;
      oper = "/";
    }

 

 

 

6. Ctrl + F9

컴파일

 

 

7. Ctrl + Shift + F9

부분 컴파일

 

 

8. Alt + Shift + F10

실행

 

 

 

9. Ctrl + Shift +N

파일 검색

 

 

10. Ctrl + Shift + Alt + N

메서드 검색

 

 

 

11. Ctrl + Shift + F

파일 내 전체 검색

 

 

12. Ctrl + E

최근에 열였던 파일 보기

 

 

 

13. Alt + Right or Left

에디터 탭 전환

 

 

 

14. Alt + Up or Down

메서드 업 다운

Integer result = 0;
String oper = "";


▼ Alt + Up or Down ▼


String oper = "";
Integer result = 0;

 

반응형