19 package org.turro.elephant.user.menu;
22 import java.util.TreeSet;
23 import java.util.function.Function;
24 import org.turro.elephant.context.ElephantContext;
25 import org.turro.file.Document;
26 import org.turro.string.Strings;
27 import org.turro.util.CompareUtil;
37 protected String
id, label, image, link;
39 protected Function<IUserMenu, Boolean>
command;
42 this(
null, label, image,
null,
null, 0);
46 this(
null, label, image, link,
null, 0);
50 this(
null, label, image,
null,
command, 0);
54 this(
null, label, image,
null,
null,
order);
58 this(
null, label, image, link,
null,
order);
66 this.
id = Strings.isBlank(
id) ? (Strings.isBlank(label) ? Strings.asVar(image) : Strings.asVar(label)) :
id;
101 return !Strings.isBlank(
id) &&
102 !(Strings.isBlank(label) && Strings.isBlank(image));
107 return Strings.isBlank(link) && (
command ==
null);
112 return Strings.isBlank(image);
117 return Strings.isBlank(label);
123 return !Strings.isBlank(currentPath) &&
170 result = CompareUtil.compare(label, o.
getLabel());
173 result = CompareUtil.compare(
id, o.
getId());
185 return Document.from(
ElephantContext.
getRealPath(
"/WEB-INF/elephant/conf/hidden/" +
this.getClass().getSimpleName())).exists();
static String getRealPath(String path)
static String createURL(IUserMenu userMenu)