StandardEditor如何获取action弹窗的type值

例:使用默认的action+ type 打开的界面

 <action id="" type="create"/> <action id="" type="edit"/>

在StandardEditor如何获取这个type值?即判断当前操作是新增还是编辑

1.x 文档中似乎有类似的场景,但描述好像不太对,中文的ActionsHolder也没有例子如何使用

image

可以通过实体的状态判断,用 EntityStates bean:

@Autowired
protected EntityStates entityStates;

@Subscribe
protected void onBeforeShow(BeforeShowEvent event) {
    if (entityStates.isNew(getEditedEntity())) {
        // 新建实体
    }
}