@Override public void refreshState() { super.refreshState(); if (target == null || target.getDatasource() == null) return; if (!captionInitialized) { Messages messages = AppBeans.get(Messages.NAME); if (security.isEntityOpPermitted(target.getDatasource().getMetaClass(), EntityOp.UPDATE)) { setCaption(messages.getMainMessage("actions.Edit")); } else { setCaption(messages.getMainMessage("actions.View")); } } }