18 package org.turro.zul.log;
20 import org.turro.string.Strings;
21 import org.turro.entities.Entities;
22 import org.turro.entities.IElephantEntity;
23 import org.turro.i18n.I_;
24 import org.turro.menu.ElephantMenu;
25 import org.turro.plugin.log.ILogInfo;
26 import org.turro.zul.frame.Framework;
27 import org.zkoss.zk.ui.event.Event;
28 import org.zkoss.zk.ui.event.EventListener;
29 import org.zkoss.zk.ui.event.Events;
30 import org.zkoss.zul.Toolbarbutton;
40 private Object entity;
41 private String path, pathName, name;
51 if(entity instanceof String) {
52 path = (String) entity;
72 private boolean _initialized;
74 private void initializeButton() {
75 if(!Strings.isBlank(name)) {
76 setImage(
"/_zul/images/log_contact.png");
77 setTooltiptext(
I_.
get(
"Log") +
": " +
I_.
get(
"Contact"));
79 setImage(
"/_zul/images/log.png");
80 setTooltiptext(I_.get(
"Log") +
": " + I_.get(
"Entity"));
84 addEventListener(Events.ON_CLICK,
new EventListener() {
86 public void onEvent(Event event)
throws Exception {
87 Framework.getCurrent().getDesktop().removeAttribute(
"logPath");
88 Framework.getCurrent().getDesktop().removeAttribute(
"logName");
89 if(!Strings.isBlank(path)) {
90 Framework.getCurrent().getDesktop().setAttribute(
"logPath", path);
91 }
else if(!Strings.isBlank(name)) {
92 Framework.getCurrent().getDesktop().setAttribute(
"logName", name);
94 ElephantMenu.showModalZulFile(
95 "@" + (!Strings.isBlank(path) ? pathName : name),
96 "/log/logNavigator.zul",
null);
static IElephantEntity getController(String path)
static String get(String msg)