IDEA插件,扩展新建java包的功能,新建java包的时候除了显示包名输入框,加多一个用于填写其它消息的输入框
public class CustomPackageWizard extends WizardContext {
// ...
@Override
protected void addPanels(@NotNull List<WizardStep> steps) {
super.addPanels(steps);
// 添加一个新的面板
CustomMessagePanel customMessagePanel = new CustomMessagePanel();
steps.add(new WizardStep("Custom Message", customMessagePanel));
}
// ...
}
class CustomMessagePanel extends JPanel {
private JTextField messageField;
public CustomMessagePanel() {
// 创建输入框并添加到面板
messageField = new JTextField();
add(messageField);
}
public String getMessage() {
return messageField.getText();
}
}