private UiMenuSpecifier buildMenu(String q = null) {
new UiMenuSpecifier().ui { (1)
menu CrewController.&index as MC
menu CrewController.&listRoles as MC
menu CrewController.&hierarchy as MC
menuIcon ActionIcon.CONFIG_USER, this.&editUser as MC (4)
menuIcon ActionIcon.EXPORT_PDF, this.&downloadBinPdf as MC
menuSearch this.&search as MethodClosure, q (2)
menuOptions(SupportedLanguage.fromContext()) (3)
}
}
-
支持HTML
-
支持Mails
-
支持PDF
-
支持CSV
菜单DSL将导航栏与各个顶层Action连接到一起。
菜单DSL最多支持2个层级 (不考虑 section
)。
1 | 创建菜单块 |
2 | 搜索框 |
3 | 语言栏 |
4 | 图标按钮 (鼠标悬停时会显示说明文本) |
Figure 1. 菜单DSL架构图