IDEMPIERE-724 Zk: Make iDempiere theme more easily customizable.

This commit is contained in:
Heng Sin Low 2013-03-12 16:21:04 +08:00
parent 7a5fd10add
commit b8bc2e4da7
371 changed files with 498 additions and 973 deletions

View File

@ -446,15 +446,7 @@ public class GridWindow implements Serializable
{ {
StringBuilder title = new StringBuilder(Msg.getMsg(Env.getCtx(), "Window")).append(": ").append(getName()); StringBuilder title = new StringBuilder(Msg.getMsg(Env.getCtx(), "Window")).append(": ").append(getName());
WebDoc doc = null; WebDoc doc = null;
if (javaClient)
{
doc = WebDoc.create (false, title.toString(), javaClient); doc = WebDoc.create (false, title.toString(), javaClient);
}
else // HTML
{
doc = WebDoc.createPopup (title.toString());
doc.addPopupClose(Env.getCtx());
}
// body.addElement("© Adempiere   "); // body.addElement("© Adempiere   ");
// body.addElement(new a("http://www.adempiere.org/help/", "Online Help")); // body.addElement(new a("http://www.adempiere.org/help/", "Online Help"));
@ -565,8 +557,6 @@ public class GridWindow implements Serializable
center.addElement(new p().addElement(WebDoc.NBSP)); center.addElement(new p().addElement(WebDoc.NBSP));
} // for all Tabs } // for all Tabs
if (!javaClient)
doc.addPopupClose(Env.getCtx());
//System.out.println(doc.toString()); //System.out.println(doc.toString());
return doc; return doc;
} // getHelpDoc } // getHelpDoc

View File

@ -189,11 +189,8 @@ public class WebDoc
m_topRight.addElement(new img("res:org/compiere/images/AD10030.png") m_topRight.addElement(new img("res:org/compiere/images/AD10030.png")
.setAlign(AlignType.RIGHT).setAlt("iDempiere")); .setAlign(AlignType.RIGHT).setAlt("iDempiere"));
} else { } else {
if (title.equals("")) { m_topRight.addElement(new img("images/header-logo.png")
m_topRight.addElement(WebEnv.getLogo()); .setAlign(AlignType.RIGHT).setAlt("iDempiere"));
} else {
m_topRight.addElement(new h1(title));
}
} }
m_topRow.addElement(m_topRight); m_topRow.addElement(m_topRight);
m_table.addElement(m_topRow); m_table.addElement(m_topRow);

View File

@ -21,23 +21,19 @@ import javax.servlet.ServletRequest;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.part.AbstractUIPart; import org.adempiere.webui.part.AbstractUIPart;
import org.adempiere.webui.theme.ITheme;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.LoginWindow; import org.adempiere.webui.window.LoginWindow;
import org.zkoss.web.servlet.Servlets; import org.zkoss.web.servlet.Servlets;
import org.zkoss.zhtml.Text; import org.zkoss.zhtml.Text;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.metainfo.PageDefinition; import org.zkoss.zk.ui.metainfo.PageDefinition;
import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center;
import org.zkoss.zul.East; import org.zkoss.zul.East;
import org.zkoss.zul.North; import org.zkoss.zul.North;
import org.zkoss.zul.South; import org.zkoss.zul.South;
import org.zkoss.zul.West; import org.zkoss.zul.West;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Vbox;
import org.zkoss.zul.Window; import org.zkoss.zul.Window;
/** /**
@ -62,31 +58,13 @@ public class WLogin extends AbstractUIPart
protected Component doCreatePart(Component parent) protected Component doCreatePart(Component parent)
{ {
layout = new Borderlayout(); PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(ThemeManager.getThemeResource("zul/login/login.zul"));
if (parent != null) Component loginPage = Executions.createComponents(pageDefintion, parent, null);
layout.setParent(parent);
else
layout.setPage(page);
LayoutUtils.addSclass(ITheme.LOGIN_WINDOW_CLASS, layout);
Center center = new Center(); layout = (Borderlayout) loginPage.getFellow("layout");
center.setParent(layout);
center.setBorder("none");
center.setAutoscroll(true);
center.setStyle("border: none; background-color: transparent;");
Vbox vb = new Vbox(); loginWindow = (LoginWindow) loginPage.getFellow("loginWindow");
vb.setParent(center); loginWindow.init(app);
vb.setHeight("100%");
vb.setWidth("100%");
vb.setPack("center");
vb.setAlign("center");
vb.setStyle("background-color: transparent;");
vb.setHflex("1");
vb.setVflex("1");
loginWindow = new LoginWindow(app);
loginWindow.setParent(vb);
if (!AEnv.isBrowserSupported()) if (!AEnv.isBrowserSupported())
{ {
@ -103,89 +81,44 @@ public class WLogin extends AbstractUIPart
browserWarningWindow.doOverlapped(); browserWarningWindow.doOverlapped();
} }
try {
String right = ThemeManager.getLoginRightPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(right);
East east = new East();
east.setSclass(ITheme.LOGIN_EAST_PANEL_CLASS);
addContent(east, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
}
}
try {
String left = ThemeManager.getLoginLeftPanel();
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(left);
West west = new West();
west.setSclass(ITheme.LOGIN_WEST_PANEL_CLASS);
addContent(west, pageDefintion);
String ua = Servlets.getUserAgent((ServletRequest) Executions.getCurrent().getNativeRequest()); String ua = Servlets.getUserAgent((ServletRequest) Executions.getCurrent().getNativeRequest());
ua = ua.toLowerCase(); ua = ua.toLowerCase();
boolean mobile = ua.indexOf("ipad") >= 0 || ua.indexOf("iphone") >= 0 || ua.indexOf("android") >= 0; boolean mobile = ua.indexOf("ipad") >= 0 || ua.indexOf("iphone") >= 0 || ua.indexOf("android") >= 0;
West west = layout.getWest();
if (west.getFirstChild() != null && west.getFirstChild().getFirstChild() != null) {
if (mobile) { if (mobile) {
west.setCollapsible(true); west.setCollapsible(true);
west.setOpen(false); west.setOpen(false);
} }
} catch (Exception e){
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else { } else {
e.printStackTrace(); west.setVisible(false);
}
} }
try { East east = layout.getEast();
String top = ThemeManager.getLoginTopPanel(); if (east.getFirstChild() != null && east.getFirstChild().getFirstChild() != null) {
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(top); if (mobile) {
North north = new North(); east.setCollapsible(true);
north.setSclass(ITheme.LOGIN_NORTH_PANEL_CLASS); east.setOpen(false);
addContent(north, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
} }
} else { } else {
e.printStackTrace(); east.setVisible(false);
}
} }
try { North north = layout.getNorth();
String bottom = ThemeManager.getLoginBottomPanel(); if (north.getFirstChild() == null || north.getFirstChild().getFirstChild() == null) {
PageDefinition pageDefintion = Executions.getCurrent().getPageDefinition(bottom); north.setVisible(false);
South south = new South();
south.setSclass(ITheme.LOGIN_SOUTH_PANEL_CLASS);
addContent(south, pageDefintion);
} catch (Exception e) {
//ignore page not found exception
if (e instanceof UiException) {
if (!(e.getMessage() != null && e.getMessage().startsWith("Page not found"))) {
e.printStackTrace();
}
} else {
e.printStackTrace();
} }
South south = layout.getSouth();
if (south.getFirstChild() == null || south.getFirstChild().getFirstChild() == null) {
south.setVisible(false);
} }
return layout; return layout;
} }
private void addContent(Component parent, PageDefinition page) {
layout.appendChild(parent);
Executions.createComponents(page, parent, null);
}
public void detach() { public void detach() {
layout.detach(); layout.detach();
layout = null; layout = null;

View File

@ -21,6 +21,7 @@ import java.util.logging.Level;
import org.adempiere.util.Callback; import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MAsset; import org.compiere.model.MAsset;
import org.compiere.model.MBPartner; import org.compiere.model.MBPartner;
@ -102,7 +103,7 @@ public class WRequest implements EventListener<Event>
private void getRequests (Component invoker) private void getRequests (Component invoker)
{ {
m_new = new Menuitem(Msg.getMsg(Env.getCtx(), "RequestNew")); m_new = new Menuitem(Msg.getMsg(Env.getCtx(), "RequestNew"));
m_new.setImage("/images/New16.png"); m_new.setImage(ThemeManager.getThemeResource("images/New16.png"));
m_new.addEventListener(Events.ON_CLICK, this); m_new.addEventListener(Events.ON_CLICK, this);
m_popup.appendChild(m_new); m_popup.appendChild(m_new);
// //

View File

@ -49,6 +49,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.panel.InfoPanel; import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.MAcctSchema; import org.compiere.model.MAcctSchema;
import org.compiere.model.MAcctSchemaElement; import org.compiere.model.MAcctSchemaElement;
@ -461,17 +462,17 @@ public class WAcctViewer extends Window implements EventListener<Event>
forcePost.setVisible(false); forcePost.setVisible(false);
// Elaine 2009/07/29 // Elaine 2009/07/29
bZoom.setImage("/images/Zoom16.png"); bZoom.setImage(ThemeManager.getThemeResource(ThemeManager.getThemeResource("images/Zoom16.png")));
bZoom.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom"))); bZoom.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom")));
bZoom.setVisible(tabbedPane.getSelectedIndex() == 1); bZoom.setVisible(tabbedPane.getSelectedIndex() == 1);
bZoom.addEventListener(Events.ON_CLICK, this); bZoom.addEventListener(Events.ON_CLICK, this);
// //
bQuery.setImage("/images/Refresh16.png"); bQuery.setImage(ThemeManager.getThemeResource(ThemeManager.getThemeResource("images/Refresh16.png")));
bQuery.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh"))); bQuery.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
bQuery.addEventListener(Events.ON_CLICK, this); bQuery.addEventListener(Events.ON_CLICK, this);
bExport.setImage("/images/Export16.png"); bExport.setImage(ThemeManager.getThemeResource(ThemeManager.getThemeResource("images/Export16.png")));
bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export"))); bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export")));
bExport.addEventListener(Events.ON_CLICK, this); bExport.addEventListener(Events.ON_CLICK, this);
bExport.setVisible(false); bExport.setVisible(false);
@ -605,7 +606,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
m_data.fillTable(selTable); m_data.fillTable(selTable);
selTable.addEventListener(Events.ON_SELECT, this); selTable.addEventListener(Events.ON_SELECT, this);
selRecord.setImage("/images/Find16.png"); selRecord.setImage(ThemeManager.getThemeResource("images/Find16.png"));
selRecord.addEventListener(Events.ON_CLICK, this); selRecord.addEventListener(Events.ON_CLICK, this);
selRecord.setLabel(""); selRecord.setLabel("");
@ -618,7 +619,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
selAcct.setName("Account_ID"); selAcct.setName("Account_ID");
selAcct.addEventListener(Events.ON_CLICK, this); selAcct.addEventListener(Events.ON_CLICK, this);
selAcct.setLabel(""); selAcct.setLabel("");
selAcct.setImage("/images/Find16.png"); selAcct.setImage(ThemeManager.getThemeResource("images/Find16.png"));
statusLine.setValue(" " + Msg.getMsg(Env.getCtx(), "ViewerOptions")); statusLine.setValue(" " + Msg.getMsg(Env.getCtx(), "ViewerOptions"));
@ -833,7 +834,7 @@ public class WAcctViewer extends Window implements EventListener<Event>
labels[selectionIndex].setVisible(true); labels[selectionIndex].setVisible(true);
buttons[selectionIndex].setName(columnName); // actionCommand buttons[selectionIndex].setName(columnName); // actionCommand
buttons[selectionIndex].addEventListener(Events.ON_CLICK, this); buttons[selectionIndex].addEventListener(Events.ON_CLICK, this);
buttons[selectionIndex].setImage("/images/Find16.png"); buttons[selectionIndex].setImage(ThemeManager.getThemeResource("images/Find16.png"));
buttons[selectionIndex].setLabel(""); buttons[selectionIndex].setLabel("");
buttons[selectionIndex].setVisible(true); buttons[selectionIndex].setVisible(true);
selectionIndex++; selectionIndex++;

View File

@ -33,6 +33,7 @@ import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -288,10 +289,10 @@ public class ADSortTab extends Panel implements IADTabpanel
yesModel.setMultiple(true); yesModel.setMultiple(true);
noModel.setMultiple(true); noModel.setMultiple(true);
bAdd.setImage("images/Next24.png"); bAdd.setImage(ThemeManager.getThemeResource("images/Next24.png"));
bAdd.addEventListener(Events.ON_CLICK, actionListener); bAdd.addEventListener(Events.ON_CLICK, actionListener);
bRemove.setImage("images/Previous24.png"); bRemove.setImage(ThemeManager.getThemeResource("images/Previous24.png"));
bRemove.addEventListener(Events.ON_CLICK, actionListener); bRemove.addEventListener(Events.ON_CLICK, actionListener);
EventListener<Event> crossListMouseListener = new DragListener(); EventListener<Event> crossListMouseListener = new DragListener();
@ -307,10 +308,10 @@ public class ADSortTab extends Panel implements IADTabpanel
} }
}; };
bUp.setImage("images/Parent24.png"); bUp.setImage(ThemeManager.getThemeResource("images/Parent24.png"));
bUp.addEventListener(Events.ON_CLICK, actionListener2); bUp.addEventListener(Events.ON_CLICK, actionListener2);
bDown.setImage("images/Detail24.png"); bDown.setImage(ThemeManager.getThemeResource("images/Detail24.png"));
bDown.addEventListener(Events.ON_CLICK, actionListener2); bDown.addEventListener(Events.ON_CLICK, actionListener2);
ListHead listHead = new ListHead(); ListHead listHead = new ListHead();

View File

@ -35,6 +35,7 @@ import org.adempiere.webui.component.FToolbar;
import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.event.ToolbarListener; import org.adempiere.webui.event.ToolbarListener;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.model.MToolBarButton; import org.compiere.model.MToolBarButton;
import org.compiere.model.MToolBarButtonRestrict; import org.compiere.model.MToolBarButtonRestrict;
@ -222,7 +223,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
btn.setName(BTNPREFIX+name); btn.setName(BTNPREFIX+name);
btn.setId(btn.getName()); btn.setId(btn.getName());
if (image != null) if (image != null)
btn.setImage("/images/"+image + "24.png"); btn.setImage(ThemeManager.getThemeResource("images/"+image + "24.png"));
btn.setTooltiptext(Msg.getMsg(Env.getCtx(),tooltip)); btn.setTooltiptext(Msg.getMsg(Env.getCtx(),tooltip));
btn.setSclass("toolbar-button"); btn.setSclass("toolbar-button");
@ -463,7 +464,8 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
{ {
this.btnLock.setPressed(locked); this.btnLock.setPressed(locked);
String imgURL = "/images/"+ (this.btnLock.isPressed() ? "LockX" : "Lock") + "24.png"; String imgURL = "images/"+ (this.btnLock.isPressed() ? "LockX" : "Lock") + "24.png";
imgURL = ThemeManager.getThemeResource(imgURL);
this.btnLock.setImage(imgURL); this.btnLock.setImage(imgURL);
} }

View File

@ -33,6 +33,8 @@ import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.logging.Level; import java.util.logging.Level;
import javax.servlet.http.HttpServletRequest;
import org.adempiere.util.Callback; import org.adempiere.util.Callback;
import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.AdempiereIdGenerator;
import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.AdempiereWebUI;
@ -68,6 +70,7 @@ import org.adempiere.webui.panel.action.ReportAction;
import org.adempiere.webui.part.AbstractUIPart; import org.adempiere.webui.part.AbstractUIPart;
import org.adempiere.webui.part.ITabOnSelectHandler; import org.adempiere.webui.part.ITabOnSelectHandler;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.CustomizeGridViewDialog; import org.adempiere.webui.window.CustomizeGridViewDialog;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.FindWindow; import org.adempiere.webui.window.FindWindow;
@ -1554,8 +1557,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
*/ */
public void onHelp() public void onHelp()
{ {
WebDoc doc = gridWindow.getHelpDoc(true); WebDoc doc = gridWindow.getHelpDoc(false);
SessionManager.getAppDesktop().showURL(doc, "Help", true); String html = doc.toString();
HttpServletRequest request = (HttpServletRequest) Executions.getCurrent().getNativeRequest();
String logo = request.getContextPath() + ThemeManager.getThemeResource("images/header-logo.png");
html = html.replace("images/header-logo.png", logo);
SessionManager.getAppDesktop().showHTMLContent(html, "Help", true);
} }
/** /**
@ -2098,7 +2105,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
Button btnOk = new Button(); Button btnOk = new Button();
// Invert - Unify OK/Cancel IDEMPIERE-77 // Invert - Unify OK/Cancel IDEMPIERE-77
//btnOk.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "OK"))); //btnOk.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "OK")));
btnOk.setImage("/images/Ok16.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK, new EventListener<Event>() btnOk.addEventListener(Events.ON_CLICK, new EventListener<Event>()
{ {
public void onEvent(Event event) throws Exception public void onEvent(Event event) throws Exception
@ -2148,7 +2155,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
Button btnCancel = new Button(); Button btnCancel = new Button();
//btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Cancel"))); //btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Cancel")));
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK, new EventListener<Event>() btnCancel.addEventListener(Events.ON_CLICK, new EventListener<Event>()
{ {
public void onEvent(Event event) throws Exception public void onEvent(Event event) throws Exception

View File

@ -31,6 +31,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ZkCssHelper; import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.event.ToolbarListener; import org.adempiere.webui.event.ToolbarListener;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WRecordInfo; import org.adempiere.webui.window.WRecordInfo;
import org.compiere.model.DataStatusEvent; import org.compiere.model.DataStatusEvent;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -69,9 +70,9 @@ public class BreadCrumb extends Div implements EventListener<Event> {
private static final String ON_MOUSE_OUT_ECHO_EVENT = "onMouseOutEcho"; private static final String ON_MOUSE_OUT_ECHO_EVENT = "onMouseOutEcho";
private static final String INFO_INDICATOR_IMAGE = "/images/InfoIndicator16.png"; private static final String INFO_INDICATOR_IMAGE = "images/InfoIndicator16.png";
private static final String ERROR_INDICATOR_IMAGE = "/images/ErrorIndicator16.png"; private static final String ERROR_INDICATOR_IMAGE = "images/ErrorIndicator16.png";
/** /**
* generated serial id * generated serial id
@ -327,7 +328,8 @@ public class BreadCrumb extends Div implements EventListener<Event> {
pathLabel.addEventListener(Events.ON_MOUSE_OVER, listener); pathLabel.addEventListener(Events.ON_MOUSE_OVER, listener);
pathLabel.addEventListener(Events.ON_MOUSE_OUT, listener); pathLabel.addEventListener(Events.ON_MOUSE_OUT, listener);
pathLabel.addEventListener(ON_MOUSE_OVER_ECHO_EVENT, listener); pathLabel.addEventListener(ON_MOUSE_OVER_ECHO_EVENT, listener);
ZkCssHelper.appendStyle(pathLabel, "background: transparent url('images/downarrow.png') no-repeat right center"); ZkCssHelper.appendStyle(pathLabel, "background: transparent url('theme/" + ThemeManager.getTheme() +
"/images/downarrow.png') no-repeat right center");
} }
@Override @Override
@ -426,7 +428,7 @@ public class BreadCrumb extends Div implements EventListener<Event> {
ToolBarButton btn = new ToolBarButton(""); ToolBarButton btn = new ToolBarButton("");
btn.setName(BTNPREFIX+name); btn.setName(BTNPREFIX+name);
btn.setId(name); btn.setId(name);
btn.setImage("/images/"+image + "24.png"); btn.setImage(ThemeManager.getThemeResource("images/"+image + "24.png"));
btn.setTooltiptext(Msg.getMsg(Env.getCtx(),tooltip)); btn.setTooltiptext(Msg.getMsg(Env.getCtx(),tooltip));
btn.setSclass("breadcrumb-toolbar-button"); btn.setSclass("breadcrumb-toolbar-button");
@ -522,9 +524,9 @@ public class BreadCrumb extends Div implements EventListener<Event> {
Image image = null; Image image = null;
if (error) if (error)
image = new Image(ERROR_INDICATOR_IMAGE); image = new Image(ThemeManager.getThemeResource(ERROR_INDICATOR_IMAGE));
else else
image = new Image(INFO_INDICATOR_IMAGE); image = new Image(ThemeManager.getThemeResource(INFO_INDICATOR_IMAGE));
image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE); image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);
messageContainer.appendChild(image); messageContainer.appendChild(image);
@ -653,7 +655,8 @@ public class BreadCrumb extends Div implements EventListener<Event> {
} }
private void showPopup() { private void showPopup() {
msgPopupCaption.setImage(m_statusError ? ERROR_INDICATOR_IMAGE : INFO_INDICATOR_IMAGE); msgPopupCaption.setImage(m_statusError ? ThemeManager.getThemeResource(ERROR_INDICATOR_IMAGE)
: ThemeManager.getThemeResource(INFO_INDICATOR_IMAGE));
appendChild(msgPopup); appendChild(msgPopup);
LayoutUtils.openOverlappedWindow(messageContainer, msgPopup, "overlap_end"); LayoutUtils.openOverlappedWindow(messageContainer, msgPopup, "overlap_end");
} }

View File

@ -17,6 +17,7 @@ import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ADTabListModel.ADTabLabel; import org.adempiere.webui.component.ADTabListModel.ADTabLabel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
@ -54,19 +55,19 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
private static final String STATUS_ERROR_ATTRIBUTE = "status.error"; private static final String STATUS_ERROR_ATTRIBUTE = "status.error";
private static final String DELETE_IMAGE = "/images/Delete16.png"; private static final String DELETE_IMAGE = "images/Delete16.png";
private static final String EDIT_IMAGE = "/images/EditRecord16.png"; private static final String EDIT_IMAGE = "images/EditRecord16.png";
private static final String NEW_IMAGE = "/images/New16.png"; private static final String NEW_IMAGE = "images/New16.png";
private static final String PROCESS_IMAGE = "/images/Process16.png"; private static final String PROCESS_IMAGE = "images/Process16.png";
/** /**
* generated serial id * generated serial id
*/ */
private static final long serialVersionUID = -7914602940626352282L; private static final long serialVersionUID = -7914602940626352282L;
private static final String INFO_INDICATOR_IMAGE = "/images/InfoIndicator16.png"; private static final String INFO_INDICATOR_IMAGE = "images/InfoIndicator16.png";
private static final String ERROR_INDICATOR_IMAGE = "/images/ErrorIndicator16.png"; private static final String ERROR_INDICATOR_IMAGE = "images/ErrorIndicator16.png";
private Tabbox tabbox; private Tabbox tabbox;
@ -251,7 +252,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
ToolBarButton button = new ToolBarButton(); ToolBarButton button = new ToolBarButton();
button = new ToolBarButton(); button = new ToolBarButton();
button.setImage(NEW_IMAGE); button.setImage(ThemeManager.getThemeResource(NEW_IMAGE));
button.setId("BtnNew"); button.setId("BtnNew");
toolbar.appendChild(button); toolbar.appendChild(button);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() { button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@ -264,7 +265,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New"))); button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
button = new ToolBarButton(); button = new ToolBarButton();
button.setImage(EDIT_IMAGE); button.setImage(ThemeManager.getThemeResource(EDIT_IMAGE));
button.setId("BtnEdit"); button.setId("BtnEdit");
toolbar.appendChild(button); toolbar.appendChild(button);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() { button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@ -276,7 +277,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "EditRecord"))); button.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "EditRecord")));
button = new ToolBarButton(); button = new ToolBarButton();
button.setImage(DELETE_IMAGE); button.setImage(ThemeManager.getThemeResource(DELETE_IMAGE));
button.setId("BtnDelete"); button.setId("BtnDelete");
toolbar.appendChild(button); toolbar.appendChild(button);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() { button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@ -290,7 +291,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
if (!tabPanel.getGridTab().isSortTab()) { if (!tabPanel.getGridTab().isSortTab()) {
button = new ToolBarButton(); button = new ToolBarButton();
button.setImage(PROCESS_IMAGE); button.setImage(ThemeManager.getThemeResource(PROCESS_IMAGE));
button.setId("BtnProcess"); button.setId("BtnProcess");
toolbar.appendChild(button); toolbar.appendChild(button);
button.addEventListener(Events.ON_CLICK, new EventListener<Event>() { button.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@ -419,9 +420,9 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
Image image = null; Image image = null;
if (error) if (error)
image = new Image(ERROR_INDICATOR_IMAGE); image = new Image(ThemeManager.getThemeResource(ERROR_INDICATOR_IMAGE));
else else
image = new Image(INFO_INDICATOR_IMAGE); image = new Image(ThemeManager.getThemeResource(INFO_INDICATOR_IMAGE));
image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE); image.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);
messageContainer.appendChild(image); messageContainer.appendChild(image);
@ -563,14 +564,17 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
} }
boolean enableNew = !changed && insertRecord && !adtab.getGridTab().isSortTab(); boolean enableNew = !changed && insertRecord && !adtab.getGridTab().isSortTab();
boolean enableDelete = !changed && !readOnly && !adtab.getGridTab().isSortTab(); boolean enableDelete = !changed && !readOnly && !adtab.getGridTab().isSortTab();
String newImage = ThemeManager.getThemeResource(NEW_IMAGE);
String deleteImage = ThemeManager.getThemeResource(DELETE_IMAGE);
String editImage = ThemeManager.getThemeResource(EDIT_IMAGE);
for(Component c : toolbar.getChildren()) { for(Component c : toolbar.getChildren()) {
if (c instanceof ToolBarButton) { if (c instanceof ToolBarButton) {
ToolBarButton btn = (ToolBarButton) c; ToolBarButton btn = (ToolBarButton) c;
if (NEW_IMAGE.equals(btn.getImage())) { if (newImage.equals(btn.getImage())) {
btn.setDisabled(!enableNew); btn.setDisabled(!enableNew);
} else if (DELETE_IMAGE.equals(btn.getImage())) { } else if (deleteImage.equals(btn.getImage())) {
btn.setDisabled(!enableDelete); btn.setDisabled(!enableDelete);
} else if (EDIT_IMAGE.equals(btn.getImage())) { } else if (editImage.equals(btn.getImage())) {
btn.setDisabled(false); btn.setDisabled(false);
} }
} }
@ -587,10 +591,11 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
IADTabpanel adtab = getADTabpanel(index); IADTabpanel adtab = getADTabpanel(index);
if (adtab == null) return; if (adtab == null) return;
String processImage = ThemeManager.getThemeResource(PROCESS_IMAGE);
for(Component c : toolbar.getChildren()) { for(Component c : toolbar.getChildren()) {
if (c instanceof ToolBarButton) { if (c instanceof ToolBarButton) {
ToolBarButton btn = (ToolBarButton) c; ToolBarButton btn = (ToolBarButton) c;
if (PROCESS_IMAGE.equals(btn.getImage())) { if (processImage.equals(btn.getImage())) {
if (adtab.getGridTab().isSortTab()) { if (adtab.getGridTab().isSortTab()) {
btn.setDisabled(true); btn.setDisabled(true);
} else { } else {

View File

@ -556,7 +556,7 @@ public final class AEnv
URI uri = null; URI uri = null;
try try
{ {
uri = new URI("/images/" + fileNameInImageDir); uri = new URI(ThemeManager.getThemeResource("images/" + fileNameInImageDir));
} }
catch (URISyntaxException exception) catch (URISyntaxException exception)
{ {

View File

@ -33,6 +33,7 @@ import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.editor.WTableDirEditor; import org.adempiere.webui.editor.WTableDirEditor;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.FeedbackManager; import org.adempiere.webui.util.FeedbackManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
@ -199,7 +200,7 @@ public class FeedbackRequestWindow extends Window implements EventListener<Event
vlayout.appendChild(confirmPanel); vlayout.appendChild(confirmPanel);
Button btn = new Button(); Button btn = new Button();
btn.setImage("/images/Attachment24.png"); btn.setImage(ThemeManager.getThemeResource("images/Attachment24.png"));
btn.setUpload("true"); btn.setUpload("true");
btn.addEventListener(Events.ON_UPLOAD, this); btn.addEventListener(Events.ON_UPLOAD, this);
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Attachment")); btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Attachment"));

View File

@ -29,6 +29,7 @@ import org.adempiere.webui.desktop.IDesktop;
import org.adempiere.webui.part.WindowContainer; import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.process.WProcessInfo; import org.adempiere.webui.process.WProcessInfo;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.MultiFileDownloadDialog; import org.adempiere.webui.window.MultiFileDownloadDialog;
import org.adempiere.webui.window.SimplePDFViewer; import org.adempiere.webui.window.SimplePDFViewer;
@ -176,7 +177,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
// Invert - Unify OK/Cancel IDEMPIERE-77 // Invert - Unify OK/Cancel IDEMPIERE-77
//bOK = new Button(label.replaceAll("&", "")); //bOK = new Button(label.replaceAll("&", ""));
bOK = new Button(); bOK = new Button();
bOK.setImage("/images/Ok16.png"); bOK.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
bOK.setId("Ok"); bOK.setId("Ok");
bOK.addEventListener(Events.ON_CLICK, this); bOK.addEventListener(Events.ON_CLICK, this);
bOK.setSclass("action-image-text-button"); bOK.setSclass("action-image-text-button");
@ -184,7 +185,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
//label = Msg.getMsg(Env.getCtx(), "Cancel"); //label = Msg.getMsg(Env.getCtx(), "Cancel");
Button btn = new Button(); Button btn = new Button();
btn.setImage("/images/Cancel16.png"); btn.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btn.setId("Cancel"); btn.setId("Cancel");
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);
btn.setSclass("action-image-text-button"); btn.setSclass("action-image-text-button");
@ -470,7 +471,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
appendRecordLogInfo(pi.getLogs()); appendRecordLogInfo(pi.getLogs());
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter")); bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter"));
bOK.setImage("/images/Reset16.png"); bOK.setImage(ThemeManager.getThemeResource("images/Reset16.png"));
isParameterPage = false; isParameterPage = false;
m_ids = pi.getIDs(); m_ids = pi.getIDs();
@ -587,7 +588,7 @@ public class ProcessDialog extends Window implements EventListener<Event>, IProc
isParameterPage = true; isParameterPage = true;
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Start")); bOK.setLabel(Msg.getMsg(Env.getCtx(), "Start"));
bOK.setImage("/images/Ok16.png"); bOK.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
//recreate process info //recreate process info
m_pi = new WProcessInfo(m_Name, m_AD_Process_ID); m_pi = new WProcessInfo(m_Name, m_AD_Process_ID);

View File

@ -37,6 +37,7 @@ import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.VerticalBox; import org.adempiere.webui.component.VerticalBox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.MultiFileDownloadDialog; import org.adempiere.webui.window.MultiFileDownloadDialog;
import org.compiere.Adempiere; import org.compiere.Adempiere;
@ -176,14 +177,14 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
hbox.setWidth("100%"); hbox.setWidth("100%");
hbox.setStyle("margin-top: 10px"); hbox.setStyle("margin-top: 10px");
Button btn = new Button(""); Button btn = new Button("");
btn.setImage("/images/Ok24.png"); btn.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
LayoutUtils.addSclass("action-button", btn); LayoutUtils.addSclass("action-button", btn);
btn.setId("Ok"); btn.setId("Ok");
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btn); hbox.appendChild(btn);
btn = new Button(""); btn = new Button("");
btn.setImage("/images/Cancel24.png"); btn.setImage(ThemeManager.getThemeResource("images/Cancel24.png"));
btn.setId("Cancel"); btn.setId("Cancel");
LayoutUtils.addSclass("action-button", btn); LayoutUtils.addSclass("action-button", btn);
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);

View File

@ -49,6 +49,7 @@ import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.CustomForm; import org.adempiere.webui.panel.CustomForm;
import org.adempiere.webui.panel.IFormController; import org.adempiere.webui.panel.IFormController;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.apps.form.Archive; import org.compiere.apps.form.Archive;
import org.compiere.model.MArchive; import org.compiere.model.MArchive;
@ -206,23 +207,23 @@ public class WArchiveViewer extends Archive implements IFormController, EventLis
createdByQField.setMold("select"); createdByQField.setMold("select");
createdByQField.setRows(1); createdByQField.setRows(1);
updateArchive.setImage("/images/Ok24.png"); updateArchive.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
updateArchive.setTooltiptext(Msg.getMsg(Env.getCtx(), "Update")); updateArchive.setTooltiptext(Msg.getMsg(Env.getCtx(), "Update"));
updateArchive.addEventListener(Events.ON_CLICK, this); updateArchive.addEventListener(Events.ON_CLICK, this);
deleteArchive.setImage("/images/Delete24.png"); deleteArchive.setImage(ThemeManager.getThemeResource("images/Delete24.png"));
deleteArchive.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete")); deleteArchive.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
deleteArchive.addEventListener(Events.ON_CLICK, this); deleteArchive.addEventListener(Events.ON_CLICK, this);
bRefresh.setImage("/images/Refresh24.png"); bRefresh.setImage(ThemeManager.getThemeResource("images/Refresh24.png"));
bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(), "Refresh")); bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(), "Refresh"));
bRefresh.addEventListener(Events.ON_CLICK, this); bRefresh.addEventListener(Events.ON_CLICK, this);
bBack.setImage("/images/wfBack24.png"); bBack.setImage(ThemeManager.getThemeResource("images/wfBack24.png"));
bBack.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous")); bBack.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous"));
bBack.addEventListener(Events.ON_CLICK, this); bBack.addEventListener(Events.ON_CLICK, this);
bNext.setImage("/images/wfNext24.png"); bNext.setImage(ThemeManager.getThemeResource("images/wfNext24.png"));
bNext.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next")); bNext.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
bNext.addEventListener(Events.ON_CLICK, this); bNext.addEventListener(Events.ON_CLICK, this);

View File

@ -42,6 +42,7 @@ import org.adempiere.webui.panel.WRC4GroupingCriteriaPanel;
import org.adempiere.webui.panel.WRC5SummaryFieldsPanel; import org.adempiere.webui.panel.WRC5SummaryFieldsPanel;
import org.adempiere.webui.panel.WRCTabPanel; import org.adempiere.webui.panel.WRCTabPanel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.ZkReportViewer; import org.adempiere.webui.window.ZkReportViewer;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -266,7 +267,7 @@ public class WReportCustomization implements IFormController,EventListener<Even
btnSave = new Button(); btnSave = new Button();
btnSave.setName("btnSave"); btnSave.setName("btnSave");
btnSave.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Save"))); btnSave.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Save")));
btnSave.setImage("/images/Save24.png"); btnSave.setImage(ThemeManager.getThemeResource("images/Save24.png"));
if(fm.getAD_Client_ID()== 0 || !isChange) if(fm.getAD_Client_ID()== 0 || !isChange)
{ {
btnSave.setDisabled(true); btnSave.setDisabled(true);
@ -276,7 +277,7 @@ public class WReportCustomization implements IFormController,EventListener<Even
if (m_isCanExport) if (m_isCanExport)
{ {
bExport.setImage("/images/ExportX24.png"); bExport.setImage(ThemeManager.getThemeResource("images/Export24.png"));
bExport.setName("btnExport"); bExport.setName("btnExport");
bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export"))); bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export")));
confirmPanelMain.addComponentsLeft(bExport); confirmPanelMain.addComponentsLeft(bExport);

View File

@ -34,6 +34,7 @@ import org.adempiere.webui.component.Row;
import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.panel.ADForm; import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -139,7 +140,7 @@ public class WSQLProcess extends ADForm implements EventListener<Event>
{ {
Button btnProcess = new Button(); Button btnProcess = new Button();
btnProcess.setImage("/images/Process24.png"); btnProcess.setImage(ThemeManager.getThemeResource("images/Process24.png"));
btnProcess.setName(Msg.getMsg(Env.getCtx(), "Process")); btnProcess.setName(Msg.getMsg(Env.getCtx(), "Process"));
return btnProcess; return btnProcess;

View File

@ -37,6 +37,7 @@ import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.CustomForm; import org.adempiere.webui.panel.CustomForm;
import org.adempiere.webui.panel.IFormController; import org.adempiere.webui.panel.IFormController;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.TreeUtils; import org.adempiere.webui.util.TreeUtils;
import org.compiere.apps.form.SetupWizard; import org.compiere.apps.form.SetupWizard;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
@ -276,19 +277,19 @@ public class WSetupWizard extends SetupWizard implements IFormController, EventL
mainLayout.setHeight("100%"); mainLayout.setHeight("100%");
mainLayout.setStyle("position: absolute"); mainLayout.setStyle("position: absolute");
bRefresh.setImage("/images/Refresh24.png"); bRefresh.setImage(ThemeManager.getThemeResource("images/Refresh24.png"));
bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(), "Refresh")); bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(), "Refresh"));
bRefresh.addEventListener(Events.ON_CLICK, this); bRefresh.addEventListener(Events.ON_CLICK, this);
bOK.setImage("/images/Ok24.png"); bOK.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
bOK.setTooltiptext(Msg.getMsg(Env.getCtx(), "Update")); bOK.setTooltiptext(Msg.getMsg(Env.getCtx(), "Update"));
bOK.addEventListener(Events.ON_CLICK, this); bOK.addEventListener(Events.ON_CLICK, this);
bNext.setImage("/images/Next24.png"); bNext.setImage(ThemeManager.getThemeResource("images/Next24.png"));
bNext.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next")); bNext.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
bNext.addEventListener(Events.ON_CLICK, this); bNext.addEventListener(Events.ON_CLICK, this);
bZoom.setImage("/images/Zoom16.png"); bZoom.setImage(ThemeManager.getThemeResource("images/Zoom16.png"));
bZoom.setTooltiptext(Msg.getMsg(Env.getCtx(), "Zoom")); bZoom.setTooltiptext(Msg.getMsg(Env.getCtx(), "Zoom"));
bZoom.addEventListener(Events.ON_CLICK, this); bZoom.addEventListener(Events.ON_CLICK, this);

View File

@ -32,6 +32,7 @@ import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.CustomForm; import org.adempiere.webui.panel.CustomForm;
import org.adempiere.webui.panel.IFormController; import org.adempiere.webui.panel.IFormController;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.apps.form.TreeMaintenance; import org.compiere.apps.form.TreeMaintenance;
import org.compiere.model.MTree; import org.compiere.model.MTree;
@ -123,10 +124,10 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
*/ */
private void jbInit () throws Exception private void jbInit () throws Exception
{ {
bAddAll.setImage("images/FastBack24.png"); bAddAll.setImage(ThemeManager.getThemeResource("images/FastBack24.png"));
bAdd.setImage("images/StepBack24.png"); bAdd.setImage(ThemeManager.getThemeResource("images/StepBack24.png"));
bDelete.setImage("images/StepForward24.png"); bDelete.setImage(ThemeManager.getThemeResource("images/StepForward24.png"));
bDeleteAll.setImage("images/FastForward24.png"); bDeleteAll.setImage(ThemeManager.getThemeResource("images/FastForward24.png"));
form.setWidth("99%"); form.setWidth("99%");
form.setHeight("100%"); form.setHeight("100%");

View File

@ -20,6 +20,7 @@ import java.awt.image.BufferedImage;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MColorSchema; import org.compiere.model.MColorSchema;
import org.compiere.model.MGoal; import org.compiere.model.MGoal;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
@ -82,7 +83,7 @@ public class WPerformanceIndicator extends Panel implements EventListener<Event>
private static DecimalFormat s_format = DisplayType.getNumberFormat(DisplayType.Integer); private static DecimalFormat s_format = DisplayType.getNumberFormat(DisplayType.Integer);
Menupopup popupMenu = new Menupopup(); Menupopup popupMenu = new Menupopup();
private Menuitem mRefresh = new Menuitem(Msg.getMsg(Env.getCtx(), "Refresh"), "/images/Refresh16.png"); private Menuitem mRefresh = new Menuitem(Msg.getMsg(Env.getCtx(), "Refresh"), ThemeManager.getThemeResource("images/Refresh16.png"));
ChartPanel chartPanel; ChartPanel chartPanel;

View File

@ -30,6 +30,7 @@ import org.adempiere.webui.component.ToolBar;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.panel.ADForm; import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.apps.wf.WFGraphLayout; import org.compiere.apps.wf.WFGraphLayout;
import org.compiere.apps.wf.WFNodeWidget; import org.compiere.apps.wf.WFNodeWidget;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
@ -111,19 +112,19 @@ public class WFEditor extends ADForm {
workflowList.setStyle("margin-left: 10px; margin-top: 5px; margin-right:5px;"); workflowList.setStyle("margin-left: 10px; margin-top: 5px; margin-right:5px;");
// Zoom // Zoom
zoomButton = new Toolbarbutton(); zoomButton = new Toolbarbutton();
zoomButton.setImage("/images/Zoom16.png"); zoomButton.setImage(ThemeManager.getThemeResource("images/Zoom16.png"));
toolbar.appendChild(zoomButton); toolbar.appendChild(zoomButton);
zoomButton.addEventListener(Events.ON_CLICK, this); zoomButton.addEventListener(Events.ON_CLICK, this);
zoomButton.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom"))); zoomButton.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom")));
// New Node // New Node
newButton = new Toolbarbutton(); newButton = new Toolbarbutton();
newButton.setImage("/images/New16.png"); newButton.setImage(ThemeManager.getThemeResource("images/New16.png"));
toolbar.appendChild(newButton); toolbar.appendChild(newButton);
newButton.addEventListener(Events.ON_CLICK, this); newButton.addEventListener(Events.ON_CLICK, this);
newButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "CreateNewNode")); newButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "CreateNewNode"));
// Refresh // Refresh
refreshButton = new Toolbarbutton(); refreshButton = new Toolbarbutton();
refreshButton.setImage("/images/Refresh16.png"); refreshButton.setImage(ThemeManager.getThemeResource("images/Refresh16.png"));
toolbar.appendChild(refreshButton); toolbar.appendChild(refreshButton);
refreshButton.addEventListener(Events.ON_CLICK, this); refreshButton.addEventListener(Events.ON_CLICK, this);
refreshButton.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh"))); refreshButton.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));

View File

@ -37,6 +37,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.editor.WSearchEditor; import org.adempiere.webui.editor.WSearchEditor;
import org.adempiere.webui.panel.ADForm; import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.StatusBarPanel; import org.adempiere.webui.panel.StatusBarPanel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
@ -128,8 +129,8 @@ public class WWFActivity extends ADForm implements EventListener<Event>
fAnswerList.setMold("select"); fAnswerList.setMold("select");
bZoom.setImage("/images/Zoom16.png"); bZoom.setImage(ThemeManager.getThemeResource("images/Zoom16.png"));
bOK.setImage("/images/Ok24.png"); bOK.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
MLookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo, MLookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo,
0, 10443, DisplayType.Search); 0, 10443, DisplayType.Search);
@ -454,7 +455,7 @@ public class WWFActivity extends ADForm implements EventListener<Event>
fAnswerText.setVisible(false); fAnswerText.setVisible(false);
fAnswerList.setVisible(false); fAnswerList.setVisible(false);
fAnswerButton.setVisible(false); fAnswerButton.setVisible(false);
fAnswerButton.setImage("/images/mWindow.png"); fAnswerButton.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
fTextMsg.setReadonly(!(selIndex >= 0)); fTextMsg.setReadonly(!(selIndex >= 0));
bZoom.setEnabled(selIndex >= 0); bZoom.setEnabled(selIndex >= 0);
bOK.setEnabled(selIndex >= 0); bOK.setEnabled(selIndex >= 0);

View File

@ -17,6 +17,7 @@ import java.util.List;
import javax.activation.DataSource; import javax.activation.DataSource;
import org.adempiere.webui.theme.ThemeManager;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
@ -42,7 +43,7 @@ public class AttachmentItem extends Hlayout implements EventListener<Event>{
"margin-right: 5px; margin-bottom: 5px;padding-left: 5px; padding-right: 5px;"); "margin-right: 5px; margin-bottom: 5px;padding-left: 5px; padding-right: 5px;");
appendChild(new Label(ds.getName())); appendChild(new Label(ds.getName()));
if (removable) { if (removable) {
A x = new A("", "/images/X8.png"); A x = new A("", ThemeManager.getThemeResource("images/X8.png"));
x.setStyle("float: right; background-color: #f5f5f5"); x.setStyle("float: right; background-color: #f5f5f5");
appendChild(x); appendChild(x);
this.ds = ds; this.ds = ds;

View File

@ -23,6 +23,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
@ -112,13 +113,13 @@ public final class ConfirmPanel extends Hbox
if (m_withText && text != null) if (m_withText && text != null)
{ {
button.setImage("images/"+name+"16.png"); button.setImage(ThemeManager.getThemeResource("images/"+name+"16.png"));
button.setLabel(text); button.setLabel(text);
LayoutUtils.addSclass("action-text-button", button); LayoutUtils.addSclass("action-text-button", button);
} }
else else
{ {
button.setImage("images/"+name+"24.png"); button.setImage(ThemeManager.getThemeResource("images/"+name+"24.png"));
if (text != null) if (text != null)
button.setTooltiptext(text); button.setTooltiptext(text);
LayoutUtils.addSclass("action-button", button); LayoutUtils.addSclass("action-button", button);

View File

@ -16,6 +16,7 @@ package org.adempiere.webui.component;
import java.io.File; import java.io.File;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.MSysConfig; import org.compiere.model.MSysConfig;
import org.compiere.util.Ini; import org.compiere.util.Ini;
@ -126,7 +127,7 @@ public class FolderBrowser extends Window implements EventListener<Event>
if(!dir.getParent().equals(root.getParent())) if(!dir.getParent().equals(root.getParent()))
{ {
ListItem li = new ListItem(dir.getName(), dir.getParent()); ListItem li = new ListItem(dir.getName(), dir.getParent());
li.setImage("images/Undo16.png"); li.setImage(ThemeManager.getThemeResource("images/Undo16.png"));
listDir.appendChild(li); listDir.appendChild(li);
} }
@ -137,7 +138,7 @@ public class FolderBrowser extends Window implements EventListener<Event>
if(file.isDirectory()) if(file.isDirectory())
{ {
ListItem li = new ListItem(file.getName(), file.getAbsolutePath()); ListItem li = new ListItem(file.getName(), file.getAbsolutePath());
li.setImage("images/Folder16.png"); li.setImage(ThemeManager.getThemeResource("images/Folder16.png"));
listDir.appendChild(li); listDir.appendChild(li);
} }
} }

View File

@ -23,6 +23,7 @@ import org.adempiere.util.Callback;
import org.adempiere.webui.AdempiereIdGenerator; import org.adempiere.webui.AdempiereIdGenerator;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
@ -115,25 +116,25 @@ public class Messagebox extends Window implements EventListener<Event>
lblMsg.setValue(msg); lblMsg.setValue(msg);
// Invert - Unify OK/Cancel IDEMPIERE-77 // Invert - Unify OK/Cancel IDEMPIERE-77
//btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK"))); //btnOk.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "OK")));
btnOk.setImage("/images/Ok16.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnOk.setId("btnOk"); btnOk.setId("btnOk");
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-text-button", btnOk); LayoutUtils.addSclass("action-text-button", btnOk);
//btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel"))); //btnCancel.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Cancel")));
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK, this); btnCancel.addEventListener(Events.ON_CLICK, this);
btnCancel.setId("btnCancel"); btnCancel.setId("btnCancel");
LayoutUtils.addSclass("action-text-button", btnCancel); LayoutUtils.addSclass("action-text-button", btnCancel);
btnYes.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Yes"))); btnYes.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "Yes")));
btnYes.setImage("/images/Ok16.png"); btnYes.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnYes.addEventListener(Events.ON_CLICK, this); btnYes.addEventListener(Events.ON_CLICK, this);
btnYes.setId("btnYes"); btnYes.setId("btnYes");
LayoutUtils.addSclass("action-text-button", btnYes); LayoutUtils.addSclass("action-text-button", btnYes);
btnNo.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "No"))); btnNo.setLabel(Util.cleanAmp(Msg.getMsg(ctx, "No")));
btnNo.setImage("/images/Cancel16.png"); btnNo.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnNo.addEventListener(Events.ON_CLICK, this); btnNo.addEventListener(Events.ON_CLICK, this);
btnNo.setId("btnNo"); btnNo.setId("btnNo");
LayoutUtils.addSclass("action-text-button", btnNo); LayoutUtils.addSclass("action-text-button", btnNo);
@ -149,7 +150,7 @@ public class Messagebox extends Window implements EventListener<Event>
LayoutUtils.addSclass("action-text-button", btnRetry); LayoutUtils.addSclass("action-text-button", btnRetry);
btnIgnore.setLabel("Ignore"); btnIgnore.setLabel("Ignore");
btnIgnore.setImage("/images/Ignore16.png"); btnIgnore.setImage(ThemeManager.getThemeResource("images/Ignore16.png"));
btnIgnore.addEventListener(Events.ON_CLICK, this); btnIgnore.addEventListener(Events.ON_CLICK, this);
btnIgnore.setId("btnIgnore"); btnIgnore.setId("btnIgnore");
LayoutUtils.addSclass("action-text-button", btnIgnore); LayoutUtils.addSclass("action-text-button", btnIgnore);

View File

@ -22,6 +22,7 @@ import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.Page;
@ -85,7 +86,7 @@ public class NumberBox extends Div
hlayout.appendChild(decimalBox); hlayout.appendChild(decimalBox);
btn = new Button(); btn = new Button();
btn.setImage("/images/Calculator10.png"); btn.setImage(ThemeManager.getThemeResource("images/Calculator10.png"));
btn.setTabindex(-1); btn.setTabindex(-1);
btn.setHflex("0"); btn.setHflex("0");
btn.setWidgetListener("onClick", "try{var id=this.getPopup(); zk.Widget.$(id.substring(5, id.length - 1)).focus_(100);" + btn.setWidgetListener("onClick", "try{var id=this.getPopup(); zk.Widget.$(id.substring(5, id.length - 1)).focus_(100);" +

View File

@ -18,6 +18,7 @@ import java.text.SimpleDateFormat;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.process.ProcessInfoLog; import org.compiere.process.ProcessInfoLog;
import org.compiere.util.DisplayType; import org.compiere.util.DisplayType;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -63,7 +64,7 @@ public class ProcessInfoDialog extends Window implements EventListener<Event> {
lblMsg.setEncode(false); lblMsg.setEncode(false);
lblMsg.setValue(header); lblMsg.setValue(header);
btnOk.setImage("/images/Ok16.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-text-button", btnOk); LayoutUtils.addSclass("action-text-button", btnOk);

View File

@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.desktop.IDesktop; import org.adempiere.webui.desktop.IDesktop;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ServerPushTemplate; import org.adempiere.webui.util.ServerPushTemplate;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
@ -80,7 +81,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
labelN = Util.cleanAmp(Msg.translate(Env.getCtx(), "AD_Note_ID")); labelN = Util.cleanAmp(Msg.translate(Env.getCtx(), "AD_Note_ID"));
btnNotice.setLabel(labelN + " : 0"); btnNotice.setLabel(labelN + " : 0");
btnNotice.setTooltiptext(labelN); btnNotice.setTooltiptext(labelN);
btnNotice.setImage("/images/GetMail16.png"); btnNotice.setImage(ThemeManager.getThemeResource("images/GetMail16.png"));
int AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Notice' AND IsSummary = 'N'"); int AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Notice' AND IsSummary = 'N'");
btnNotice.setName(String.valueOf(AD_Menu_ID)); btnNotice.setName(String.valueOf(AD_Menu_ID));
btnNotice.addEventListener(Events.ON_CLICK, this); btnNotice.addEventListener(Events.ON_CLICK, this);
@ -90,7 +91,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
labelR = Util.cleanAmp(Msg.translate(Env.getCtx(), "R_Request_ID")); labelR = Util.cleanAmp(Msg.translate(Env.getCtx(), "R_Request_ID"));
btnRequest.setLabel(labelR + " : 0"); btnRequest.setLabel(labelR + " : 0");
btnRequest.setTooltiptext(labelR); btnRequest.setTooltiptext(labelR);
btnRequest.setImage("/images/Request16.png"); btnRequest.setImage(ThemeManager.getThemeResource("images/Request16.png"));
AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Request' AND IsSummary = 'N'"); AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Request' AND IsSummary = 'N'");
btnRequest.setName(String.valueOf(AD_Menu_ID)); btnRequest.setName(String.valueOf(AD_Menu_ID));
btnRequest.addEventListener(Events.ON_CLICK, this); btnRequest.addEventListener(Events.ON_CLICK, this);
@ -100,7 +101,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
labelW = Util.cleanAmp(Msg.translate(Env.getCtx(), "WorkflowActivities")); labelW = Util.cleanAmp(Msg.translate(Env.getCtx(), "WorkflowActivities"));
btnWorkflow.setLabel(labelW + " : 0"); btnWorkflow.setLabel(labelW + " : 0");
btnWorkflow.setTooltiptext(labelW); btnWorkflow.setTooltiptext(labelW);
btnWorkflow.setImage("/images/Assignment16.png"); btnWorkflow.setImage(ThemeManager.getThemeResource("images/Assignment16.png"));
AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Workflow Activities' AND IsSummary = 'N'"); AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'Workflow Activities' AND IsSummary = 'N'");
btnWorkflow.setName(String.valueOf(AD_Menu_ID)); btnWorkflow.setName(String.valueOf(AD_Menu_ID));
btnWorkflow.addEventListener(Events.ON_CLICK, this); btnWorkflow.addEventListener(Events.ON_CLICK, this);
@ -111,7 +112,7 @@ public class DPActivities extends DashboardPanel implements EventListener<Event>
labelU = Util.cleanAmp(Msg.translate(Env.getCtx(), "UnprocessedDocs")); labelU = Util.cleanAmp(Msg.translate(Env.getCtx(), "UnprocessedDocs"));
btnUnprocessed.setLabel(labelU + " : 0"); btnUnprocessed.setLabel(labelU + " : 0");
btnUnprocessed.setTooltiptext(labelU); btnUnprocessed.setTooltiptext(labelU);
btnUnprocessed.setImage("/images/Open16.png"); btnUnprocessed.setImage(ThemeManager.getThemeResource("images/Open16.png"));
AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'My Unprocessed Documents' AND IsSummary = 'N'"); AD_Menu_ID = DB.getSQLValue(null, "SELECT AD_Menu_ID FROM AD_Menu WHERE Name = 'My Unprocessed Documents' AND IsSummary = 'N'");
btnUnprocessed.setName(String.valueOf(AD_Menu_ID)); btnUnprocessed.setName(String.valueOf(AD_Menu_ID));
btnUnprocessed.addEventListener(Events.ON_CLICK, this); btnUnprocessed.addEventListener(Events.ON_CLICK, this);

View File

@ -21,6 +21,7 @@ import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.exception.ApplicationException; import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MMenu; import org.compiere.model.MMenu;
@ -91,7 +92,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
this.appendChild(favToolbar); this.appendChild(favToolbar);
// Elaine 2008/07/24 // Elaine 2008/07/24
Image img = new Image("/images/Delete24.png"); Image img = new Image(ThemeManager.getThemeResource("images/Delete24.png"));
favToolbar.appendChild(img); favToolbar.appendChild(img);
img.setStyle("text-align: right"); img.setStyle("text-align: right");
img.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Delete"))); img.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Delete")));
@ -146,7 +147,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
hbox.appendChild(btnFavItem); hbox.appendChild(btnFavItem);
btnFavItem.setLabel(label); btnFavItem.setLabel(label);
btnFavItem.setTooltiptext(description); btnFavItem.setTooltiptext(description);
btnFavItem.setImage(imageSrc); btnFavItem.setImage(ThemeManager.getThemeResource(imageSrc));
btnFavItem.setDraggable(DELETE_FAV_DROPPABLE); btnFavItem.setDraggable(DELETE_FAV_DROPPABLE);
btnFavItem.addEventListener(Events.ON_CLICK, this); btnFavItem.addEventListener(Events.ON_CLICK, this);
btnFavItem.addEventListener(Events.ON_DROP, this); btnFavItem.addEventListener(Events.ON_DROP, this);
@ -154,7 +155,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
if (addNewBtn) if (addNewBtn)
{ {
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png"); Toolbarbutton newBtn = new Toolbarbutton(null, ThemeManager.getThemeResource("images/New10.png"));
newBtn.setAttribute(NODE_ID_ATTR, String.valueOf(nodeId)); newBtn.setAttribute(NODE_ID_ATTR, String.valueOf(nodeId));
hbox.appendChild(newBtn); hbox.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this); newBtn.addEventListener(Events.ON_CLICK, this);

View File

@ -19,6 +19,7 @@ import java.util.Properties;
import org.adempiere.base.Service; import org.adempiere.base.Service;
import org.adempiere.base.event.EventManager; import org.adempiere.base.event.EventManager;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ServerPushTemplate; import org.adempiere.webui.util.ServerPushTemplate;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MRecentItem; import org.compiere.model.MRecentItem;
@ -92,14 +93,14 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
Toolbar recentItemsToolbar = new Toolbar(); Toolbar recentItemsToolbar = new Toolbar();
this.appendChild(recentItemsToolbar); this.appendChild(recentItemsToolbar);
Image imgr = new Image("/images/Refresh24.png"); Image imgr = new Image(ThemeManager.getThemeResource("images/Refresh24.png"));
recentItemsToolbar.appendChild(imgr); recentItemsToolbar.appendChild(imgr);
imgr.setStyle("text-align: right; cursor: pointer;"); imgr.setStyle("text-align: right; cursor: pointer;");
imgr.setTooltiptext(Util.cleanAmp(Msg.getMsg(ctx, "Refresh"))); imgr.setTooltiptext(Util.cleanAmp(Msg.getMsg(ctx, "Refresh")));
imgr.addEventListener(Events.ON_CLICK, this); imgr.addEventListener(Events.ON_CLICK, this);
// //
Image img = new Image("/images/Delete24.png"); Image img = new Image(ThemeManager.getThemeResource("images/Delete24.png"));
recentItemsToolbar.appendChild(img); recentItemsToolbar.appendChild(img);
img.setStyle("text-align: right;"); img.setStyle("text-align: right;");
img.setDroppable(DELETE_RECENTITEMS_DROPPABLE); img.setDroppable(DELETE_RECENTITEMS_DROPPABLE);
@ -216,7 +217,7 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
btnrecentItem.setAttribute(AD_RECENT_ITEM_ID_ATTR, String.valueOf(ri.getAD_RecentItem_ID())); btnrecentItem.setAttribute(AD_RECENT_ITEM_ID_ATTR, String.valueOf(ri.getAD_RecentItem_ID()));
bxRecentItems.appendChild(btnrecentItem); bxRecentItems.appendChild(btnrecentItem);
btnrecentItem.setLabel(label); btnrecentItem.setLabel(label);
btnrecentItem.setImage(getIconFile()); btnrecentItem.setImage(ThemeManager.getThemeResource(getIconFile()));
btnrecentItem.setDraggable(DELETE_RECENTITEMS_DROPPABLE); btnrecentItem.setDraggable(DELETE_RECENTITEMS_DROPPABLE);
btnrecentItem.addEventListener(Events.ON_CLICK, this); btnrecentItem.addEventListener(Events.ON_CLICK, this);
btnrecentItem.addEventListener(Events.ON_DROP, this); btnrecentItem.addEventListener(Events.ON_DROP, this);

View File

@ -17,6 +17,7 @@ import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.InfoPanel; import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.InfoSchedule; import org.adempiere.webui.window.InfoSchedule;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -58,7 +59,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoProduct"); ToolBarButton btnViewItem = new ToolBarButton("InfoProduct");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoProduct"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoProduct")));
btnViewItem.setImage("/images/InfoProduct16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/InfoProduct16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -67,7 +68,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoBPartner"); ToolBarButton btnViewItem = new ToolBarButton("InfoBPartner");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoBPartner"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoBPartner")));
btnViewItem.setImage("/images/InfoBPartner16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/InfoBPartner16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -76,7 +77,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoAccount"); ToolBarButton btnViewItem = new ToolBarButton("InfoAccount");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAccount"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAccount")));
btnViewItem.setImage("/images/InfoAccount16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/InfoAccount16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -85,7 +86,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoSchedule"); ToolBarButton btnViewItem = new ToolBarButton("InfoSchedule");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoSchedule"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoSchedule")));
btnViewItem.setImage("/images/InfoSchedule16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/InfoSchedule16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -95,7 +96,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoOrder"); ToolBarButton btnViewItem = new ToolBarButton("InfoOrder");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoOrder"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoOrder")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -104,7 +105,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoInvoice"); ToolBarButton btnViewItem = new ToolBarButton("InfoInvoice");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoInvoice"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoInvoice")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -113,7 +114,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoInOut"); ToolBarButton btnViewItem = new ToolBarButton("InfoInOut");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoInOut"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoInOut")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -122,7 +123,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoPayment"); ToolBarButton btnViewItem = new ToolBarButton("InfoPayment");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoPayment"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoPayment")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -139,7 +140,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoAssignment"); ToolBarButton btnViewItem = new ToolBarButton("InfoAssignment");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAssignment"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAssignment")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }
@ -148,7 +149,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
ToolBarButton btnViewItem = new ToolBarButton("InfoAsset"); ToolBarButton btnViewItem = new ToolBarButton("InfoAsset");
btnViewItem.setSclass("link"); btnViewItem.setSclass("link");
btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAsset"))); btnViewItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "InfoAsset")));
btnViewItem.setImage("/images/Info16.png"); btnViewItem.setImage(ThemeManager.getThemeResource("images/Info16.png"));
btnViewItem.addEventListener(Events.ON_CLICK, this); btnViewItem.addEventListener(Events.ON_CLICK, this);
vbox.appendChild(btnViewItem); vbox.appendChild(btnViewItem);
} }

View File

@ -36,6 +36,7 @@ import org.adempiere.webui.dashboard.DashboardRunnable;
import org.adempiere.webui.part.WindowContainer; import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.report.HTMLExtension; import org.adempiere.webui.report.HTMLExtension;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.ZkReportViewerProvider; import org.adempiere.webui.window.ZkReportViewerProvider;
import org.compiere.Adempiere; import org.compiere.Adempiere;
import org.compiere.model.I_AD_Menu; import org.compiere.model.I_AD_Menu;
@ -288,7 +289,7 @@ public class DashboardController implements EventListener<Event> {
{ {
//link to open performance detail //link to open performance detail
Toolbarbutton link = new Toolbarbutton(); Toolbarbutton link = new Toolbarbutton();
link.setImage("/images/Zoom16.png"); link.setImage(ThemeManager.getThemeResource("images/Zoom16.png"));
link.setAttribute("PA_Goal_ID", PA_Goal_ID); link.setAttribute("PA_Goal_ID", PA_Goal_ID);
link.addEventListener(Events.ON_CLICK, new EventListener<Event>() { link.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {

View File

@ -44,6 +44,7 @@ import org.adempiere.webui.panel.HelpController;
import org.adempiere.webui.panel.TimeoutPanel; import org.adempiere.webui.panel.TimeoutPanel;
import org.adempiere.webui.session.SessionContextListener; import org.adempiere.webui.session.SessionContextListener;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.IServerPushCallback; import org.adempiere.webui.util.IServerPushCallback;
import org.adempiere.webui.util.ServerPushTemplate; import org.adempiere.webui.util.ServerPushTemplate;
import org.adempiere.webui.util.UserPreference; import org.adempiere.webui.util.UserPreference;
@ -75,12 +76,12 @@ import org.zkoss.zk.ui.event.EventQueues;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.OpenEvent; import org.zkoss.zk.ui.event.OpenEvent;
import org.zkoss.zk.ui.event.SwipeEvent; import org.zkoss.zk.ui.event.SwipeEvent;
import org.zkoss.zk.ui.metainfo.PageDefinition;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zk.ui.util.DesktopCleanup; import org.zkoss.zk.ui.util.DesktopCleanup;
import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center; import org.zkoss.zul.Center;
import org.zkoss.zul.East; import org.zkoss.zul.East;
import org.zkoss.zul.North;
import org.zkoss.zul.West; import org.zkoss.zul.West;
/** /**
@ -146,35 +147,38 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
protected Component doCreatePart(Component parent) protected Component doCreatePart(Component parent)
{ {
pnlHead = new HeaderPanel(); PageDefinition pagedef = Executions.getCurrent().getPageDefinition(ThemeManager.getThemeResource("zul/desktop/desktop.zul"));
Component page = Executions.createComponents(pagedef, parent, null);
layout = new Borderlayout(); layout = (Borderlayout) page.getFellow("layout");
if (parent != null) pnlHead = (HeaderPanel) page.getFellow("northBody").getFellow("header");
{ //
layout.setParent(parent); // layout = new Borderlayout();
layout.setWidth("100%"); // if (parent != null)
layout.setHeight("100%"); // {
layout.setSclass("desktop-layout"); // layout.setParent(parent);
} // layout.setWidth("100%");
else // layout.setHeight("100%");
layout.setPage(page); // layout.setSclass("desktop-layout");
// }
// else
// layout.setPage(page);
layout.addEventListener("onZoom", this); layout.addEventListener("onZoom", this);
layout.addEventListener(DrillEvent.ON_DRILL_DOWN, this); layout.addEventListener(DrillEvent.ON_DRILL_DOWN, this);
North n = new North(); // North n = new North();
layout.appendChild(n); // layout.appendChild(n);
n.setCollapsible(false); // n.setCollapsible(false);
n.setSclass("desktop-north"); // n.setSclass("desktop-north");
pnlHead.setParent(n); // pnlHead.setParent(n);
West w = new West(); West w = layout.getWest();
w.setId("desktop-left-column"); // w.setId("desktop-left-column");
layout.appendChild(w); // layout.appendChild(w);
w.setSclass("desktop-left-column"); // w.setSclass("desktop-left-column");
w.setCollapsible(true); // w.setCollapsible(true);
w.setSplittable(true); // w.setSplittable(true);
w.setHflex("1"); // w.setHflex("1");
w.addEventListener(Events.ON_OPEN, new EventListener<Event>() { w.addEventListener(Events.ON_OPEN, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
@ -201,13 +205,13 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
sideController.render(w, this, false); sideController.render(w, this, false);
East e = new East(); East e = layout.getEast();
e.setId("desktop-right-column"); // e.setId("desktop-right-column");
layout.appendChild(e); // layout.appendChild(e);
e.setSclass("desktop-right-column"); // e.setSclass("desktop-right-column");
e.setCollapsible(true); // e.setCollapsible(true);
e.setSplittable(true); // e.setSplittable(true);
e.setHflex("1"); // e.setHflex("1");
e.addEventListener(Events.ON_OPEN, new EventListener<Event>() { e.addEventListener(Events.ON_OPEN, new EventListener<Event>() {
@Override @Override
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
@ -235,9 +239,9 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
helpController.render(e, this); helpController.render(e, this);
windowArea = new Center(); windowArea = layout.getCenter();
windowArea.setParent(layout); // windowArea.setParent(layout);
windowArea.setSclass("desktop-center"); // windowArea.setSclass("desktop-center");
windowContainer.createPart(windowArea); windowContainer.createPart(windowArea);

View File

@ -22,7 +22,6 @@ import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.part.UIPart; import org.adempiere.webui.part.UIPart;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.util.WebDoc;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.Page;
@ -89,7 +88,7 @@ public interface IDesktop extends UIPart {
* @param string * @param string
* @param closeable * @param closeable
*/ */
public void showURL(WebDoc doc, String string, boolean closeable); public void showHTMLContent(String content, String title, boolean closeable);
/** /**
* *

View File

@ -34,7 +34,6 @@ import org.adempiere.webui.window.WTask;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
import org.compiere.model.MTask; import org.compiere.model.MTask;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.WebDoc;
import org.compiere.wf.MWorkflow; import org.compiere.wf.MWorkflow;
import org.zkoss.image.AImage; import org.zkoss.image.AImage;
import org.zkoss.util.media.AMedia; import org.zkoss.util.media.AMedia;
@ -203,15 +202,16 @@ public abstract class TabbedDesktop extends AbstractDesktop {
} }
/** /**
* @param webDoc * @param content
* @param title * @param title
* @param closeable * @param closeable
*/ */
public void showURL(WebDoc webDoc, String title, boolean closeable) @Override
public void showHTMLContent(String content, String title, boolean closeable)
{ {
Iframe iframe = new Iframe(); Iframe iframe = new Iframe();
AMedia media = new AMedia(title, "html", "text/html", webDoc.toString().getBytes()); AMedia media = new AMedia(title, "html", "text/html", content.getBytes());
iframe.setContent(media); iframe.setContent(media);
addWin(iframe, title, closeable); addWin(iframe, title, closeable);

View File

@ -22,6 +22,7 @@ import org.adempiere.webui.component.Combinationbox;
import org.adempiere.webui.event.ContextMenuEvent; import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WAccountDialog; import org.adempiere.webui.window.WAccountDialog;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -52,7 +53,7 @@ public class WAccountEditor extends WEditor implements ContextMenuListener
public WAccountEditor(GridField gridField) public WAccountEditor(GridField gridField)
{ {
super(new Combinationbox(), gridField); super(new Combinationbox(), gridField);
getComponent().setButtonImage("/images/Account10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Account10.png"));
m_mAccount = new MAccountLookup (gridField.getVO().ctx, gridField.getWindowNo()); m_mAccount = new MAccountLookup (gridField.getVO().ctx, gridField.getWindowNo());

View File

@ -14,6 +14,7 @@ import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.InfoSchedule; import org.adempiere.webui.window.InfoSchedule;
import org.adempiere.webui.window.WAssignmentDialog; import org.adempiere.webui.window.WAssignmentDialog;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
@ -48,7 +49,7 @@ public class WAssignmentEditor extends WEditor implements ContextMenuListener {
private void initComponents() { private void initComponents() {
getComponent().getTextbox().setReadonly(true); getComponent().getTextbox().setReadonly(true);
getComponent().setButtonImage("images/Assignment10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Assignment10.png"));
popupMenu = new WEditorPopupMenu(true, false, false); popupMenu = new WEditorPopupMenu(true, false, false);
popupMenu.addMenuListener(this); popupMenu.addMenuListener(this);

View File

@ -32,6 +32,7 @@ import org.adempiere.webui.adwindow.IADTabpanel;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.event.ActionEvent; import org.adempiere.webui.event.ActionEvent;
import org.adempiere.webui.event.ActionListener; import org.adempiere.webui.event.ActionListener;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MLookup; import org.compiere.model.MLookup;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
@ -117,26 +118,26 @@ public class WButtonEditor extends WEditor implements IProcessButton
if (columnName.equals("PaymentRule")) if (columnName.equals("PaymentRule"))
{ {
readReference(REFERENCE_PAYMENTRULE); readReference(REFERENCE_PAYMENTRULE);
getComponent().setImage("/images/Payment16.png"); // 29*14 getComponent().setImage(ThemeManager.getThemeResource("images/Payment16.png")); // 29*14
} }
else if (columnName.equals("DocAction")) else if (columnName.equals("DocAction"))
{ {
readReference(REFERENCE_DOCUMENTACTION); readReference(REFERENCE_DOCUMENTACTION);
getComponent().setImage("/images/Process16.png"); // 16*16 getComponent().setImage(ThemeManager.getThemeResource("images/Process16.png")); // 16*16
} }
else if (columnName.equals("CreateFrom")) else if (columnName.equals("CreateFrom"))
{ {
getComponent().setImage("/images/Copy16.png"); // 16*16 getComponent().setImage(ThemeManager.getThemeResource("images/Copy16.png")); // 16*16
} }
else if (columnName.equals("Record_ID")) else if (columnName.equals("Record_ID"))
{ {
getComponent().setImage("/images/Zoom16.png"); // 16*16 getComponent().setImage(ThemeManager.getThemeResource("images/Zoom16.png")); // 16*16
getComponent().setLabel(Msg.getMsg(Env.getCtx(), "ZoomDocument")); getComponent().setLabel(Msg.getMsg(Env.getCtx(), "ZoomDocument"));
} }
else if (columnName.equals("Posted")) else if (columnName.equals("Posted"))
{ {
readReference(REFERENCE_POSTED); readReference(REFERENCE_POSTED);
getComponent().setImage("/images/InfoAccount16.png"); // 16*16 getComponent().setImage(ThemeManager.getThemeResource("images/InfoAccount16.png")); // 16*16
} }
if (gridField.getColumnName().endsWith("_ID") && !gridField.getColumnName().equals("Record_ID")) if (gridField.getColumnName().endsWith("_ID") && !gridField.getColumnName().equals("Record_ID"))

View File

@ -34,6 +34,7 @@ import org.adempiere.webui.component.NumberBox;
import org.adempiere.webui.component.Paymentbox; import org.adempiere.webui.component.Paymentbox;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
@ -601,7 +602,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
* @param popupMenu * @param popupMenu
*/ */
protected void addTextEditorMenu(WEditorPopupMenu popupMenu) { protected void addTextEditorMenu(WEditorPopupMenu popupMenu) {
Menuitem editor = new Menuitem(Msg.getMsg(Env.getCtx(), "Editor"), "images/Editor16.png"); Menuitem editor = new Menuitem(Msg.getMsg(Env.getCtx(), "Editor"), ThemeManager.getThemeResource("images/Editor16.png"));
editor.setAttribute("EVENT", WEditorPopupMenu.EDITOR_EVENT); editor.setAttribute("EVENT", WEditorPopupMenu.EDITOR_EVENT);
editor.addEventListener(Events.ON_CLICK, popupMenu); editor.addEventListener(Events.ON_CLICK, popupMenu);
popupMenu.appendChild(editor); popupMenu.appendChild(editor);

View File

@ -22,6 +22,7 @@ import java.util.ArrayList;
import org.adempiere.webui.component.Menupopup; import org.adempiere.webui.component.Menupopup;
import org.adempiere.webui.event.ContextMenuEvent; import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.Lookup; import org.compiere.model.Lookup;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -154,7 +155,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
zoomItem = new Menuitem(); zoomItem = new Menuitem();
zoomItem.setAttribute(EVENT_ATTRIBUTE, ZOOM_EVENT); zoomItem.setAttribute(EVENT_ATTRIBUTE, ZOOM_EVENT);
zoomItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom"))); zoomItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Zoom")));
zoomItem.setImage("/images/Zoom16.png"); zoomItem.setImage(ThemeManager.getThemeResource("images/Zoom16.png"));
zoomItem.addEventListener(Events.ON_CLICK, this); zoomItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(zoomItem); this.appendChild(zoomItem);
@ -165,7 +166,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
requeryItem = new Menuitem(); requeryItem = new Menuitem();
requeryItem.setAttribute(EVENT_ATTRIBUTE, REQUERY_EVENT); requeryItem.setAttribute(EVENT_ATTRIBUTE, REQUERY_EVENT);
requeryItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh"))); requeryItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
requeryItem.setImage("/images/Refresh16.png"); requeryItem.setImage(ThemeManager.getThemeResource("images/Refresh16.png"));
requeryItem.addEventListener(Events.ON_CLICK, this); requeryItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(requeryItem); this.appendChild(requeryItem);
} }
@ -175,7 +176,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
prefItem = new Menuitem(); prefItem = new Menuitem();
prefItem.setAttribute(EVENT_ATTRIBUTE, PREFERENCE_EVENT); prefItem.setAttribute(EVENT_ATTRIBUTE, PREFERENCE_EVENT);
prefItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ValuePreference"))); prefItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ValuePreference")));
prefItem.setImage("/images/VPreference16.png"); prefItem.setImage(ThemeManager.getThemeResource("images/VPreference16.png"));
prefItem.addEventListener(Events.ON_CLICK, this); prefItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(prefItem); this.appendChild(prefItem);
} }
@ -185,7 +186,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
newItem = new Menuitem(); newItem = new Menuitem();
newItem.setAttribute(EVENT_ATTRIBUTE, NEW_EVENT); newItem.setAttribute(EVENT_ATTRIBUTE, NEW_EVENT);
newItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New"))); newItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
newItem.setImage("/images/New16.png"); newItem.setImage(ThemeManager.getThemeResource("images/New16.png"));
newItem.addEventListener(Events.ON_CLICK, this); newItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(newItem); this.appendChild(newItem);
} }
@ -196,7 +197,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
updateItem = new Menuitem(); updateItem = new Menuitem();
updateItem.setAttribute(EVENT_ATTRIBUTE, UPDATE_EVENT); updateItem.setAttribute(EVENT_ATTRIBUTE, UPDATE_EVENT);
updateItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Update"))); updateItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Update")));
updateItem.setImage("/images/InfoBPartner16.png"); updateItem.setImage(ThemeManager.getThemeResource("images/InfoBPartner16.png"));
updateItem.addEventListener(Events.ON_CLICK, this); updateItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(updateItem); this.appendChild(updateItem);
} }
@ -206,7 +207,7 @@ public class WEditorPopupMenu extends Menupopup implements EventListener<Event>
showLocationItem = new Menuitem(); showLocationItem = new Menuitem();
showLocationItem.setAttribute(EVENT_ATTRIBUTE, SHOWLOCATION_EVENT); showLocationItem.setAttribute(EVENT_ATTRIBUTE, SHOWLOCATION_EVENT);
showLocationItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ShowLocation"))); showLocationItem.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ShowLocation")));
showLocationItem.setImage("/images/InfoBPartner16.png"); showLocationItem.setImage(ThemeManager.getThemeResource("images/InfoBPartner16.png"));
showLocationItem.addEventListener(Events.ON_CLICK, this); showLocationItem.addEventListener(Events.ON_CLICK, this);
this.appendChild(showLocationItem); this.appendChild(showLocationItem);
} }

View File

@ -17,6 +17,7 @@ package org.adempiere.webui.editor;
import org.adempiere.webui.component.FilenameBox; import org.adempiere.webui.component.FilenameBox;
import org.adempiere.webui.component.FolderBrowser; import org.adempiere.webui.component.FolderBrowser;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
@ -39,7 +40,7 @@ public class WFileDirectoryEditor extends WEditor
public WFileDirectoryEditor(GridField gridField) public WFileDirectoryEditor(GridField gridField)
{ {
super(new FilenameBox(), gridField); super(new FilenameBox(), gridField);
getComponent().setButtonImage("/images/Open16.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Open16.png"));
getComponent().addEventListener(Events.ON_CLICK, this); getComponent().addEventListener(Events.ON_CLICK, this);
getComponent().getButton().setUpload("false"); getComponent().getButton().setUpload("false");
} }

View File

@ -23,6 +23,7 @@ import java.util.logging.Level;
import org.adempiere.webui.component.FilenameBox; import org.adempiere.webui.component.FilenameBox;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.zkoss.util.media.Media; import org.zkoss.util.media.Media;
@ -46,7 +47,7 @@ public class WFilenameEditor extends WEditor
public WFilenameEditor(GridField gridField) public WFilenameEditor(GridField gridField)
{ {
super(new FilenameBox(), gridField); super(new FilenameBox(), gridField);
getComponent().setButtonImage("/images/Open16.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Open16.png"));
getComponent().addEventListener(Events.ON_UPLOAD, this); getComponent().addEventListener(Events.ON_UPLOAD, this);
getComponent().getButton().setUpload("true,native"); getComponent().getButton().setUpload("true,native");
getComponent().getButton().setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE); getComponent().getButton().setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.adempiere.webui.window.WLocationDialog; import org.adempiere.webui.window.WLocationDialog;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -84,7 +85,7 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
private void init() private void init()
{ {
getComponent().setButtonImage("/images/Location10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Location10.png"));
popupMenu = new WEditorPopupMenu(false, false, isShowPreference()); popupMenu = new WEditorPopupMenu(false, false, isShowPreference());
popupMenu.addMenuListener(this); popupMenu.addMenuListener(this);

View File

@ -32,6 +32,7 @@ import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.adempiere.webui.window.WLocatorDialog; import org.adempiere.webui.window.WLocatorDialog;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -93,7 +94,7 @@ public class WLocatorEditor extends WEditor implements EventListener<Event>, Pro
setColumnName(columnName); setColumnName(columnName);
m_mLocator = mLocator; m_mLocator = mLocator;
getComponent().setButtonImage("/images/Locator10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Locator10.png"));
m_WindowNo = windowNo; //Yvonne: move it b4 setDefault_Locator_ID() m_WindowNo = windowNo; //Yvonne: move it b4 setDefault_Locator_ID()
setDefault_Locator_ID(); // set default locator, teo_sarca [ 1661546 ] setDefault_Locator_ID(); // set default locator, teo_sarca [ 1661546 ]
@ -107,7 +108,7 @@ public class WLocatorEditor extends WEditor implements EventListener<Event>, Pro
super(new EditorBox(), gridField); super(new EditorBox(), gridField);
m_mLocator = (MLocatorLookup)gridField.getLookup(); m_mLocator = (MLocatorLookup)gridField.getLookup();
getComponent().setButtonImage("/images/Locator10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Locator10.png"));
setDefault_Locator_ID(); // set default locator, teo_sarca [ 1661546 ] setDefault_Locator_ID(); // set default locator, teo_sarca [ 1661546 ]

View File

@ -23,6 +23,7 @@ import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.adempiere.webui.window.WPAttributeDialog; import org.adempiere.webui.window.WPAttributeDialog;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -69,7 +70,7 @@ public class WPAttributeEditor extends WEditor implements ContextMenuListener
} }
private void initComponents() { private void initComponents() {
getComponent().setButtonImage("images/PAttribute10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/PAttribute10.png"));
// getComponent().addEventListener(Events.ON_CLICK, this); // IDEMPIERE-426 - dup listener, already set at WEditor // getComponent().addEventListener(Events.ON_CLICK, this); // IDEMPIERE-426 - dup listener, already set at WEditor
m_WindowNo = gridField.getWindowNo(); m_WindowNo = gridField.getWindowNo();

View File

@ -24,6 +24,7 @@ import org.adempiere.webui.component.Paymentbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.grid.IPaymentForm; import org.compiere.grid.IPaymentForm;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
@ -64,7 +65,7 @@ public class WPaymentEditor extends WEditor implements ListDataListener {
getComponent().getCombobox().setAutocomplete(true); getComponent().getCombobox().setAutocomplete(true);
getComponent().getCombobox().setAutodrop(true); getComponent().getCombobox().setAutodrop(true);
getComponent().getCombobox().addEventListener(Events.ON_BLUR, this); getComponent().getCombobox().addEventListener(Events.ON_BLUR, this);
getComponent().setButtonImage("/images/Payment10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Payment10.png"));
getComponent().getButton().addActionListener(this); getComponent().getButton().addActionListener(this);
if (lookup != null) if (lookup != null)

View File

@ -41,6 +41,7 @@ import org.adempiere.webui.factory.InfoManager;
import org.adempiere.webui.grid.WQuickEntry; import org.adempiere.webui.grid.WQuickEntry;
import org.adempiere.webui.panel.InfoPanel; import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
@ -162,16 +163,16 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
{ {
columnName = this.getColumnName(); columnName = this.getColumnName();
imageUrl = "/images/PickOpen10.png"; imageUrl = ThemeManager.getThemeResource("images/PickOpen10.png");
if (columnName.equals("C_BPartner_ID")) if (columnName.equals("C_BPartner_ID"))
{ {
popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), true, true, false, lookup); popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), true, true, false, lookup);
imageUrl = "/images/BPartner10.png"; imageUrl = ThemeManager.getThemeResource("images/BPartner10.png");
} }
else if (columnName.equals("M_Product_ID")) else if (columnName.equals("M_Product_ID"))
{ {
popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), false, false, false, lookup); popupMenu = new WEditorPopupMenu(true, true, isShowPreference(), false, false, false, lookup);
imageUrl = "/images/Product10.png"; imageUrl = ThemeManager.getThemeResource("images/Product10.png");
} }
else else
{ {

View File

@ -34,6 +34,7 @@ import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.exception.ApplicationException; import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.grid.WQuickEntry; import org.adempiere.webui.grid.WQuickEntry;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.adempiere.webui.window.WLocationDialog; import org.adempiere.webui.window.WLocationDialog;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -203,7 +204,7 @@ ContextMenuListener, IZoomableEditor
searchMode = new Menuitem(); searchMode = new Menuitem();
searchMode.setAttribute(WEditorPopupMenu.EVENT_ATTRIBUTE, SHORT_LIST_EVENT); searchMode.setAttribute(WEditorPopupMenu.EVENT_ATTRIBUTE, SHORT_LIST_EVENT);
searchMode.setLabel(Msg.getMsg(Env.getCtx(), "ShortListSwitchSearchMode")); searchMode.setLabel(Msg.getMsg(Env.getCtx(), "ShortListSwitchSearchMode"));
searchMode.setImage("/images/Lock16.png"); searchMode.setImage(ThemeManager.getThemeResource("images/Lock16.png"));
searchMode.addEventListener(Events.ON_CLICK, popupMenu); searchMode.addEventListener(Events.ON_CLICK, popupMenu);
popupMenu.appendChild(searchMode); popupMenu.appendChild(searchMode);
} }

View File

@ -22,6 +22,7 @@ import org.adempiere.webui.component.Urlbox;
import org.adempiere.webui.event.ContextMenuEvent; import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.event.ContextMenuListener;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.adempiere.webui.window.WFieldRecordInfo; import org.adempiere.webui.window.WFieldRecordInfo;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -37,7 +38,7 @@ public class WUrlEditor extends WEditor implements ContextMenuListener
public WUrlEditor(GridField gridField) public WUrlEditor(GridField gridField)
{ {
super(new Urlbox(), gridField); super(new Urlbox(), gridField);
getComponent().setButtonImage("/images/Online10.png"); getComponent().setButtonImage(ThemeManager.getThemeResource("images/Online10.png"));
popupMenu = new WEditorPopupMenu(false, false, isShowPreference()); popupMenu = new WEditorPopupMenu(false, false, isShowPreference());
popupMenu.addMenuListener(this); popupMenu.addMenuListener(this);

View File

@ -19,6 +19,7 @@ import org.adempiere.webui.component.Button;
import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.editor.WEditor;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.panel.InfoPAttributePanel; import org.adempiere.webui.panel.InfoPAttributePanel;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -45,7 +46,7 @@ public class WInfoPAttributeEditor extends WEditor implements IWhereClauseEditor
this.ctx = ctx; this.ctx = ctx;
this.windowNo = windowNo; this.windowNo = windowNo;
getComponent().addEventListener(Events.ON_CLICK, this); getComponent().addEventListener(Events.ON_CLICK, this);
getComponent().setImage("/images/PAttribute16.png"); getComponent().setImage(ThemeManager.getThemeResource("images/PAttribute16.png"));
getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute")); getComponent().setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute"));
setReadWrite(false); setReadWrite(false);
} }

View File

@ -24,6 +24,7 @@ import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.exception.ApplicationException; import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.MMenu; import org.compiere.model.MMenu;
import org.compiere.model.MQuery; import org.compiere.model.MQuery;
@ -206,35 +207,35 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
if (mChildNode.isReport()) if (mChildNode.isReport())
{ {
link.setImage("/images/mReport.png"); link.setImage(ThemeManager.getThemeResource("images/mReport.png"));
treeitem.setAttribute("menu.type", "report"); treeitem.setAttribute("menu.type", "report");
} }
else if (mChildNode.isProcess() || mChildNode.isTask()) else if (mChildNode.isProcess() || mChildNode.isTask())
{ {
link.setImage("/images/mProcess.png"); link.setImage(ThemeManager.getThemeResource("images/mProcess.png"));
treeitem.setAttribute("menu.type", "process"); treeitem.setAttribute("menu.type", "process");
} }
else if (mChildNode.isWorkFlow()) else if (mChildNode.isWorkFlow())
{ {
link.setImage("/images/mWorkFlow.png"); link.setImage(ThemeManager.getThemeResource("images/mWorkFlow.png"));
treeitem.setAttribute("menu.type", "workflow"); treeitem.setAttribute("menu.type", "workflow");
} }
else if (mChildNode.isForm()) else if (mChildNode.isForm())
{ {
link.setImage("/images/mWindow.png"); link.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
treeitem.setAttribute("menu.type", "form"); treeitem.setAttribute("menu.type", "form");
} }
else if (mChildNode.isInfo()) else if (mChildNode.isInfo())
{ {
link.setImage("/images/mWindow.png"); link.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
treeitem.setAttribute("menu.type", "info"); treeitem.setAttribute("menu.type", "info");
} }
else // Window else // Window
{ {
link.setImage("/images/mWindow.png"); link.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
treeitem.setAttribute("menu.type", "window"); treeitem.setAttribute("menu.type", "window");
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png"); Toolbarbutton newBtn = new Toolbarbutton(null, ThemeManager.getThemeResource("images/New10.png"));
newBtn.setStyle("padding-left:3px; margin-bottom:5px"); newBtn.setStyle("padding-left:3px; margin-bottom:5px");
treeCell.appendChild(newBtn); treeCell.appendChild(newBtn);
newBtn.addEventListener(Events.ON_CLICK, this); newBtn.addEventListener(Events.ON_CLICK, this);

View File

@ -38,6 +38,7 @@ import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
@ -161,10 +162,10 @@ public class CustomizeGridViewPanel extends Panel
yesModel.setMultiple(true); yesModel.setMultiple(true);
noModel.setMultiple(true); noModel.setMultiple(true);
bAdd.setImage("images/Next24.png"); bAdd.setImage(ThemeManager.getThemeResource("images/Next24.png"));
bAdd.addEventListener(Events.ON_CLICK, actionListener); bAdd.addEventListener(Events.ON_CLICK, actionListener);
bRemove.setImage("images/Previous24.png"); bRemove.setImage(ThemeManager.getThemeResource("images/Previous24.png"));
bRemove.addEventListener(Events.ON_CLICK, actionListener); bRemove.addEventListener(Events.ON_CLICK, actionListener);
EventListener<Event> crossListMouseListener = new DragListener(); EventListener<Event> crossListMouseListener = new DragListener();
@ -180,10 +181,10 @@ public class CustomizeGridViewPanel extends Panel
} }
}; };
bUp.setImage("images/Parent24.png"); bUp.setImage(ThemeManager.getThemeResource("images/Parent24.png"));
bUp.addEventListener(Events.ON_CLICK, actionListener); bUp.addEventListener(Events.ON_CLICK, actionListener);
bDown.setImage("images/Detail24.png"); bDown.setImage(ThemeManager.getThemeResource("images/Detail24.png"));
bDown.addEventListener(Events.ON_CLICK, actionListener); bDown.addEventListener(Events.ON_CLICK, actionListener);
ListHead listHead = new ListHead(); ListHead listHead = new ListHead();
@ -245,7 +246,7 @@ public class CustomizeGridViewPanel extends Panel
@SuppressWarnings("unused") @SuppressWarnings("unused")
String label = Msg.getMsg(Env.getCtx(), "save"); String label = Msg.getMsg(Env.getCtx(), "save");
Button bOK = new Button(); Button bOK = new Button();
bOK.setImage("/images/Ok16.png"); bOK.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
bOK.setId("Ok"); bOK.setId("Ok");
EventListener<Event> onClickListener = new EventListener<Event>() EventListener<Event> onClickListener = new EventListener<Event>()
{ {
@ -264,7 +265,7 @@ public class CustomizeGridViewPanel extends Panel
southPanel.appendChild(bOK); southPanel.appendChild(bOK);
label = Msg.getMsg(Env.getCtx(), "Cancel"); label = Msg.getMsg(Env.getCtx(), "Cancel");
Button btn = new Button(); Button btn = new Button();
btn.setImage("/images/Cancel16.png"); btn.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btn.setId("Cancel"); btn.setId("Cancel");
EventListener<Event> onClickCancelListener = new EventListener<Event>() EventListener<Event> onClickCancelListener = new EventListener<Event>()
{ {

View File

@ -17,24 +17,20 @@
package org.adempiere.webui.panel; package org.adempiere.webui.panel;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.AboutWindow; import org.adempiere.webui.window.AboutWindow;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Page; import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Button; import org.zkoss.zul.Button;
import org.zkoss.zul.Center;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image; import org.zkoss.zul.Image;
import org.zkoss.zul.Popup; import org.zkoss.zul.Popup;
import org.zkoss.zul.West;
/** /**
* *
@ -56,35 +52,21 @@ public class HeaderPanel extends Panel implements EventListener<Event>
public HeaderPanel() public HeaderPanel()
{ {
super(); super();
init(); addEventListener(Events.ON_CREATE, this);
} }
private void init() private void onCreate()
{ {
LayoutUtils.addSclass("desktop-header", this); image = (Image) getFellow("logo");
image.setSrc(ThemeManager.getSmallLogo());
UserPanel userPanel = new UserPanel();
image = new Image(ThemeManager.getSmallLogo());
image.addEventListener(Events.ON_CLICK, this); image.addEventListener(Events.ON_CLICK, this);
image.setStyle("cursor: pointer;"); image.setStyle("cursor: pointer;");
Borderlayout layout = new Borderlayout(); MenuSearchPanel menuSearchPanel = new MenuSearchPanel(this);
LayoutUtils.addSclass("desktop-header", layout); Component stub = getFellow("menuLookup");
layout.setParent(this); stub.getParent().insertBefore(menuSearchPanel, stub);
West west = new West(); stub.detach();
west.setWidth("50%"); menuSearchPanel.setId("menuLookup");
west.setParent(layout);
Hbox hbox = new Hbox();
hbox.setParent(west);
hbox.setHeight("100%");
hbox.setPack("center");
hbox.setAlign("left");
image.setParent(hbox);
new MenuSearchPanel(this).setParent(hbox);
popMenu = new Popup(); popMenu = new Popup();
popMenu.setId("menuTreePopup"); popMenu.setId("menuTreePopup");
@ -92,24 +74,11 @@ public class HeaderPanel extends Panel implements EventListener<Event>
popMenu.setSclass("desktop-menu-popup"); popMenu.setSclass("desktop-menu-popup");
popMenu.setHeight("90%"); popMenu.setHeight("90%");
popMenu.setWidth("600px"); popMenu.setWidth("600px");
popMenu.setPage(this.getPage());
btnMenu = new Button(); btnMenu = (Button) getFellow("menuButton");
btnMenu.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(),"Menu"))); btnMenu.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(),"Menu")));
btnMenu.setParent(hbox);
btnMenu.addEventListener(Events.ON_CLICK, this); btnMenu.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-left", west);
// Elaine 2009/03/02
Center center = new Center();
center.setParent(layout);
userPanel.setParent(center);
userPanel.setHeight("100%");
userPanel.setAlign("right");
userPanel.setStyle("position: absolute; text-align:right;");
userPanel.setVflex("1");
userPanel.setHflex("1");
LayoutUtils.addSclass("desktop-header-right", center);
} }
public void onEvent(Event event) throws Exception { public void onEvent(Event event) throws Exception {
@ -124,6 +93,8 @@ public class HeaderPanel extends Panel implements EventListener<Event>
{ {
popMenu.open(btnMenu, "after_start"); popMenu.open(btnMenu, "after_start");
} }
} else if (Events.ON_CREATE.equals(event.getName())) {
onCreate();
} }
} }
@ -133,7 +104,7 @@ public class HeaderPanel extends Panel implements EventListener<Event>
@Override @Override
public void onPageAttached(Page newpage, Page oldpage) { public void onPageAttached(Page newpage, Page oldpage) {
super.onPageAttached(newpage, oldpage); super.onPageAttached(newpage, oldpage);
if (newpage != null) if (newpage != null && popMenu != null)
popMenu.setPage(newpage); popMenu.setPage(newpage);
} }

View File

@ -36,6 +36,7 @@ import org.adempiere.webui.editor.WSearchEditor;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.event.WTableModelEvent; import org.adempiere.webui.event.WTableModelEvent;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.ColumnInfo;
import org.compiere.minigrid.IDColumn; import org.compiere.minigrid.IDColumn;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
@ -176,7 +177,7 @@ public class InfoAssignmentPanel extends InfoPanel implements EventListener<Even
return false; return false;
} }
bNew.setImage("/images/New16.png"); bNew.setImage(ThemeManager.getThemeResource("images/New16.png"));
return true; return true;
} // initLookups } // initLookups

View File

@ -64,6 +64,7 @@ import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.WListbox; import org.adempiere.webui.component.WListbox;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.ColumnInfo;
import org.compiere.minigrid.IDColumn; import org.compiere.minigrid.IDColumn;
import org.compiere.model.MDocType; import org.compiere.model.MDocType;
@ -262,7 +263,7 @@ public class InfoProductPanel extends InfoPanel implements EventListener<Event>
lblVendor = new Label(); lblVendor = new Label();
lblVendor.setValue(Msg.translate(Env.getCtx(), "Vendor")); lblVendor.setValue(Msg.translate(Env.getCtx(), "Vendor"));
m_InfoPAttributeButton.setImage("/images/PAttribute16.png"); m_InfoPAttributeButton.setImage(ThemeManager.getThemeResource("images/PAttribute16.png"));
m_InfoPAttributeButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute")); m_InfoPAttributeButton.setTooltiptext(Msg.getMsg(Env.getCtx(), "PAttribute"));
m_InfoPAttributeButton.addEventListener(Events.ON_CLICK,this); m_InfoPAttributeButton.addEventListener(Events.ON_CLICK,this);

View File

@ -1,49 +0,0 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius *
* or via info@posterita.org or http://www.posterita.org/ *
*****************************************************************************/
package org.adempiere.webui.panel;
import org.adempiere.webui.component.Panel;
import org.zkoss.zul.Image;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
* @date Mar 1, 2007
* @version $Revision: 0.10 $
*/
public class LogoPanel extends Panel
{
/**
*
*/
private static final long serialVersionUID = -3908377845468033243L;
private Image imgLogo;
public LogoPanel()
{
super();
init();
}
private void init()
{
imgLogo = new Image("/images/logo.png");
this.appendChild(imgLogo);
this.setWidth("250px");
}
}

View File

@ -1,64 +0,0 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius *
* or via info@posterita.org or http://www.posterita.org/ *
*****************************************************************************/
package org.adempiere.webui.panel;
import org.adempiere.webui.component.Panel;
import org.adempiere.webui.session.SessionManager;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Button;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
* @date Mar 2, 2007
* @version $Revision: 0.10 $
*/
public class LogoutPanel extends Panel implements EventListener<Event>
{
/**
*
*/
private static final long serialVersionUID = -456860093240111236L;
private Button btnLogOut;
public LogoutPanel()
{
super();
init();
}
private void init()
{
btnLogOut = new Button();
btnLogOut.setImage("/images/Logout24.png");
btnLogOut.addEventListener(Events.ON_CLICK, this);
this.appendChild(btnLogOut);
}
public void onEvent(Event event)
{
if (btnLogOut == event.getTarget())
{
SessionManager.logoutSession();
}
}
}

View File

@ -1,332 +0,0 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius *
* or via info@posterita.org or http://www.posterita.org/ *
*****************************************************************************/
package org.adempiere.webui.panel;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Properties;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.event.MenuListener;
import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.util.TreeUtils;
import org.compiere.model.MTree;
import org.compiere.model.MTreeNode;
import org.compiere.model.MUser;
import static org.compiere.model.SystemIDs.*;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.A;
import org.zkoss.zul.Panel;
import org.zkoss.zul.Panelchildren;
import org.zkoss.zul.Style;
import org.zkoss.zul.Toolbar;
import org.zkoss.zul.Tree;
import org.zkoss.zul.Treecell;
import org.zkoss.zul.Treechildren;
import org.zkoss.zul.Treecol;
import org.zkoss.zul.Treecols;
import org.zkoss.zul.Treeitem;
import org.zkoss.zul.Treerow;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
* @date Feb 25, 2007
* @version $Revision: 0.10 $
*/
public class MenuPanel extends Panel implements EventListener<Event>
{
private static final String ON_EXPAND_MENU_EVENT = "onExpandMenu";
/**
*
*/
private static final long serialVersionUID = -593280866781665891L;
private Properties ctx;
private TreeSearchPanel pnlSearch;
private Tree menuTree;
private ArrayList<MenuListener> menuListeners = new ArrayList<MenuListener>();
private ToolBarButton expandToggle;
public MenuPanel(Component parent)
{
if (parent != null)
this.setParent(parent);
init();
}
private void init() {
ctx = Env.getCtx();
int adRoleId = Env.getAD_Role_ID(ctx);
int adTreeId = getTreeId(ctx, adRoleId);
MTree mTree = new MTree(ctx, adTreeId, false, true, null);
MTreeNode rootNode = mTree.getRoot();
initComponents();
initMenu(rootNode);
pnlSearch.initialise();
// Auto Expand Tree - nmicoud IDEMPIERE 195
if (MUser.get(ctx).isMenuAutoExpand())
expandAll();
// Auto Expand Tree - nmicoud IDEMPIERE 195
}
private void initComponents()
{
this.setWidth("100%");
this.setHeight("100%");
this.setStyle("position: relative");
menuTree = new Tree();
menuTree.setMultiple(false);
menuTree.setId("mnuMain");
menuTree.setWidth("100%");
menuTree.setVflex(true);
menuTree.setSizedByContent(false);
menuTree.setPageSize(-1); // Due to bug in the new paging functionality
menuTree.setStyle("border: none");
pnlSearch = new TreeSearchPanel(menuTree);
Style style = new Style();
style.setContent(".z-comboitem-img{ vertical-align:top; padding-right:2px; padding-bottom:4px; }");
pnlSearch.insertBefore(style, pnlSearch.getFirstChild());
Toolbar toolbar = new Toolbar();
toolbar.setMold("panel");
toolbar.appendChild(pnlSearch);
this.appendChild(toolbar);
Panelchildren pc = new Panelchildren();
this.appendChild(pc);
pc.appendChild(menuTree);
// Elaine 2009/02/27 - expand tree
toolbar = new Toolbar();
toolbar.setStyle("verticle-align: middle; padding: 2px");
expandToggle = new ToolBarButton();
expandToggle.setLabel(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "ExpandTree")));
expandToggle.setMode("toggle");
expandToggle.addEventListener(Events.ON_CHECK, this);
toolbar.appendChild(expandToggle);
toolbar.setMold("panel");
this.appendChild(toolbar);
this.addEventListener(ON_EXPAND_MENU_EVENT, this);
}
private void initMenu(MTreeNode rootNode)
{
Treecols treeCols = new Treecols();
Treecol treeCol = new Treecol();
Treechildren rootTreeChildren = new Treechildren();
treeCols.appendChild(treeCol);
menuTree.appendChild(treeCols);
menuTree.appendChild(rootTreeChildren);
generateMenu(rootTreeChildren, rootNode);
}
private int getTreeId(Properties ctx, int adRoleId)
{
int AD_Tree_ID = DB.getSQLValue(null,
"SELECT COALESCE(r.AD_Tree_Menu_ID, ci.AD_Tree_Menu_ID)"
+ "FROM AD_ClientInfo ci"
+ " INNER JOIN AD_Role r ON (ci.AD_Client_ID=r.AD_Client_ID) "
+ "WHERE AD_Role_ID=?", adRoleId);
if (AD_Tree_ID <= 0)
AD_Tree_ID = TREE_MENUPRIMARY; // Menu
return AD_Tree_ID;
}
private void generateMenu(Treechildren treeChildren, MTreeNode mNode)
{
Enumeration<?> nodeEnum = mNode.children();
while(nodeEnum.hasMoreElements())
{
MTreeNode mChildNode = (MTreeNode)nodeEnum.nextElement();
Treeitem treeitem = new Treeitem();
treeChildren.appendChild(treeitem);
treeitem.setTooltiptext(mChildNode.getDescription());
if(mChildNode.getChildCount() != 0)
{
treeitem.setOpen(false);
treeitem.setLabel(mChildNode.getName());
Treecell cell = (Treecell)treeitem.getTreerow().getFirstChild();
cell.setSclass("menu-treecell-cnt");
Treechildren treeItemChildren = new Treechildren();
treeitem.appendChild(treeItemChildren);
generateMenu(treeItemChildren, mChildNode);
if (treeItemChildren.getChildren().size() == 0)
{
treeItemChildren.detach();
}
treeitem.getTreerow().addEventListener(Events.ON_CLICK, this);
}
else
{
treeitem.setValue(String.valueOf(mChildNode.getNode_ID()));
Treerow treeRow = new Treerow();
treeitem.appendChild(treeRow);
Treecell treeCell = new Treecell();
treeRow.appendChild(treeCell);
A link = new A();
treeCell.appendChild(link);
if (mChildNode.isReport())
link.setImage("/images/mReport.png");
else if (mChildNode.isProcess() || mChildNode.isTask())
link.setImage("/images/mProcess.png");
else if (mChildNode.isWorkFlow())
link.setImage("/images/mWorkFlow.png");
else
link.setImage("/images/mWindow.png");
link.setLabel(mChildNode.getName());
treeitem.getTreerow().setDraggable("favourite"); // Elaine 2008/07/24
link.addEventListener(Events.ON_CLICK, this);
link.setSclass("menu-href");
}
}
}
public void addMenuListener(MenuListener menuListener)
{
menuListeners.add(menuListener);
}
public void removeMenuListener(MenuListener menuListener)
{
menuListeners.remove(menuListener);
}
public void onEvent(Event event)
{
Component comp = event.getTarget();
String eventName = event.getName();
if (eventName.equals(Events.ON_CLICK))
{
doOnClick(comp);
}
// Elaine 2009/02/27 - expand tree
else if (eventName.equals(Events.ON_CHECK) && event.getTarget() == expandToggle)
{
Clients.showBusy(null);
Events.echoEvent(ON_EXPAND_MENU_EVENT, this, null);
}
else if (eventName.equals(ON_EXPAND_MENU_EVENT))
{
expandOnCheck();
Clients.clearBusy();
}
//
}
private void doOnClick(Component comp) {
if (comp instanceof A) {
comp = comp.getParent().getParent();
}
if (comp instanceof Treerow)
{
Treeitem selectedItem = (Treeitem) comp.getParent();
if(selectedItem.getValue() != null)
{
fireMenuSelectedEvent(selectedItem);
}
else
{
selectedItem.setOpen(!selectedItem.isOpen());
}
selectedItem.setSelected(true);
}
}
protected void fireMenuSelectedEvent(Treeitem selectedItem) {
int nodeId = Integer.parseInt((String)selectedItem.getValue());
try
{
/*Iterator<MenuListener> menuListenersIter = menuListeners.iterator();
while(menuListenersIter.hasNext())
{
menuListenersIter.next().onMenuSelected(nodeId);
menuTree.setSelectedItem(null);
}*/
SessionManager.getAppDesktop().onMenuSelected(nodeId);
}
catch (Exception e)
{
throw new ApplicationException(e.getMessage(), e);
}
}
public Tree getMenuTree()
{
return menuTree;
}
/**
* expand all node
*/
public void expandAll()
{
if (!expandToggle.isChecked())
expandToggle.setChecked(true);
TreeUtils.expandAll(menuTree);
}
/**
* collapse all node
*/
public void collapseAll()
{
if (expandToggle.isChecked())
expandToggle.setChecked(false);
TreeUtils.collapseAll(menuTree);
}
/**
* On check event for the expand checkbox
*/
private void expandOnCheck()
{
if (expandToggle.isChecked())
expandAll();
else
collapseAll();
}
//
}

View File

@ -1,5 +1,6 @@
package org.adempiere.webui.panel; package org.adempiere.webui.panel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.TreeItemAction; import org.adempiere.webui.util.TreeItemAction;
import org.adempiere.webui.util.TreeUtils; import org.adempiere.webui.util.TreeUtils;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -34,28 +35,28 @@ public class MenuTreeFilterPanel extends Popup implements EventListener<Event>,
Vbox box = new Vbox(); Vbox box = new Vbox();
Checkbox report = new Checkbox(); Checkbox report = new Checkbox();
report.setImage("/images/mReport.png"); report.setImage(ThemeManager.getThemeResource("images/mReport.png"));
report.setChecked(true); report.setChecked(true);
report.setId("report"); report.setId("report");
report.addEventListener(Events.ON_CHECK, this); report.addEventListener(Events.ON_CHECK, this);
box.appendChild(report); box.appendChild(report);
Checkbox process = new Checkbox(); Checkbox process = new Checkbox();
process.setImage("/images/mProcess.png"); process.setImage(ThemeManager.getThemeResource("images/mProcess.png"));
process.setChecked(true); process.setChecked(true);
process.setId("process"); process.setId("process");
process.addEventListener(Events.ON_CHECK, this); process.addEventListener(Events.ON_CHECK, this);
box.appendChild(process); box.appendChild(process);
Checkbox workflow = new Checkbox(); Checkbox workflow = new Checkbox();
workflow.setImage("/images/mWorkFlow.png"); workflow.setImage(ThemeManager.getThemeResource("images/mWorkFlow.png"));
workflow.setChecked(true); workflow.setChecked(true);
workflow.setId("workflow"); workflow.setId("workflow");
workflow.addEventListener(Events.ON_CHECK, this); workflow.addEventListener(Events.ON_CHECK, this);
box.appendChild(workflow); box.appendChild(workflow);
Checkbox window = new Checkbox(); Checkbox window = new Checkbox();
window.setImage("/images/mWindow.png"); window.setImage(ThemeManager.getThemeResource("images/mWindow.png"));
window.setChecked(true); window.setChecked(true);
window.setId("window"); window.setId("window");
window.addEventListener(Events.ON_CHECK, this); window.addEventListener(Events.ON_CHECK, this);

View File

@ -15,6 +15,7 @@
package org.adempiere.webui.panel; package org.adempiere.webui.panel;
import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.TreeUtils; import org.adempiere.webui.util.TreeUtils;
import org.compiere.model.MUser; import org.compiere.model.MUser;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -105,7 +106,7 @@ public class MenuTreePanel extends AbstractMenuPanel
pc.appendChild(filterPanel); pc.appendChild(filterPanel);
filterBtn = new Toolbarbutton(); filterBtn = new Toolbarbutton();
filterBtn.setImage("/images/Preference16.png"); filterBtn.setImage(ThemeManager.getThemeResource("images/Preference16.png"));
filterBtn.addEventListener(Events.ON_CLICK, this); filterBtn.addEventListener(Events.ON_CLICK, this);
toolbar.appendChild(filterBtn); toolbar.appendChild(filterBtn);
} }

View File

@ -16,6 +16,7 @@ package org.adempiere.webui.panel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.TreeItemAction; import org.adempiere.webui.util.TreeItemAction;
import org.adempiere.webui.util.TreeNodeAction; import org.adempiere.webui.util.TreeNodeAction;
import org.adempiere.webui.util.TreeUtils; import org.adempiere.webui.util.TreeUtils;
@ -71,7 +72,7 @@ public class MenuTreeSearchPanel extends TreeSearchPanel {
hlayout.setSclass("menu-search-toggle-box"); hlayout.setSclass("menu-search-toggle-box");
newBtn = new Toolbarbutton(); newBtn = new Toolbarbutton();
newBtn.setImage("/images/New16.png"); newBtn.setImage(ThemeManager.getThemeResource("images/New16.png"));
newBtn.setSclass("menu-search-toggle-off"); newBtn.setSclass("menu-search-toggle-off");
newBtn.addEventListener(Events.ON_CLICK, new EventListener<Event>() { newBtn.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@Override @Override
@ -87,7 +88,7 @@ public class MenuTreeSearchPanel extends TreeSearchPanel {
newBtn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New"))); newBtn.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
openBtn = new Toolbarbutton(); openBtn = new Toolbarbutton();
openBtn.setImage("/images/Open16.png"); openBtn.setImage(ThemeManager.getThemeResource("images/Open16.png"));
openBtn.setSclass("menu-search-toggle-on"); openBtn.setSclass("menu-search-toggle-on");
openBtn.setDisabled(true); openBtn.setDisabled(true);
openBtn.addEventListener(Events.ON_CLICK, new EventListener<Event>() { openBtn.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
@ -154,7 +155,7 @@ public class MenuTreeSearchPanel extends TreeSearchPanel {
String image = getImage(treeItem); String image = getImage(treeItem);
if (image == null || image.length() == 0) if (image == null || image.length() == 0)
{ {
image = "/images/Folder16.png"; image = ThemeManager.getThemeResource("images/Folder16.png");
} }
imageList.add(image); imageList.add(image);
} }

View File

@ -1,56 +0,0 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius *
* or via info@posterita.org or http://www.posterita.org/ *
*****************************************************************************/
package org.adempiere.webui.panel;
import org.adempiere.webui.component.Panel;
import org.zkoss.zk.ui.Component;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
* @date Mar 2, 2007
* @version $Revision: 0.10 $
*/
public class SidePanel extends Panel
{
/**
*
*/
private static final long serialVersionUID = -3039805384016666481L;
private MenuPanel pnlMenu;
public SidePanel(Component parent)
{
setParent(parent);
init();
}
private void init()
{
pnlMenu = new MenuPanel(this);
this.setWidth("100%");
this.setHeight("100%");
this.setStyle("position: relative");
}
public MenuPanel getMenuPanel()
{
return pnlMenu;
}
}

View File

@ -25,6 +25,7 @@ import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.AutoComplete; import org.adempiere.webui.component.AutoComplete;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.DocumentSearch; import org.adempiere.webui.util.DocumentSearch;
import org.adempiere.webui.util.TreeItemAction; import org.adempiere.webui.util.TreeItemAction;
import org.adempiere.webui.util.TreeNodeAction; import org.adempiere.webui.util.TreeNodeAction;
@ -233,7 +234,7 @@ public class TreeSearchPanel extends Panel implements EventListener<Event>, Tree
treeImages[i] = getImage(treeItem); treeImages[i] = getImage(treeItem);
if ((treeImages[i] == null || treeImages[i].trim().length() == 0) && isFolder(treeItem)) if ((treeImages[i] == null || treeImages[i].trim().length() == 0) && isFolder(treeItem))
{ {
treeImages[i] = "/images/Folder16.png"; treeImages[i] = ThemeManager.getThemeResource("images/Folder16.png");
} }
} }
else if (value instanceof DefaultTreeNode) else if (value instanceof DefaultTreeNode)

View File

@ -19,7 +19,6 @@ package org.adempiere.webui.panel;
import java.util.Properties; import java.util.Properties;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Menupopup; import org.adempiere.webui.component.Menupopup;
import org.adempiere.webui.component.Messagebox; import org.adempiere.webui.component.Messagebox;
@ -37,9 +36,7 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.KeyEvent; import org.zkoss.zk.ui.event.KeyEvent;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Separator;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Vbox;
/** /**
@ -71,71 +68,30 @@ public class UserPanel extends Vbox implements EventListener<Event>
{ {
super(); super();
this.ctx = Env.getCtx(); this.ctx = Env.getCtx();
init(); addEventListener(Events.ON_CREATE, this);
} }
private void init() private void onCreate()
{ {
lblUserNameValue = (Label) getFellow("loginUserAndRole");
this.setSclass("desktop-user-panel");
Vbox vbox = new Vbox();
this.appendChild(vbox);
lblUserNameValue.setValue(getUserName() + "@" + getClientName() + "." + getOrgName()+"/"+this.getRoleName()); lblUserNameValue.setValue(getUserName() + "@" + getClientName() + "." + getOrgName()+"/"+this.getRoleName());
lblUserNameValue.setStyle("cursor: pointer;");
lblUserNameValue.addEventListener(Events.ON_CLICK, this); lblUserNameValue.addEventListener(Events.ON_CLICK, this);
lblUserNameValue.setId("loginUserAndRole");
LayoutUtils.addSclass("desktop-header-font", lblUserNameValue);
LayoutUtils.addSclass("desktop-header-username", lblUserNameValue);
vbox.appendChild(lblUserNameValue);
Hbox hbox = new Hbox();
vbox.appendChild(hbox);
hbox.setAlign("center");
feedback = (ToolBarButton) getFellow("feedback");
feedback.setLabel(Msg.getMsg(Env.getCtx(), "Feedback")); feedback.setLabel(Msg.getMsg(Env.getCtx(), "Feedback"));
feedback.setId("feedback");
feedback.addEventListener(Events.ON_CLICK, this); feedback.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-font", feedback);
LayoutUtils.addSclass("link", feedback);
feedback.setParent(hbox);
Separator sep = new Separator("vertical");
sep.setBar(true);
sep.setHeight("13px");
sep.setParent(hbox);
preference = (ToolBarButton) getFellow("preference");
preference.setLabel(Msg.getMsg(Env.getCtx(), "Preference")); preference.setLabel(Msg.getMsg(Env.getCtx(), "Preference"));
preference.setId("preference");
preference.addEventListener(Events.ON_CLICK, this); preference.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-font", preference);
LayoutUtils.addSclass("link", preference);
preference.setParent(hbox);
sep = new Separator("vertical");
sep.setBar(true);
sep.setHeight("13px");
sep.setParent(hbox);
changeRole = (ToolBarButton) getFellow("changeRole");
changeRole.setLabel(Msg.getMsg(Env.getCtx(), "changeRole")); changeRole.setLabel(Msg.getMsg(Env.getCtx(), "changeRole"));
changeRole.setId("changeRole");
changeRole.addEventListener(Events.ON_CLICK, this); changeRole.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-font", changeRole);
LayoutUtils.addSclass("link", changeRole);
changeRole.setParent(hbox);
sep = new Separator("vertical");
sep.setBar(true);
sep.setHeight("13px");
sep.setParent(hbox);
logout = (ToolBarButton) getFellow("logout");
logout.setLabel(Msg.getMsg(Env.getCtx(),"Logout")); logout.setLabel(Msg.getMsg(Env.getCtx(),"Logout"));
logout.setId("logout");
logout.addEventListener(Events.ON_CLICK, this); logout.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("desktop-header-font", logout);
LayoutUtils.addSclass("link", logout);
logout.setParent(hbox);
feedbackMenu = new Menupopup(); feedbackMenu = new Menupopup();
Menuitem mi = new Menuitem(Msg.getMsg(Env.getCtx(), "RequestNew")); Menuitem mi = new Menuitem(Msg.getMsg(Env.getCtx(), "RequestNew"));
@ -248,6 +204,10 @@ public class UserPanel extends Vbox implements EventListener<Event>
} }
} }
} }
else if (Events.ON_CREATE.equals(event.getName()))
{
onCreate();
}
} }
} }

View File

@ -35,6 +35,7 @@ import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FDialog;
import org.compiere.model.MAttachment; import org.compiere.model.MAttachment;
import org.compiere.model.MAttachmentEntry; import org.compiere.model.MAttachmentEntry;
@ -246,18 +247,18 @@ public class WAttachment extends Window implements EventListener<Event>
bSave.setEnabled(false); bSave.setEnabled(false);
bSave.setSclass("action-button"); bSave.setSclass("action-button");
bSave.setImage("/images/Export24.png"); bSave.setImage(ThemeManager.getThemeResource("images/Export24.png"));
bSave.setTooltiptext(Msg.getMsg(Env.getCtx(), "AttachmentSave")); bSave.setTooltiptext(Msg.getMsg(Env.getCtx(), "AttachmentSave"));
bSave.addEventListener(Events.ON_CLICK, this); bSave.addEventListener(Events.ON_CLICK, this);
bLoad.setImage("/images/Import24.png"); bLoad.setImage(ThemeManager.getThemeResource("images/Import24.png"));
bLoad.setSclass("action-button"); bLoad.setSclass("action-button");
bLoad.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE); bLoad.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE);
bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load")); bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load"));
bLoad.setUpload("true"); bLoad.setUpload("true");
bLoad.addEventListener(Events.ON_UPLOAD, this); bLoad.addEventListener(Events.ON_UPLOAD, this);
bDelete.setImage("/images/Delete24.png"); bDelete.setImage(ThemeManager.getThemeResource("images/Delete24.png"));
bDelete.setSclass("action-button"); bDelete.setSclass("action-button");
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete")); bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
bDelete.addEventListener(Events.ON_CLICK, this); bDelete.addEventListener(Events.ON_CLICK, this);
@ -278,19 +279,19 @@ public class WAttachment extends Window implements EventListener<Event>
southPane.appendChild(confirmPanel); southPane.appendChild(confirmPanel);
southPane.setHeight("30px"); southPane.setHeight("30px");
bCancel.setImage("/images/Cancel24.png"); bCancel.setImage(ThemeManager.getThemeResource("images/Cancel24.png"));
bCancel.setSclass("action-button"); bCancel.setSclass("action-button");
bCancel.addEventListener(Events.ON_CLICK, this); bCancel.addEventListener(Events.ON_CLICK, this);
bOk.setImage("/images/Ok24.png"); bOk.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
bOk.setSclass("action-button"); bOk.setSclass("action-button");
bOk.addEventListener(Events.ON_CLICK, this); bOk.addEventListener(Events.ON_CLICK, this);
bDeleteAll.setImage("/images/Delete24.png"); bDeleteAll.setImage(ThemeManager.getThemeResource("images/Delete24.png"));
bDeleteAll.setSclass("action-button"); bDeleteAll.setSclass("action-button");
bDeleteAll.addEventListener(Events.ON_CLICK, this); bDeleteAll.addEventListener(Events.ON_CLICK, this);
bRefresh.setImage("/images/Refresh24.png"); bRefresh.setImage(ThemeManager.getThemeResource("images/Refresh24.png"));
bRefresh.setSclass("action-button"); bRefresh.setSclass("action-button");
bRefresh.addEventListener(Events.ON_CLICK, this); bRefresh.addEventListener(Events.ON_CLICK, this);

View File

@ -26,6 +26,7 @@ import org.adempiere.webui.component.ListHeader;
import org.adempiere.webui.component.ListItem; import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.NamePair; import org.compiere.util.NamePair;
@ -139,10 +140,10 @@ public class WRC2FieldOrderPanel extends WRCTabPanel implements EventListener<Ev
} }
}; };
bUp.setImage("images/Parent24.png"); bUp.setImage(ThemeManager.getThemeResource("images/Parent24.png"));
bUp.addEventListener(Events.ON_CLICK, actionListener); bUp.addEventListener(Events.ON_CLICK, actionListener);
bDown.setImage("images/Detail24.png"); bDown.setImage(ThemeManager.getThemeResource("images/Detail24.png"));
bDown.addEventListener(Events.ON_CLICK, actionListener); bDown.addEventListener(Events.ON_CLICK, actionListener);
Vbox vbox = new Vbox(); Vbox vbox = new Vbox();

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.ListHeader;
import org.adempiere.webui.component.ListItem; import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.print.MPrintFormatItem; import org.compiere.print.MPrintFormatItem;
import org.compiere.util.KeyNamePair; import org.compiere.util.KeyNamePair;
import org.compiere.util.NamePair; import org.compiere.util.NamePair;
@ -99,10 +100,10 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
yesList.setSeltype("multiple"); yesList.setSeltype("multiple");
noList.setSeltype("multiple"); noList.setSeltype("multiple");
bAdd.setImage("images/Next24.png"); bAdd.setImage(ThemeManager.getThemeResource("images/Next24.png"));
bAdd.addEventListener(Events.ON_CLICK, actionListener); bAdd.addEventListener(Events.ON_CLICK, actionListener);
bRemove.setImage("images/Previous24.png"); bRemove.setImage(ThemeManager.getThemeResource("images/Previous24.png"));
bRemove.addEventListener(Events.ON_CLICK, actionListener); bRemove.addEventListener(Events.ON_CLICK, actionListener);
EventListener<Event> crossListMouseListener = new DragListener(); EventListener<Event> crossListMouseListener = new DragListener();
@ -148,10 +149,10 @@ public class WRC3SortCriteriaPanel extends WRCTabPanel implements EventListener
} }
}; };
bUp.setImage("images/Parent24.png"); bUp.setImage(ThemeManager.getThemeResource("images/Parent24.png"));
bUp.addEventListener(Events.ON_CLICK, actionListener2); bUp.addEventListener(Events.ON_CLICK, actionListener2);
bDown.setImage("images/Detail24.png"); bDown.setImage(ThemeManager.getThemeResource("images/Detail24.png"));
bDown.addEventListener(Events.ON_CLICK, actionListener2); bDown.addEventListener(Events.ON_CLICK, actionListener2);
vbox = new Vbox(); vbox = new Vbox();

View File

@ -14,6 +14,7 @@
package org.adempiere.webui.report; package org.adempiere.webui.report;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.theme.ThemeManager;
import org.apache.ecs.ConcreteElement; import org.apache.ecs.ConcreteElement;
import org.apache.ecs.xhtml.a; import org.apache.ecs.xhtml.a;
import org.apache.ecs.xhtml.div; import org.apache.ecs.xhtml.div;
@ -64,7 +65,7 @@ public class HTMLExtension implements IHTMLExtension {
+ dataElement.getValueAsString() + "')"); + dataElement.getValueAsString() + "')");
window.addElement(href); window.addElement(href);
menu.addElement(window); menu.addElement(window);
img image = new img("/webui/images/mWindow.png"); img image = new img("/webui" + ThemeManager.getThemeResource("images/mWindow.png"));
image.setAlign("middle"); image.setAlign("middle");
href.addElement(image); href.addElement(image);
href.addElement(Msg.getMsg(AEnv.getLanguage(Env.getCtx()), "Window")); href.addElement(Msg.getMsg(AEnv.getLanguage(Env.getCtx()), "Window"));
@ -82,7 +83,7 @@ public class HTMLExtension implements IHTMLExtension {
+ dataElement.getValueAsString() + "')"); + dataElement.getValueAsString() + "')");
report.addElement(href); report.addElement(href);
menu.addElement(report); menu.addElement(report);
image = new img("/webui/images/mReport.png"); image = new img("/webui" + ThemeManager.getThemeResource("images/mReport.png"));
image.setAlign("middle"); image.setAlign("middle");
href.addElement(image); href.addElement(image);
href.addElement(Msg.getMsg(AEnv.getLanguage(Env.getCtx()), "Report").replace("&", "")); href.addElement(Msg.getMsg(AEnv.getLanguage(Env.getCtx()), "Report").replace("&", ""));

View File

@ -114,4 +114,14 @@ public final class ThemeManager {
String def = ITheme.THEME_PATH_PREFIX + theme + ITheme.BROWSER_ICON_IMAGE; String def = ITheme.THEME_PATH_PREFIX + theme + ITheme.BROWSER_ICON_IMAGE;
return MSysConfig.getValue(MSysConfig.ZK_BROWSER_ICON, def); return MSysConfig.getValue(MSysConfig.ZK_BROWSER_ICON, def);
} }
/**
* Get theme resource url
* @param name relative resource name from theme root
* @return full resource url
*/
public static String getThemeResource(String name) {
String theme = getTheme();
return ITheme.THEME_PATH_PREFIX + theme + "/" + name;
}
} }

View File

@ -17,6 +17,7 @@ import java.net.URL;
import org.adempiere.base.IResourceFinder; import org.adempiere.base.IResourceFinder;
import org.adempiere.webui.WebUIActivator; import org.adempiere.webui.WebUIActivator;
import org.adempiere.webui.theme.ThemeManager;
/** /**
* *
@ -30,6 +31,7 @@ public class WebUIResourceFinder implements IResourceFinder {
URL url = WebUIActivator.getBundleContext().getBundle().getEntry(name); URL url = WebUIActivator.getBundleContext().getBundle().getEntry(name);
if (url == null && name.startsWith("org/compiere/images")) { if (url == null && name.startsWith("org/compiere/images")) {
String t = name.substring("org/compiere/".length()); String t = name.substring("org/compiere/".length());
t = ThemeManager.getThemeResource(t);
url = WebUIActivator.getBundleContext().getBundle().getEntry(t); url = WebUIActivator.getBundleContext().getBundle().getEntry(t);
if (url == null && t.endsWith(".gif")) { if (url == null && t.endsWith(".gif")) {
t = t.replace(".gif", ".png"); t = t.replace(".gif", ".png");
@ -37,6 +39,7 @@ public class WebUIResourceFinder implements IResourceFinder {
} }
} else if (url == null && name.startsWith("/org/compiere/images")) { } else if (url == null && name.startsWith("/org/compiere/images")) {
String t = name.substring("/org/compiere/".length()); String t = name.substring("/org/compiere/".length());
t = ThemeManager.getThemeResource(t);
url = WebUIActivator.getBundleContext().getBundle().getEntry(t); url = WebUIActivator.getBundleContext().getBundle().getEntry(t);
if (url == null && t.endsWith(".gif")) { if (url == null && t.endsWith(".gif")) {
t = t.replace(".gif", ".png"); t = t.replace(".gif", ".png");

View File

@ -155,7 +155,7 @@ public class AboutWindow extends Window implements EventListener<Event> {
hbox.setWidth("100%"); hbox.setWidth("100%");
hbox.setVflex("0"); hbox.setVflex("0");
Button btnOk = new Button(); Button btnOk = new Button();
btnOk.setImage("/images/Ok24.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
btnOk.setParent(hbox); btnOk.setParent(hbox);

View File

@ -65,6 +65,7 @@ import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.part.MultiTabPart; import org.adempiere.webui.part.MultiTabPart;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridFieldVO; import org.compiere.model.GridFieldVO;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
@ -306,21 +307,21 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
Button btnNew = new Button(); Button btnNew = new Button();
btnNew.setName("btnNew"); btnNew.setName("btnNew");
btnNew.setId("btnNew"); btnNew.setId("btnNew");
btnNew.setImage("/images/New24.png"); btnNew.setImage(ThemeManager.getThemeResource("images/New24.png"));
btnNew.addEventListener(Events.ON_CLICK,this); btnNew.addEventListener(Events.ON_CLICK,this);
LayoutUtils.addSclass("action-button", btnNew); LayoutUtils.addSclass("action-button", btnNew);
Button btnOk = new Button(); Button btnOk = new Button();
btnOk.setName("btnOkSimple"); btnOk.setName("btnOkSimple");
btnOk.setId("btnOk"); btnOk.setId("btnOk");
btnOk.setImage("/images/Ok24.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
btnOk.addEventListener(Events.ON_CLICK,this); btnOk.addEventListener(Events.ON_CLICK,this);
LayoutUtils.addSclass("action-button", btnOk); LayoutUtils.addSclass("action-button", btnOk);
Button btnCancel = new Button(); Button btnCancel = new Button();
btnCancel.setName("btnCancel"); btnCancel.setName("btnCancel");
btnCancel.setId("btnCancel"); btnCancel.setId("btnCancel");
btnCancel.setImage("/images/Cancel24.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel24.png"));
btnCancel.addEventListener(Events.ON_CLICK,this); btnCancel.addEventListener(Events.ON_CLICK,this);
LayoutUtils.addSclass("action-button", btnCancel); LayoutUtils.addSclass("action-button", btnCancel);
@ -395,24 +396,24 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
private void initAdvanced() private void initAdvanced()
{ {
ToolBarButton btnNew = new ToolBarButton(); ToolBarButton btnNew = new ToolBarButton();
btnNew.setImage("/images/New24.png"); btnNew.setImage(ThemeManager.getThemeResource("images/New24.png"));
btnNew.setAttribute("name", "btnNewAdv"); btnNew.setAttribute("name", "btnNewAdv");
btnNew.addEventListener(Events.ON_CLICK, this); btnNew.addEventListener(Events.ON_CLICK, this);
ToolBarButton btnDelete = new ToolBarButton(); ToolBarButton btnDelete = new ToolBarButton();
btnDelete.setAttribute("name","btnDeleteAdv"); btnDelete.setAttribute("name","btnDeleteAdv");
btnDelete.setImage("/images/Delete24.png"); btnDelete.setImage(ThemeManager.getThemeResource("images/Delete24.png"));
btnDelete.addEventListener(Events.ON_CLICK, this); btnDelete.addEventListener(Events.ON_CLICK, this);
Button btnOk = new Button(); Button btnOk = new Button();
btnOk.setName("btnOkAdv"); btnOk.setName("btnOkAdv");
btnOk.setImage("/images/Ok24.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-button", btnOk); LayoutUtils.addSclass("action-button", btnOk);
Button btnCancel = new Button(); Button btnCancel = new Button();
btnCancel.setName("btnCancel"); btnCancel.setName("btnCancel");
btnCancel.setImage("/images/Cancel24.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel24.png"));
btnCancel.addEventListener(Events.ON_CLICK, this); btnCancel.addEventListener(Events.ON_CLICK, this);
LayoutUtils.addSclass("action-button", btnCancel); LayoutUtils.addSclass("action-button", btnCancel);
@ -511,7 +512,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
btnSave = new ToolBarButton(); btnSave = new ToolBarButton();
btnSave.setAttribute("name","btnSaveAdv"); btnSave.setAttribute("name","btnSaveAdv");
btnSave.setImage("/images/Save24.png"); btnSave.setImage(ThemeManager.getThemeResource("images/Save24.png"));
btnSave.addEventListener(Events.ON_CLICK, this); btnSave.addEventListener(Events.ON_CLICK, this);
btnSave.setDisabled(true); btnSave.setDisabled(true);
btnSave.setId("btnSave"); btnSave.setId("btnSave");

View File

@ -65,23 +65,20 @@ public class LoginWindow extends FWindow implements EventListener<Event>
private ChangePasswordPanel pnlChangePassword; private ChangePasswordPanel pnlChangePassword;
private RolePanel pnlRole; private RolePanel pnlRole;
public LoginWindow(IWebClient app) public LoginWindow() {}
public void init(IWebClient app)
{ {
this.ctx = Env.getCtx(); this.ctx = Env.getCtx();
this.app = app; this.app = app;
initComponents(); initComponents();
init(); this.appendChild(pnlLogin);
this.setStyle("background-color: transparent");
// add listener on 'ENTER' key for the login window // add listener on 'ENTER' key for the login window
addEventListener(Events.ON_OK,this); addEventListener(Events.ON_OK,this);
setWidgetListener("onOK", "zAu.cmd0.showBusy(null)"); setWidgetListener("onOK", "zAu.cmd0.showBusy(null)");
} }
private void init()
{
this.appendChild(pnlLogin);
this.setStyle("background-color: transparent");
}
private void initComponents() private void initComponents()
{ {
pnlLogin = new LoginPanel(ctx, this); pnlLogin = new LoginPanel(ctx, this);

View File

@ -38,6 +38,7 @@ import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.panel.StatusBarPanel; import org.adempiere.webui.panel.StatusBarPanel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.DataStatusEvent; import org.compiere.model.DataStatusEvent;
import org.compiere.model.DataStatusListener; import org.compiere.model.DataStatusListener;
import org.compiere.model.GridField; import org.compiere.model.GridField;
@ -195,13 +196,13 @@ public final class WAccountDialog extends Window
toolBar.setOrient("vertical"); toolBar.setOrient("vertical");
toolBar.setStyle("border: none; margin: 5px"); toolBar.setStyle("border: none; margin: 5px");
bSave.setImage("images/Save24.png"); bSave.setImage(ThemeManager.getThemeResource("images/Save24.png"));
bSave.setTooltiptext(Msg.getMsg(Env.getCtx(),"AccountNewUpdate")); bSave.setTooltiptext(Msg.getMsg(Env.getCtx(),"AccountNewUpdate"));
bSave.addEventListener(Events.ON_CLICK, this); bSave.addEventListener(Events.ON_CLICK, this);
bRefresh.setImage("images/Refresh24.png"); bRefresh.setImage(ThemeManager.getThemeResource("images/Refresh24.png"));
bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(),"Refresh")); bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(),"Refresh"));
bRefresh.addEventListener(Events.ON_CLICK, this); bRefresh.addEventListener(Events.ON_CLICK, this);
bIgnore.setImage("images/Ignore24.png"); bIgnore.setImage(ThemeManager.getThemeResource("images/Ignore24.png"));
bIgnore.setTooltiptext(Msg.getMsg(Env.getCtx(),"Ignore")); bIgnore.setTooltiptext(Msg.getMsg(Env.getCtx(),"Ignore"));
bIgnore.addEventListener(Events.ON_CLICK, this); bIgnore.addEventListener(Events.ON_CLICK, this);
// //

View File

@ -42,6 +42,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.editor.WSearchEditor; import org.adempiere.webui.editor.WSearchEditor;
import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeEvent;
import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.Lookup; import org.compiere.model.Lookup;
import org.compiere.model.MClient; import org.compiere.model.MClient;
import org.compiere.model.MLookupFactory; import org.compiere.model.MLookupFactory;
@ -311,7 +312,7 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
Div southDiv = new Div(); Div southDiv = new Div();
Button btn = new Button(); Button btn = new Button();
btn.setImage("/images/Attachment24.png"); btn.setImage(ThemeManager.getThemeResource("images/Attachment24.png"));
btn.setUpload("true"); btn.setUpload("true");
btn.addEventListener(Events.ON_UPLOAD, this); btn.addEventListener(Events.ON_UPLOAD, this);
btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Attachment")); btn.setTooltiptext(Msg.getMsg(Env.getCtx(), "Attachment"));

View File

@ -30,6 +30,7 @@ import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.component.SimpleListModel;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.editor.WEditorPopupMenu; import org.adempiere.webui.editor.WEditorPopupMenu;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MChangeLog; import org.compiere.model.MChangeLog;
import org.compiere.model.MColumn; import org.compiere.model.MColumn;
@ -370,7 +371,7 @@ public class WFieldRecordInfo extends Window implements EventListener<Event>
public static void addMenu(WEditorPopupMenu popupMenu) { public static void addMenu(WEditorPopupMenu popupMenu) {
Menuitem changeLogItem = new Menuitem(); Menuitem changeLogItem = new Menuitem();
changeLogItem.setLabel(Msg.getElement(Env.getCtx(), "AD_ChangeLog_ID")); changeLogItem.setLabel(Msg.getElement(Env.getCtx(), "AD_ChangeLog_ID"));
changeLogItem.setImage("/images/ChangeLog16.png"); changeLogItem.setImage(ThemeManager.getThemeResource("images/ChangeLog16.png"));
changeLogItem.setAttribute(WEditorPopupMenu.EVENT_ATTRIBUTE, WEditorPopupMenu.CHANGE_LOG_EVENT); changeLogItem.setAttribute(WEditorPopupMenu.EVENT_ATTRIBUTE, WEditorPopupMenu.CHANGE_LOG_EVENT);
changeLogItem.addEventListener(Events.ON_CLICK, popupMenu); changeLogItem.addEventListener(Events.ON_CLICK, popupMenu);

View File

@ -36,6 +36,7 @@ import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Row;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MBPartnerLocation; import org.compiere.model.MBPartnerLocation;
import org.compiere.model.MCountry; import org.compiere.model.MCountry;
@ -243,10 +244,10 @@ public class WLocationDialog extends Window implements EventListener<Event>
lstCountry.setRows(0); lstCountry.setRows(0);
btnOk = new Button(); btnOk = new Button();
btnOk.setImage("/images/Ok16.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK,this); btnOk.addEventListener(Events.ON_CLICK,this);
btnCancel = new Button(); btnCancel = new Button();
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK,this); btnCancel.addEventListener(Events.ON_CLICK,this);
toLink = new Button(TO_LINK); toLink = new Button(TO_LINK);

View File

@ -34,6 +34,7 @@ import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MLocator; import org.compiere.model.MLocator;
import org.compiere.model.MLocatorLookup; import org.compiere.model.MLocatorLookup;
import org.compiere.model.MRole; import org.compiere.model.MRole;
@ -258,10 +259,10 @@ public class WLocatorDialog extends Window implements EventListener<Event>
boxButtons.setStyle("padding: 5px;"); boxButtons.setStyle("padding: 5px;");
boxButtons.setPack("end"); boxButtons.setPack("end");
btnOk.setImage("/images/Ok16.png"); btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png"));
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
btnCancel.setImage("/images/Cancel16.png"); btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK, this); btnCancel.addEventListener(Events.ON_CLICK, this);
boxButtons.appendChild(btnOk); boxButtons.appendChild(btnOk);

View File

@ -25,6 +25,7 @@ import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.component.ZkCssHelper; import org.adempiere.webui.component.ZkCssHelper;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -143,16 +144,16 @@ public class WMediaDialog extends Window implements EventListener<Event>
bSave.setEnabled(false); bSave.setEnabled(false);
bSave.setImage("/images/Export24.png"); bSave.setImage(ThemeManager.getThemeResource("images/Export24.png"));
bSave.setTooltiptext(Msg.getMsg(Env.getCtx(), "AttachmentSave")); bSave.setTooltiptext(Msg.getMsg(Env.getCtx(), "AttachmentSave"));
bSave.addEventListener(Events.ON_CLICK, this); bSave.addEventListener(Events.ON_CLICK, this);
bLoad.setImage("/images/Import24.png"); bLoad.setImage(ThemeManager.getThemeResource("images/Import24.png"));
bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load")); bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load"));
bLoad.addEventListener(Events.ON_UPLOAD, this); bLoad.addEventListener(Events.ON_UPLOAD, this);
bLoad.setUpload("true"); bLoad.setUpload("true");
bDelete.setImage("/images/Delete24.png"); bDelete.setImage(ThemeManager.getThemeResource("images/Delete24.png"));
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete")); bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
bDelete.addEventListener(Events.ON_CLICK, this); bDelete.addEventListener(Events.ON_CLICK, this);
@ -173,10 +174,10 @@ public class WMediaDialog extends Window implements EventListener<Event>
southPane.appendChild(confirmPanel); southPane.appendChild(confirmPanel);
southPane.setHeight("30px"); southPane.setHeight("30px");
bOk.setImage("/images/Ok24.png"); bOk.setImage(ThemeManager.getThemeResource("images/Ok24.png"));
bOk.addEventListener(Events.ON_CLICK, this); bOk.addEventListener(Events.ON_CLICK, this);
bCancel.setImage("/images/Cancel24.png"); bCancel.setImage(ThemeManager.getThemeResource("images/Cancel24.png"));
bCancel.addEventListener(Events.ON_CLICK, this); bCancel.addEventListener(Events.ON_CLICK, this);
confirmPanel.appendChild(bOk); confirmPanel.appendChild(bOk);

View File

@ -41,6 +41,7 @@ import org.adempiere.webui.component.Textbox;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.event.DialogEvents;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MAttribute; import org.compiere.model.MAttribute;
import org.compiere.model.MAttributeInstance; import org.compiere.model.MAttributeInstance;
import org.compiere.model.MAttributeSet; import org.compiere.model.MAttributeSet;
@ -326,7 +327,7 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
cbNewEdit.addEventListener(Events.ON_CHECK, this); cbNewEdit.addEventListener(Events.ON_CHECK, this);
row.appendChild(cbNewEdit); row.appendChild(cbNewEdit);
bSelect.setLabel(Msg.getMsg(Env.getCtx(), "SelectExisting")); bSelect.setLabel(Msg.getMsg(Env.getCtx(), "SelectExisting"));
bSelect.setImage("images/PAttribute16.png"); bSelect.setImage(ThemeManager.getThemeResource("images/PAttribute16.png"));
bSelect.addEventListener(Events.ON_CLICK, this); bSelect.addEventListener(Events.ON_CLICK, this);
row.appendChild(bSelect); row.appendChild(bSelect);
rows.appendChild(row); rows.appendChild(row);
@ -400,7 +401,7 @@ public class WPAttributeDialog extends Window implements EventListener<Event>
} }
// Popup // Popup
// fieldLot.addMouseListener(new VPAttributeDialog_mouseAdapter(this)); // popup // fieldLot.addMouseListener(new VPAttributeDialog_mouseAdapter(this)); // popup
mZoom = new Menuitem(Msg.getMsg(Env.getCtx(), "Zoom"), "images/Zoom16.png"); mZoom = new Menuitem(Msg.getMsg(Env.getCtx(), "Zoom"), ThemeManager.getThemeResource("images/Zoom16.png"));
mZoom.addEventListener(Events.ON_CLICK, this); mZoom.addEventListener(Events.ON_CLICK, this);
popupMenu.appendChild(mZoom); popupMenu.appendChild(mZoom);
this.appendChild(popupMenu); this.appendChild(popupMenu);

View File

@ -17,6 +17,7 @@ import org.adempiere.webui.component.ToolBar;
import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.editor.WYesNoEditor; import org.adempiere.webui.editor.WYesNoEditor;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.UserPreference; import org.adempiere.webui.util.UserPreference;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg; import org.compiere.util.Msg;
@ -98,7 +99,7 @@ public class WPreference extends Popup implements EventListener<Event> {
this.appendChild(toolbar); this.appendChild(toolbar);
ToolBarButton btn = new ToolBarButton(""); ToolBarButton btn = new ToolBarButton("");
btn.setName("btnSave"); btn.setName("btnSave");
btn.setImage("/images/Save24.png"); btn.setImage(ThemeManager.getThemeResource("images/Save24.png"));
btn.setTooltiptext(Msg.getMsg(Env.getCtx(),"Save")); btn.setTooltiptext(Msg.getMsg(Env.getCtx(),"Save"));
btn.addEventListener(Events.ON_CLICK, this); btn.addEventListener(Events.ON_CLICK, this);
toolbar.appendChild(btn); toolbar.appendChild(btn);

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Row;
import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Rows;
import org.adempiere.webui.component.Window; import org.adempiere.webui.component.Window;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.MRecordAccess; import org.compiere.model.MRecordAccess;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
@ -150,13 +151,13 @@ public class WRecordAccessDialog extends Window implements EventListener<Event>
*/ */
private void jbInit() throws Exception private void jbInit() throws Exception
{ {
bDelete.setImage("/images/Delete16.png"); bDelete.setImage(ThemeManager.getThemeResource("images/Delete16.png"));
bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete")); bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete"));
bNew.setImage("/images/New16.png"); bNew.setImage(ThemeManager.getThemeResource("images/New16.png"));
bNew.setTooltiptext(Msg.getMsg(Env.getCtx(), "New")); bNew.setTooltiptext(Msg.getMsg(Env.getCtx(), "New"));
bUp.setImage("/images/Previous16.png"); bUp.setImage(ThemeManager.getThemeResource("images/Previous16.png"));
bUp.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous")); bUp.setTooltiptext(Msg.getMsg(Env.getCtx(), "Previous"));
bDown.setImage("/images/Next16.png"); bDown.setImage(ThemeManager.getThemeResource("images/Next16.png"));
bDown.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next")); bDown.setTooltiptext(Msg.getMsg(Env.getCtx(), "Next"));
cbActive.setText(Msg.translate(Env.getCtx(), "IsActive")); cbActive.setText(Msg.translate(Env.getCtx(), "IsActive"));

View File

@ -52,6 +52,7 @@ import org.adempiere.webui.panel.ITabOnCloseHandler;
import org.adempiere.webui.panel.StatusBarPanel; import org.adempiere.webui.panel.StatusBarPanel;
import org.adempiere.webui.report.HTMLExtension; import org.adempiere.webui.report.HTMLExtension;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MArchive; import org.compiere.model.MArchive;
import org.compiere.model.MClient; import org.compiere.model.MClient;
@ -276,7 +277,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.appendChild(new Separator("vertical")); toolBar.appendChild(new Separator("vertical"));
bCustomize.setName("Customize"); bCustomize.setName("Customize");
bCustomize.setImage("/images/Preference24.png"); bCustomize.setImage(ThemeManager.getThemeResource("images/Preference24.png"));
bCustomize.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "PrintCustomize"))); bCustomize.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "PrintCustomize")));
toolBar.appendChild(bCustomize); toolBar.appendChild(bCustomize);
bCustomize.addEventListener(Events.ON_CLICK, this); bCustomize.addEventListener(Events.ON_CLICK, this);
@ -284,7 +285,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
bFind.setName("Find"); bFind.setName("Find");
bFind.setImage("/images/Find24.png"); bFind.setImage(ThemeManager.getThemeResource("images/Find24.png"));
bFind.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Find"))); bFind.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Find")));
toolBar.appendChild(bFind); toolBar.appendChild(bFind);
bFind.addEventListener(Events.ON_CLICK, this); bFind.addEventListener(Events.ON_CLICK, this);
@ -292,13 +293,13 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.appendChild(new Separator("vertical")); toolBar.appendChild(new Separator("vertical"));
bSendMail.setName("SendMail"); bSendMail.setName("SendMail");
bSendMail.setImage("/images/SendMail24.png"); bSendMail.setImage(ThemeManager.getThemeResource("images/SendMail24.png"));
bSendMail.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "SendMail"))); bSendMail.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "SendMail")));
toolBar.appendChild(bSendMail); toolBar.appendChild(bSendMail);
bSendMail.addEventListener(Events.ON_CLICK, this); bSendMail.addEventListener(Events.ON_CLICK, this);
bArchive.setName("Archive"); bArchive.setName("Archive");
bArchive.setImage("/images/Archive24.png"); bArchive.setImage(ThemeManager.getThemeResource("images/Archive24.png"));
bArchive.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Archive"))); bArchive.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Archive")));
toolBar.appendChild(bArchive); toolBar.appendChild(bArchive);
bArchive.addEventListener(Events.ON_CLICK, this); bArchive.addEventListener(Events.ON_CLICK, this);
@ -306,7 +307,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
if (m_isCanExport) if (m_isCanExport)
{ {
bExport.setName("Export"); bExport.setName("Export");
bExport.setImage("/images/ExportX24.png"); bExport.setImage(ThemeManager.getThemeResource("images/Export24.png"));
bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export"))); bExport.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Export")));
toolBar.appendChild(bExport); toolBar.appendChild(bExport);
bExport.addEventListener(Events.ON_CLICK, this); bExport.addEventListener(Events.ON_CLICK, this);
@ -315,12 +316,12 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
toolBar.appendChild(new Separator("vertical")); toolBar.appendChild(new Separator("vertical"));
bRefresh.setName("Refresh"); bRefresh.setName("Refresh");
bRefresh.setImage("/images/Refresh24.png"); bRefresh.setImage(ThemeManager.getThemeResource("images/Refresh24.png"));
bRefresh.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh"))); bRefresh.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Refresh")));
toolBar.appendChild(bRefresh); toolBar.appendChild(bRefresh);
bRefresh.addEventListener(Events.ON_CLICK, this); bRefresh.addEventListener(Events.ON_CLICK, this);
bWizard.setImage("/images/Wizard24.png"); bWizard.setImage(ThemeManager.getThemeResource("images/Wizard24.png"));
bWizard.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "PrintWizard"))); bWizard.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "PrintWizard")));
toolBar.appendChild(bWizard); toolBar.appendChild(bWizard);
bWizard.addEventListener(Events.ON_CLICK, this); bWizard.addEventListener(Events.ON_CLICK, this);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

Some files were not shown because too many files have changed in this diff Show More