From e1a877dd7e59c4042c019cb1fb8782473ae43eec Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 27 Mar 2019 16:00:09 -0300 Subject: [PATCH] IDEMPIERE-3936 / IDEMPIERE-1334 Msg.translate showing a warning because it wants to translate the process name when it's already translated --- .../webui/component/ConfirmPanel.java | 24 +++++++++++++++++-- .../org/adempiere/webui/info/InfoWindow.java | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ConfirmPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ConfirmPanel.java index 1e2ddf530c..43b519ca6c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ConfirmPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/ConfirmPanel.java @@ -43,7 +43,7 @@ public final class ConfirmPanel extends Div /** * */ - private static final long serialVersionUID = 3257542169107223645L; + private static final long serialVersionUID = -5522843675498634948L; /** Action String OK. */ public static final String A_OK = "Ok"; @@ -114,6 +114,17 @@ public final class ConfirmPanel extends Div return button; } + public Button createButton(String name, String image, String tooltip) + { + Button button = ButtonFactory.createButton(name, image, tooltip); + button.setId(name); + buttonMap.put(name, button); + if (!Util.isEmpty(extraButtonSClass)) + LayoutUtils.addSclass(extraButtonSClass, button); + + return button; + } + /** * create confirm panel with multiple options * @param withCancelButton with cancel @@ -263,7 +274,7 @@ public final class ConfirmPanel extends Div * @param imgName * @return */ - public Button addProcessButton (String btName, String imgName){ + public Button addButton (String btName, String imgName){ Button btProcess = createButton(btName); // replace default image with image set at info process if (m_withImage && imgName != null && imgName.trim().length() > 0) @@ -272,6 +283,15 @@ public final class ConfirmPanel extends Div return btProcess; } + public Button addProcessButton (String btName, String imgName){ + Button btProcess = createButton(btName, imgName, null); + // replace default image with image set at info process + if (m_withImage && imgName != null && imgName.trim().length() > 0) + btProcess.setImage(ThemeManager.getThemeResource("images/" + imgName)); + addComponentsCenter(btProcess); + return btProcess; + } + /** * add button to the left side of the confirm panel * @param button button diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index 7ec74dfb89..e424708d1a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -378,7 +378,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL confirmPanel.addComponentsCenter(cbbProcess); - btCbbProcess = confirmPanel.addProcessButton(Msg.getMsg(Env.getCtx(), ConfirmPanel.A_PROCESS), null); + btCbbProcess = confirmPanel.addButton(Msg.getMsg(Env.getCtx(), ConfirmPanel.A_PROCESS), null); btCbbProcess.addEventListener(Events.ON_CLICK, this); } @@ -402,7 +402,7 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL confirmPanel.appendChild(ipMenu); // init button to show menu - btMenuProcess = confirmPanel.addProcessButton("ProcessMenu", null); + btMenuProcess = confirmPanel.addButton("ProcessMenu", null); btMenuProcess.setPopup("ipMenu, before_start"); } }