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).
This commit is contained in:
Heng Sin Low 2013-01-16 13:17:57 +08:00
parent ea9830767d
commit c4c60fc88b
20 changed files with 252 additions and 86 deletions

View File

@ -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<Event>
* @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<Event>
* @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<Event>
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<Event>
//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<Event>
* @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<Event>
}
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<Event>
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<Event>
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<Event>
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<Event>
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<Event>
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<Event>
//
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<Event>
setLayout.makeNoStrip();
setLayout.setOddRowSclass("even");
this.setWidth("500px");
this.setSizable(true);
} // jbInit
/**
@ -533,5 +567,13 @@ public class ValuePreference extends Window implements EventListener<Event>
} // insert
@Override
public void onPageDetached(Page page) {
super.onPageDetached(page);
if (adwindowContent != null) {
adwindowContent.hideBusyMask();
}
}
} // ValuePreference

View File

@ -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))
{

View File

@ -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<Event>() {
@ -668,12 +670,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
}
});
setupEmbeddedFindwindow();
getComponent().addEventListener("onInitialQuery", new EventListener<Event>() {
@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<Event>() {
@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<Event>() {
@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<Event>() {
@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<Event>() {
@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<Event>() {
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<Event>() {
@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<Event>() {
@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<Event>() {
@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");
}

View File

@ -177,7 +177,7 @@ public class ProcessModalDialog extends Window implements EventListener<Event>,
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<Event>,
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);

View File

@ -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;");

View File

@ -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;
}
}

View File

@ -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());
}
}

View File

@ -212,7 +212,7 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent()))
{
if (isShowPreference())
ValuePreference.start (this.getGridField(), getValue());
ValuePreference.start (getComponent(), this.getGridField(), getValue());
}
}
}

View File

@ -302,7 +302,7 @@ public class WLocatorEditor extends WEditor implements EventListener<Event>, Pro
else if (WEditorPopupMenu.PREFERENCE_EVENT.equals(evt.getContextEvent()))
{
if (isShowPreference())
ValuePreference.start (this.getGridField(), getValue());
ValuePreference.start (getComponent(), this.getGridField(), getValue());
}
}

View File

@ -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()))

View File

@ -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()))

View File

@ -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()))

View File

@ -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()))

View File

@ -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;
}
}

View File

@ -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());
}
}

View File

@ -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());
}
}

View File

@ -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<Event>
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<Event>
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<Event>
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);

View File

@ -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<Event>
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<Event>
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<Event>
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();
}
}

View File

@ -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<Event>
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<Event>
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<Event>
return;
importFile();
} else if (event.getName().equals(DialogEvents.ON_WINDOW_CLOSE)) {
Clients.clearBusy(panel.getComponent().getParent());
panel.hideBusyMask();
panel.getComponent().invalidate();
}
}

View File

@ -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%);
}