IDEMPIERE-3606 Document status panel is not refreshing / IDEMPIERE-3338 / IDEMPIERE-3535 Implement font icon theme

This commit is contained in:
Carlos Ruiz 2019-08-23 17:37:34 +02:00
parent 01381f964d
commit 9f99f32493
1 changed files with 20 additions and 7 deletions

View File

@ -30,6 +30,7 @@
package org.adempiere.webui.dashboard; package org.adempiere.webui.dashboard;
import org.adempiere.webui.apps.graph.WDocumentStatusPanel; import org.adempiere.webui.apps.graph.WDocumentStatusPanel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ServerPushTemplate; import org.adempiere.webui.util.ServerPushTemplate;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -68,15 +69,27 @@ public class DPDocumentStatus extends DashboardPanel implements EventListener<Ev
return; return;
this.appendChild(statusPanel); this.appendChild(statusPanel);
Toolbar recentItemsToolbar = new Toolbar(); Toolbar documentStatusToolbar = new Toolbar();
this.appendChild(recentItemsToolbar); this.appendChild(documentStatusToolbar);
if (ThemeManager.isUseFontIconForImage())
{
ToolBarButton btn = new ToolBarButton();
btn.setIconSclass("z-icon-Refresh");
btn.setSclass("trash-toolbarbutton");
documentStatusToolbar.appendChild(btn);
btn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
btn.addEventListener(Events.ON_CLICK, this);
}
else
{
Image imgr = new Image(ThemeManager.getThemeResource("images/Refresh24.png")); Image imgr = new Image(ThemeManager.getThemeResource("images/Refresh24.png"));
recentItemsToolbar.appendChild(imgr); documentStatusToolbar.appendChild(imgr);
imgr.setStyle("text-align: right; cursor: pointer; width:24px; height:24px;"); imgr.setStyle("text-align: right; cursor: pointer; width:24px; height:24px;");
imgr.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh"))); imgr.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
imgr.addEventListener(Events.ON_CLICK, this); imgr.addEventListener(Events.ON_CLICK, this);
} }
}
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
String eventName = event.getName(); String eventName = event.getName();