19 package org.turro.menu;
22 import org.turro.string.Strings;
23 import org.turro.command.Command;
24 import org.turro.elephant.util.Components;
25 import org.turro.elephant.util.Images;
26 import org.turro.elephant.zkoss.Modal;
27 import org.turro.i18n.I_;
28 import org.turro.util.CompareUtil;
29 import org.turro.zul.frame.Framework;
30 import org.zkoss.zul.Menu;
36 public class ElephantMenu extends Menu implements Comparable<ElephantMenu> {
73 int result = CompareUtil.compare(getClass().getName(), o.getClass().getName());
80 if(Strings.isBlank(include)) {
82 }
else if(include.startsWith(
"/WEB-INF")) {
84 }
else if(include.startsWith(
"//")) {
85 return include.substring(1);
87 return "/WEB-INF/_zul" + include;
90 public static void showEntity(Object
id, String attribute, String label, String include) {
91 showEntity(
id, attribute, label, include,
null);
94 public static void showEntity(Object
id, String attribute, String label, String include, Map<String, Object> dynProps) {
96 if((
id instanceof Long && ((Long)
id) < 1) ||
id ==
null) {
97 frame.getDesktop().removeAttribute(attribute);
101 if(label.startsWith(
"@")) {
113 public static void showZulFile(String label, String include, Map<String, Object> dynProps) {
115 if(label.startsWith(
"@")) {
126 public static void showModalZulFile(String label, String include, Map args, Command command) {
128 if(label.startsWith(
"@")) {
141 if(label.startsWith(
"@")) {
148 public static void showEntityModal(Object
id, String attribute, String include, Command command) {
150 if((
id instanceof Long && ((Long)
id) < 1) ||
id ==
null) {
151 frame.getDesktop().removeAttribute(attribute);
static Components from(Object component)
static String getImage(String image)
static int doModal(String file)
static String get(String msg)
void addContent(String label, String src)
void showPopup(String label, String src, Map arg)
static Framework getCurrent()
void invalidateSelected()
void showModal(String label, String src, Map arg, Command command)
static void setAttribute(Object object, String key, Object value)