From c4c60fc88bb9a0d4ce4f0a533ada6321f0a4725b Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 16 Jan 2013 13:17:57 +0800 Subject: [PATCH] IDEMPIERE-557 Zk: new window border and form background. Dark gray window border and light gray form background. IDEMPIERE-522 Zk: Random Freeze of screen update. Remove use of Clients.showBusy(Component,String). --- .../org/adempiere/webui/ValuePreference.java | 70 ++++++++--- .../adempiere/webui/adwindow/ADWindow.java | 5 +- .../adwindow/AbstractADWindowContent.java | 97 ++++++++------- .../webui/apps/ProcessModalDialog.java | 4 +- .../adempiere/webui/component/NumberBox.java | 5 +- .../adempiere/webui/editor/WDateEditor.java | 2 +- .../webui/editor/WDatetimeEditor.java | 2 +- .../webui/editor/WLocationEditor.java | 2 +- .../webui/editor/WLocatorEditor.java | 2 +- .../adempiere/webui/editor/WNumberEditor.java | 2 +- .../adempiere/webui/editor/WSearchEditor.java | 2 +- .../adempiere/webui/editor/WStringEditor.java | 2 +- .../webui/editor/WTableDirEditor.java | 2 +- .../adempiere/webui/editor/WTimeEditor.java | 2 +- .../adempiere/webui/editor/WUrlEditor.java | 2 +- .../adempiere/webui/editor/WYesNoEditor.java | 2 +- .../adempiere/webui/panel/WAttachment.java | 9 ++ .../webui/panel/action/ExportAction.java | 7 +- .../webui/panel/action/FileImportAction.java | 7 +- .../theme/default/css/theme.css.dsp | 112 +++++++++++++++++- 20 files changed, 252 insertions(+), 86 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java index ba45d4e829..02986f5ae4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java @@ -19,6 +19,8 @@ package org.adempiere.webui; import java.util.Properties; import java.util.logging.Level; +import org.adempiere.webui.adwindow.ADWindow; +import org.adempiere.webui.adwindow.AbstractADWindowContent; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; @@ -30,6 +32,7 @@ import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; +import org.adempiere.webui.component.ZkCssHelper; import org.adempiere.webui.window.FDialog; import org.compiere.model.GridField; import org.compiere.model.MRole; @@ -39,10 +42,13 @@ import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Page; 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.Div; +import org.zkoss.zul.Hlayout; import org.zkoss.zul.Separator; import org.zkoss.zul.Space; import org.zkoss.zul.Vbox; @@ -67,9 +73,9 @@ public class ValuePreference extends Window implements EventListener * @param aValue value * @return ValuePreference or null */ - public static void start (GridField mField, Object aValue) + public static void start (Component ref, GridField mField, Object aValue) { - start (mField, aValue, null); + start (ref, mField, aValue, null); } // start /** @@ -79,7 +85,7 @@ public class ValuePreference extends Window implements EventListener * @param aDisplayValue display value * @return ValuePreference or null */ - public static void start (GridField mField, Object aValue, String aDisplayValue) + public static void start (Component ref, GridField mField, Object aValue, String aDisplayValue) { if (!mField.isEditable(false)) { @@ -116,7 +122,7 @@ public class ValuePreference extends Window implements EventListener ValuePreference vp = new ValuePreference (WindowNo, AD_Client_ID, AD_Org_ID, AD_User_ID, AD_Window_ID, Attribute, DisplayAttribute, Value, DisplayValue, - displayType, AD_Reference_ID); + displayType, AD_Reference_ID, ref); } // create /** @@ -157,6 +163,7 @@ public class ValuePreference extends Window implements EventListener //private static String ICON_URL = "images/VPreference16.png"; /** Logger */ private static CLogger log = CLogger.getCLogger(ValuePreference.class); + private AbstractADWindowContent adwindowContent; /** * Constructor @@ -172,11 +179,12 @@ public class ValuePreference extends Window implements EventListener * @param DisplayValue value display * @param displayType display type * @param AD_Reference_ID reference + * @param ref */ public ValuePreference (int WindowNo, int AD_Client_ID, int AD_Org_ID, int AD_User_ID, int AD_Window_ID, String Attribute, String DisplayAttribute, String Value, String DisplayValue, - int displayType, int AD_Reference_ID) + int displayType, int AD_Reference_ID, Component ref) { super(); this.setTitle(Msg.getMsg(Env.getCtx(), NAME) + " " + DisplayAttribute); @@ -210,9 +218,29 @@ public class ValuePreference extends Window implements EventListener } this.setClosable(true); - AEnv.showCenterScreen(this); + adwindowContent = findADWindowContent(ref); + if (adwindowContent != null) { + adwindowContent.showBusyMask(); + ZkCssHelper.appendStyle(this, "position: absolute;"); + adwindowContent.getComponent().getParent().appendChild(this); + LayoutUtils.openOverlappedWindow(ref, this, "after_start"); + } else { + AEnv.showCenterScreen(this); + } } // ValuePreference + private AbstractADWindowContent findADWindowContent(Component ref) { + Component parent = ref.getParent(); + while(parent != null) { + if (parent.getAttribute(ADWindow.AD_WINDOW_ATTRIBUTE_KEY) != null) { + ADWindow adwindow = (ADWindow) parent.getAttribute(ADWindow.AD_WINDOW_ATTRIBUTE_KEY); + return adwindow.getADWindowContent(); + } + parent = parent.getParent(); + } + return null; + } + private Properties m_ctx; private int m_WindowNo; private int m_AD_Client_ID; @@ -263,6 +291,7 @@ public class ValuePreference extends Window implements EventListener cbWindow.setChecked(true); // setPanel.appendChild(setLayout); + setPanel.setHflex("1"); fAttribute.setReadonly(true); fValue.setReadonly(true); @@ -270,6 +299,7 @@ public class ValuePreference extends Window implements EventListener box.setWidth("100%"); box.setHeight("100%"); box.setParent(this); + box.setHflex("1"); box.appendChild(setPanel); Rows rows = new Rows(); @@ -281,7 +311,7 @@ public class ValuePreference extends Window implements EventListener div.appendChild(lAttribute); row.appendCellChild(div, 1); row.appendCellChild(fAttribute, 4); - fAttribute.setWidth("100%"); + fAttribute.setWidth("96%"); row.appendCellChild(lAttributeValue, 1); rows.appendChild(row); @@ -291,7 +321,7 @@ public class ValuePreference extends Window implements EventListener div.appendChild(lValue); row.appendCellChild(div, 1); row.appendCellChild(fValue, 4); - fValue.setWidth("100%"); + fValue.setWidth("96%"); row.appendCellChild(lValueValue, 1); rows.appendChild(row); @@ -300,10 +330,13 @@ public class ValuePreference extends Window implements EventListener div.setStyle("text-align: right"); div.appendChild(lSetFor); row.appendChild(div); - row.appendChild(cbClient); - row.appendChild(cbOrg); - row.appendChild(cbUser); - row.appendChild(cbWindow); + Hlayout chlayout = new Hlayout(); + chlayout.setSpacing("5px"); + chlayout.appendChild(cbClient); + chlayout.appendChild(cbOrg); + chlayout.appendChild(cbUser); + chlayout.appendChild(cbWindow); + row.appendCellChild(chlayout, 4); rows.appendChild(row); row = new Row(); @@ -313,8 +346,7 @@ public class ValuePreference extends Window implements EventListener // Separator separator = new Separator(); - separator.setBar(true); - separator.setHeight("20px"); + separator.setHeight("10px"); box.appendChild(separator); box.appendChild(confirmPanel); @@ -322,6 +354,8 @@ public class ValuePreference extends Window implements EventListener setLayout.makeNoStrip(); setLayout.setOddRowSclass("even"); + this.setWidth("500px"); + this.setSizable(true); } // jbInit /** @@ -533,5 +567,13 @@ public class ValuePreference extends Window implements EventListener } // insert + @Override + public void onPageDetached(Page page) { + super.onPageDetached(page); + if (adwindowContent != null) { + adwindowContent.hideBusyMask(); + } + } + } // ValuePreference diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java index b20681883a..c6303ceca6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindow.java @@ -37,7 +37,8 @@ import org.zkoss.zk.ui.Component; */ public class ADWindow extends AbstractUIPart { - private ADWindowContent windowContent; + public static final String AD_WINDOW_ATTRIBUTE_KEY = "org.adempiere.webui.adwindow"; + private ADWindowContent windowContent; private Properties ctx; private int adWindowId; private String _title; @@ -104,7 +105,7 @@ public class ADWindow extends AbstractUIPart protected Component doCreatePart(Component parent) { windowPanelComponent = windowContent.createPart(parent); - windowPanelComponent.setAttribute("ADWindow", this); + windowPanelComponent.setAttribute(AD_WINDOW_ATTRIBUTE_KEY, this); windowPanelComponent.setAttribute(IDesktop.WINDOWNO_ATTRIBUTE, windowNo); if (windowContent.initPanel(query)) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index a24a9d9be4..a11194cb58 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -45,9 +45,11 @@ import org.adempiere.webui.apps.ProcessModalDialog; import org.adempiere.webui.apps.form.WCreateFromFactory; import org.adempiere.webui.apps.form.WCreateFromWindow; import org.adempiere.webui.apps.form.WPayment; +import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.ProcessInfoDialog; import org.adempiere.webui.component.Window; +import org.adempiere.webui.component.ZkCssHelper; import org.adempiere.webui.editor.IProcessButton; import org.adempiere.webui.editor.WButtonEditor; import org.adempiere.webui.editor.WEditor; @@ -104,7 +106,6 @@ import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.sys.ExecutionCtrl; import org.zkoss.zk.ui.util.Clients; -import org.zkoss.zul.Button; import org.zkoss.zul.Column; import org.zkoss.zul.Columns; import org.zkoss.zul.Div; @@ -648,6 +649,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements findWindow = new FindWindow(curWindowNo, mTab.getName(), mTab.getAD_Table_ID(), mTab.getTableName(), where.toString(), findFields, 10, mTab.getAD_Tab_ID()); // no query below 10 + setupEmbeddedFindwindow(); if (findWindow.initialize()) { findWindow.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @@ -668,12 +670,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } } }); - setupEmbeddedFindwindow(); getComponent().addEventListener("onInitialQuery", new EventListener() { @Override public void onEvent(Event event) throws Exception { getComponent().getParent().appendChild(findWindow); - LayoutUtils.openEmbeddedWindow(getComponent(), findWindow, "overlap"); + LayoutUtils.openEmbeddedWindow(getComponent().getParent(), findWindow, "overlap"); } }); Events.echoEvent("onInitialQuery", getComponent(), null); @@ -692,9 +693,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements private void setupEmbeddedFindwindow() { findWindow.setTitle(null); findWindow.setBorder("none"); - findWindow.setStyle("position: absolute; border-bottom: 1px solid #c5c5c5; padding: 2px; background-color: #fff;"); + findWindow.setStyle("position: absolute; border-bottom: 2px solid #484848; padding: 2px; background-color: #fff;"); findWindow.setWidth("100%"); + findWindow.setHeight("60%"); findWindow.setZindex(1000); + findWindow.setSizable(false); findWindow.setContentStyle("background-color: #fff; width: 99%; margin: auto;"); } @@ -885,12 +888,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); + hideBusyMask(); } }); + showBusyMask(); getComponent().getParent().appendChild(win); - Clients.showBusy(getComponent().getParent(), " "); LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center"); } @@ -924,14 +926,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements chat.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { + hideBusyMask(); toolbar.getButton("Chat").setPressed(adTabbox.getSelectedGridTab().hasChat()); - focusToActivePanel(); - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); + focusToActivePanel(); } }); - getComponent().getParent().appendChild(chat); - Clients.showBusy(getComponent().getParent(), " "); + showBusyMask(); + getComponent().getParent().appendChild(chat); LayoutUtils.openOverlappedWindow(getComponent(), chat, "middle_center"); chat.showWindow(); } @@ -1000,7 +1001,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } else if (event.getTarget() instanceof ProcessModalDialog) { - Clients.clearBusy(getComponent().getParent()); + hideBusyMask(); ProcessModalDialog dialog = (ProcessModalDialog) event.getTarget(); onModalClose(dialog.getProcessInfo()); String s = breadCrumb.getStatusLine(); @@ -1008,7 +1009,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements ProcessInfoLog[] logs = breadCrumb.getPLogs(); onRefresh(true, false); breadCrumb.setStatusLine(s, b, logs); - getComponent().invalidate(); } else if (ADTabpanel.ON_DYNAMIC_DISPLAY_EVENT.equals(event.getName())) { @@ -1601,6 +1601,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements findWindow.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { + hideBusyMask(); if (!findWindow.isCancel()) { MQuery query = findWindow.getQuery(); @@ -1626,8 +1627,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } }); } - findWindow.setTitle(null); - getComponent().getParent().insertBefore(findWindow, getComponent().getParent().getFirstChild()); + + showBusyMask(); + getComponent().getParent().appendChild(findWindow); LayoutUtils.openEmbeddedWindow(toolbar, findWindow, "after_start"); } @@ -1898,6 +1900,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements messagePanel.setTitle(Msg.getMsg(Env.getCtx(), "Find").replaceAll("&", "") + ": " + title); messagePanel.setClosable(true); messagePanel.setSizable(true); + messagePanel.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "deleteSelection"); final Listbox listbox = new Listbox(); listbox.setHeight("400px"); @@ -2070,14 +2073,13 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements messagePanel.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) throws Exception { + hideBusyMask(); focusToActivePanel(); - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); } }); + showBusyMask(); getComponent().getParent().appendChild(messagePanel); - Clients.showBusy(getComponent().getParent(), " "); LayoutUtils.openOverlappedWindow(getComponent(), messagePanel, "middle_center"); } // @@ -2109,9 +2111,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (dialog.isValid()) { dialog.setWidth("500px"); dialog.setBorder("normal"); - Clients.showBusy(getComponent().getParent(), " "); + showBusyMask(); getComponent().getParent().appendChild(dialog); LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center"); + dialog.focus(); } } } @@ -2380,8 +2383,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements final int recordIdParam = record_ID; win.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { public void onEvent(Event event) throws Exception { - hideMaskDiv(); - getComponent().invalidate(); + hideBusyMask(); if (!win.isStartProcess()) { return; } @@ -2390,11 +2392,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements executeButtonProcess(wButton, startWOasking, table_ID, recordIdParam, isProcessMandatory); } }); - getComponent().getParent().appendChild(getMaskDiv()); + showBusyMask(); getComponent().getParent().appendChild(win); - win.setContentStyle("background-color: #fff;"); - LayoutUtils.openEmbeddedWindow(getComponent(), win, "middle_center"); - win.setSclass("embedded-dialog"); + LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center"); win.focus(); return; } @@ -2409,23 +2409,27 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if(cf != null) { if(cf.isInitOK()) - { - Clients.showBusy(getComponent().getParent(), " "); + { final WCreateFromWindow window = (WCreateFromWindow) cf.getWindow(); window.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, AdempiereIdGenerator.escapeId(window.getTitle())); window.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override - public void onEvent(Event event) throws Exception { + public void onEvent(Event event) throws Exception { + hideBusyMask(); if (!window.isCancel()) { onRefresh(true, false); - } - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); + } } }); + window.setZindex(1000); + window.setMaximizable(true); + window.setSizable(true); + ZkCssHelper.appendStyle(window, "position: absolute; "); + showBusyMask(); getComponent().getParent().appendChild(window); cf.showWindow(); LayoutUtils.openOverlappedWindow(getComponent(), window, "middle_center"); + window.focus(); } return; } @@ -2514,11 +2518,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements return maskDiv; } - private void hideMaskDiv() { + public void hideBusyMask() { if (maskDiv != null && maskDiv.getParent() != null) { maskDiv.detach(); } } + + public void showBusyMask() { + getComponent().getParent().appendChild(getMaskDiv()); + } private void executeButtonProcess(final IProcessButton wButton, final boolean startWOasking, final int table_ID, final int record_ID, @@ -2579,15 +2587,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements if (mode == Mode.HIGHLIGHTED || mode == Mode.MODAL) { form.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override - public void onEvent(Event event) throws Exception { - onRefresh(true, false); - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); + public void onEvent(Event event) throws Exception { + hideBusyMask(); + onRefresh(true, false); } }); - getComponent().getParent().appendChild(form); - Clients.showBusy(getComponent().getParent(), " "); + showBusyMask(); LayoutUtils.openOverlappedWindow(getComponent(), form, "middle_center"); + form.focus(); } else { SessionManager.getAppDesktop().showWindow(form); @@ -2601,9 +2608,10 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { dialog.setWidth("500px"); dialog.setBorder("normal"); - Clients.showBusy(getComponent().getParent(), " "); + showBusyMask(); getComponent().getParent().appendChild(dialog); LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center"); + dialog.focus(); } else { @@ -2747,12 +2755,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements dialog.addEventListener(DialogEvents.ON_WINDOW_CLOSE, new EventListener() { @Override public void onEvent(Event event) throws Exception { - Clients.clearBusy(getComponent().getParent()); - getComponent().invalidate(); + hideBusyMask(); } }); - getComponent().getParent().appendChild(dialog); - Clients.showBusy(getComponent().getParent(), " "); + showBusyMask(); + getComponent().getParent().appendChild(dialog); LayoutUtils.openOverlappedWindow(this.getComponent(),dialog,"middle_center"); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java index b0a0979c38..69df5542a7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/ProcessModalDialog.java @@ -177,7 +177,7 @@ public class ProcessModalDialog extends Window implements EventListener, hbox.setStyle("margin-top: 10px"); Button btn = new Button(""); btn.setImage("/images/Ok24.png"); - LayoutUtils.addSclass("action-text-button", btn); + LayoutUtils.addSclass("action-button", btn); btn.setId("Ok"); btn.addEventListener(Events.ON_CLICK, this); hbox.appendChild(btn); @@ -185,7 +185,7 @@ public class ProcessModalDialog extends Window implements EventListener, btn = new Button(""); btn.setImage("/images/Cancel24.png"); btn.setId("Cancel"); - LayoutUtils.addSclass("action-text-button", btn); + LayoutUtils.addSclass("action-button", btn); btn.addEventListener(Events.ON_CLICK, this); hbox.appendChild(btn); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 5861ac1f48..9d6a1357ff 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -80,20 +80,19 @@ public class NumberBox extends Div decimalBox = new Decimalbox(); if (integral) decimalBox.setScale(0); - decimalBox.setStyle("display: inline;text-align:right"); + decimalBox.setStyle("display: inline-block;text-align:right"); decimalBox.setHflex("1"); hlayout.appendChild(decimalBox); btn = new Button(); btn.setImage("/images/Calculator10.png"); btn.setTabindex(-1); - btn.setHflex("min"); + btn.setHflex("0"); LayoutUtils.addSclass("editor-button", btn); hlayout.appendChild(btn); popup = getCalculatorPopup(); appendChild(popup); - LayoutUtils.addSclass("editor-button", btn); btn.setPopup(popup); btn.setStyle("text-align: center;"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java index 5236f7401c..7936188285 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDateEditor.java @@ -206,7 +206,7 @@ public class WDateEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent()) && gridField != null) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java index da81969dc5..7634edbd1a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WDatetimeEditor.java @@ -199,7 +199,7 @@ public class WDatetimeEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java index ec87df8043..1e15faa58f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocationEditor.java @@ -212,7 +212,7 @@ public class WLocationEditor extends WEditor implements EventListener, Pr else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocatorEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocatorEditor.java index f19624bc23..1de51e252e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocatorEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WLocatorEditor.java @@ -302,7 +302,7 @@ public class WLocatorEditor extends WEditor implements EventListener, Pro else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java index c1936c2fdc..7061741371 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WNumberEditor.java @@ -230,7 +230,7 @@ public class WNumberEditor extends WEditor implements ContextMenuListener if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } else if (WEditorPopupMenu.CHANGE_LOG_EVENT.equals(evt.getContextEvent())) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java index fcb81704ef..2032ee4bb4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WSearchEditor.java @@ -284,7 +284,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } else if (WEditorPopupMenu.NEW_EVENT.equals(evt.getContextEvent())) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java index e74a1ebcbe..52956b99f9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WStringEditor.java @@ -217,7 +217,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } else if (WEditorPopupMenu.EDITOR_EVENT.equals(evt.getContextEvent())) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java index 5d3c0747bb..4a5a12eece 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTableDirEditor.java @@ -474,7 +474,7 @@ ContextMenuListener, IZoomableEditor else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } else if (WEditorPopupMenu.NEW_EVENT.equals(evt.getContextEvent())) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java index c2fcbe4e4b..e7c45077a5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WTimeEditor.java @@ -199,7 +199,7 @@ public class WTimeEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start (this.getGridField(), getValue()); + ValuePreference.start (getComponent(), this.getGridField(), getValue()); return; } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java index 9a9d212d53..78babd8124 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WUrlEditor.java @@ -142,7 +142,7 @@ public class WUrlEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start(getGridField(), getValue()); + ValuePreference.start(getComponent(), getGridField(), getValue()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WYesNoEditor.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WYesNoEditor.java index 950edde606..667424fabb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WYesNoEditor.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/editor/WYesNoEditor.java @@ -166,7 +166,7 @@ public class WYesNoEditor extends WEditor implements ContextMenuListener else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent())) { if (isShowPreference()) - ValuePreference.start(getGridField(), getValue()); + ValuePreference.start(getComponent(), getGridField(), getValue()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java index 61bc845615..a1c862bfe1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WAttachment.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.logging.Level; import org.adempiere.util.Callback; +import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Label; @@ -209,6 +210,7 @@ public class WAttachment extends Window implements EventListener void staticInit() throws Exception { + this.setAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "attachment"); this.setMaximizable(true); this.setWidth("700px"); this.setHeight("600px"); @@ -243,17 +245,20 @@ public class WAttachment extends Window implements EventListener northPanel.appendChild(div); bSave.setEnabled(false); + bSave.setSclass("action-button"); bSave.setImage("/images/Export24.png"); bSave.setTooltiptext(Msg.getMsg(Env.getCtx(), "AttachmentSave")); bSave.addEventListener(Events.ON_CLICK, this); bLoad.setImage("/images/Import24.png"); + bLoad.setSclass("action-button"); bLoad.setAttribute("org.zkoss.zul.image.preload", Boolean.TRUE); bLoad.setTooltiptext(Msg.getMsg(Env.getCtx(), "Load")); bLoad.setUpload("true"); bLoad.addEventListener(Events.ON_UPLOAD, this); bDelete.setImage("/images/Delete24.png"); + bDelete.setSclass("action-button"); bDelete.setTooltiptext(Msg.getMsg(Env.getCtx(), "Delete")); bDelete.addEventListener(Events.ON_CLICK, this); @@ -274,15 +279,19 @@ public class WAttachment extends Window implements EventListener southPane.setHeight("30px"); bCancel.setImage("/images/Cancel24.png"); + bCancel.setSclass("action-button"); bCancel.addEventListener(Events.ON_CLICK, this); bOk.setImage("/images/Ok24.png"); + bOk.setSclass("action-button"); bOk.addEventListener(Events.ON_CLICK, this); bDeleteAll.setImage("/images/Delete24.png"); + bDeleteAll.setSclass("action-button"); bDeleteAll.addEventListener(Events.ON_CLICK, this); bRefresh.setImage("/images/Refresh24.png"); + bRefresh.setSclass("action-button"); bRefresh.addEventListener(Events.ON_CLICK, this); confirmPanel.appendChild(bDeleteAll); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ExportAction.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ExportAction.java index 548aaad012..0bde89a57f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ExportAction.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/ExportAction.java @@ -24,6 +24,7 @@ import java.util.Set; import org.adempiere.base.IGridTabExporter; import org.adempiere.base.Service; import org.adempiere.exceptions.AdempiereException; +import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.adwindow.AbstractADWindowContent; import org.adempiere.webui.adwindow.IADTabbox; @@ -42,7 +43,6 @@ import org.compiere.util.Msg; import org.zkoss.util.media.AMedia; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; -import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Div; import org.zkoss.zul.Filedownload; import org.zkoss.zul.Hbox; @@ -99,6 +99,7 @@ public class ExportAction implements EventListener winExportFile.setClosable(true); winExportFile.setBorder("normal"); winExportFile.setStyle("position:absolute"); + winExportFile.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "exportAction"); cboType.setMold("select"); @@ -133,7 +134,7 @@ public class ExportAction implements EventListener confirmPanel.addActionListener(this); } - Clients.showBusy(panel.getComponent().getParent(), " "); + panel.showBusyMask(); panel.getComponent().getParent().appendChild(winExportFile); LayoutUtils.openOverlappedWindow(panel.getComponent(), winExportFile, "middle_center"); winExportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this); @@ -146,7 +147,7 @@ public class ExportAction implements EventListener else if(event.getTarget().getId().equals(ConfirmPanel.A_OK)) exportFile(); else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) { - Clients.clearBusy(panel.getComponent().getParent()); + panel.hideBusyMask(); panel.getComponent().invalidate(); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/FileImportAction.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/FileImportAction.java index 30f7ae1778..404ba3fd7d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/FileImportAction.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/action/FileImportAction.java @@ -27,6 +27,7 @@ import java.util.Set; import org.adempiere.base.IGridTabImporter; import org.adempiere.base.Service; import org.adempiere.exceptions.AdempiereException; +import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.adwindow.AbstractADWindowContent; import org.adempiere.webui.adwindow.IADTabbox; @@ -51,7 +52,6 @@ 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.event.UploadEvent; -import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Div; import org.zkoss.zul.Filedownload; import org.zkoss.zul.Hbox; @@ -129,6 +129,7 @@ public class FileImportAction implements EventListener winImportFile.setClosable(true); winImportFile.setBorder("normal"); winImportFile.setStyle("position:absolute"); + winImportFile.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "importAction"); cboType.setMold("select"); @@ -172,7 +173,7 @@ public class FileImportAction implements EventListener confirmPanel.addActionListener(this); } - Clients.showBusy(panel.getComponent().getParent(), " "); + panel.showBusyMask(); panel.getComponent().getParent().appendChild(winImportFile); LayoutUtils.openOverlappedWindow(panel.getComponent(), winImportFile, "middle_center"); winImportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this); @@ -202,7 +203,7 @@ public class FileImportAction implements EventListener return; importFile(); } else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) { - Clients.clearBusy(panel.getComponent().getParent()); + panel.hideBusyMask(); panel.getComponent().invalidate(); } } diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index 99657c3591..5216abd9a7 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -211,6 +211,7 @@ html,body { } .action-button .z-button-cm img, +.action-text-button .z-button-cm img, .action-image-text-button .z-button-cm img { height: 22px; width: 22px; @@ -478,6 +479,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { } <%-- adwindow and form --%> +.adwindow-form > .z-grid-body { + background-color: #F9F9F9; +} + .adwindow-layout { position:absolute; border: none; @@ -513,6 +518,8 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { .adwindow-toolbar { border: 0px; height: 26px; + background-image: none; + background-color: #fff; } .adwindow-breadcrumb { @@ -560,7 +567,7 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { .adwindow-detailpane-tabbox { width: 99%; margin: auto; - background-color: #E4E4E4; + background-color: #D3D3D3; } .adwindow-gridview-detail { @@ -614,6 +621,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { position: absolute; } +.adtab-form-borderlayout .z-center { + background-color: #F9F9F9; +} + .row-indicator-seld { background-color: #666 !important; background-image: none !important; @@ -753,7 +764,7 @@ span.z-tree-tee, span.z-tree-last { } .editor-box .editor-button { - width: 26px; + width: 32px; padding: 0px; } @@ -1032,10 +1043,105 @@ tbody.z-grid-empty-body td { } .embedded-dialog { - background-color: #666; + position: absolute; } .embedded-dialog .z-window-embedded-header { color: #fff; font-weight: bold; } + +.z-window-overlapped-cm, .z-window-modal-cm, .z-window-highlighted-cm { + border: none; +} + +.z-window-overlapped-tl, .z-window-popup-tl, .z-window-modal-tl, .z-window-highlighted-tl, .embedded-dialog .z-window-embedded-tl +{ + border-left: 1px solid #484848; + border-right: 1px solid #484848; + border-top: 1px solid #484848; + border-top-left-radius:8px; + border-top-right-radius:8px; + margin: 0px; +} + +.z-window-overlapped-tr, .z-window-popup-tr, .z-window-modal-tr, .z-window-highlighted-tr, .embedded-dialog .z-window-embedded-tr +{ + display: none; +} + +.z-window-overlapped-tl, .z-window-popup-tl, .z-window-modal-tl, .z-window-highlighted-tl, .embedded-dialog .z-window-embedded-tl, +.z-window-overlapped-tr, .z-window-popup-tr, .z-window-modal-tr, .z-window-highlighted-tr, .embedded-dialog .z-window-embedded-tr, +.z-window-overlapped-hm, .z-window-popup-hm, .z-window-modal-hm, .z-window-highlighted-hm, .embedded-dialog .z-window-embedded-hm, +.z-window-overlapped-hl, .z-window-popup-hl, .z-window-modal-hl, .z-window-highlighted-hl, .embedded-dialog .z-window-embedded-hl, +.z-window-overlapped-hr, .z-window-popup-hr, .z-window-modal-hr, .z-window-highlighted-hr, .embedded-dialog .z-window-embedded-hr +{ + background-color: #484848; +} + +.z-window-overlapped-cl, .z-window-popup-cl, .z-window-modal-cl, .z-window-highlighted-cl, .embedded-dialog .z-window-embedded-cl +{ + padding-left: 1px; + border-left: 1px solid #c5c5c5; +} + +.z-window-overlapped-cr, .z-window-popup-cr, .z-window-modal-cr, .z-window-highlighted-cr, .embedded-dialog .z-window-embedded-cr +{ + padding-right: 1px; + border-right: 1px solid #c5c5c5; +} + +.z-window-overlapped-bl, .z-window-popup-bl, .z-window-modal-bl, .z-window-highlighted-bl, .embedded-dialog .z-window-embedded-bl +{ + border-bottom: 1px solid #c5c5c5; + border-left: 1px solid #c5c5c5; + border-right: 1px solid #c5c5c5; + background-color: #fff; + margin: 0px; + border-bottom-left-radius:8px; + border-bottom-right-radius:8px; +} + +.z-window-overlapped-br, .z-window-popup-br, .z-window-modal-br, .z-window-highlighted-br, .embedded-dialog .z-window-embedded-br +{ + display: none; +} + +.z-window-overlapped .z-window-overlapped-header, +.z-window-popup .z-window-popup-header, +.z-window-highlighted .z-window-modal-header, +.z-window-highlighted .z-window-highlighted-header +{ + color: #fff; + font-weight: bold; +} + +.z-window-overlapped-hl, .z-window-popup-hl, .z-window-modal-hl, .z-window-highlighted-hl, +.z-window-overlapped-hr, .z-window-popup-hr, .z-window-modal-hr, .z-window-highlighted-hr, +.z-window-overlapped-hm, .z-window-popup-hm, .z-window-modal-hm, .z-window-highlighted-hm, +.z-window-overlapped-cl, .z-window-popup-cl, .z-window-modal-cl, .z-window-highlighted-cl, +.z-window-overlapped-cr, .z-window-popup-cr, .z-window-modal-cr, .z-window-highlighted-cr, +.z-window-overlapped-tl, .z-window-popup-tl, .z-window-modal-tl, .z-window-highlighted-tl, +.z-window-overlapped-tr, .z-window-popup-tr, .z-window-modal-tr, .z-window-highlighted-tr, +.z-window-overlapped-bl, .z-window-popup-bl, .z-window-modal-bl, .z-window-highlighted-bl, +.z-window-overlapped-br, .z-window-popup-br, .z-window-modal-br, .z-window-highlighted-br +{ + background-image: none !important; +} + +<%-- Splitter button --%> +.z-east-splt-btn, +.z-west-splt-btn, +.z-north-splt-btn, +.z-south-splt-btn { + filter: alpha(opacity=100); <%-- IE --%> + opacity: 1.0; <%-- Moz + FF --%> +} + +.z-east-splt-btn-over, +.z-west-splt-btn-over, +.z-north-splt-btn-over, +.z-south-splt-btn-over { + -webkit-filter: brightness(-30%); + filter: brightness(-30%); +} \ No newline at end of file