简体   繁体   中英

How to configure intellij vaadin import settings?

I am trying to develop a vaadin application with maven in idea, but all listener methods calls its own object like above

Button btn = new Button("click!");
btn.addClickListener(new **Button**.ClickListener() {
      @Override
      public void buttonClick(**Button**.ClickEvent clickEvent) {
          Notification.show("ok!");
      }
});

i want to looks like that

Button btn = new Button("click!");
btn.addClickListener(new ClickListener() {
       @Override
       public void buttonClick(ClickEvent clickEvent) {
          Notification.show("ok!");
      }
});

how can i modify idea settings?

On Settings->Editor->Code Style->Java, select the "Insert imports for inner classes" check box (off by default). Then IntelliJ IDEA will automatically add static imports for Button.ClickListener and Button.ClickEvent .

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM