IDEMPIERE-724 Zk: Make iDempiere theme more easily customizable - Added css class to popup windows

This commit is contained in:
Elaine Tan 2013-06-07 19:45:04 +08:00
parent c0895ae0fc
commit 39ca003c65
11 changed files with 264 additions and 214 deletions

View File

@ -68,26 +68,28 @@ public class WPaymentFormWindow extends Window implements EventListener<Event>,
} }
this.setTitle(Msg.getMsg(Env.getCtx(), "Payment")); this.setTitle(Msg.getMsg(Env.getCtx(), "Payment"));
this.setHeight("400px"); this.setSclass("popup-dialog");
this.setWidth("500px");
this.setBorder("normal"); this.setBorder("normal");
this.setWidth("500px");
this.setShadow(true);
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
} }
private void zkInit() throws Exception { private void zkInit() throws Exception {
this.appendChild(mainPanel); this.appendChild(mainPanel);
mainPanel.appendChild(mainLayout); mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
Center center = new Center(); Center center = new Center();
center.setSclass("dialog-content");
mainLayout.appendChild(center); mainLayout.appendChild(center);
mainLayout.setHflex("1");
mainLayout.setVflex("min");
center.appendChild(centerPanel = getPanel()); center.appendChild(centerPanel = getPanel());
centerPanel.setHflex("1");
centerPanel.setVflex("1"); centerPanel.setVflex("1");
centerPanel.setHflex("1");
center.setAutoscroll(true); center.setAutoscroll(true);
// //
South south = new South(); South south = new South();
south.setStyle("border: none"); south.setSclass("dialog-footer");
mainLayout.appendChild(south); mainLayout.appendChild(south);
south.appendChild(confirmPanel); south.appendChild(confirmPanel);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);

View File

@ -218,12 +218,13 @@ public class WAttachment extends Window implements EventListener<Event>
this.setAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "attachment"); this.setAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "attachment");
this.setMaximizable(true); this.setMaximizable(true);
this.setWidth("700px"); this.setWidth("700px");
this.setHeight("88%"); this.setHeight("85%");
this.setTitle("Attachment"); this.setTitle("Attachment");
this.setClosable(true); this.setClosable(true);
this.setSizable(true); this.setSizable(true);
this.setBorder("normal"); this.setBorder("normal");
this.setSclass("popup-dialog"); this.setSclass("popup-dialog");
this.setShadow(true);
this.appendChild(mainPanel); this.appendChild(mainPanel);
mainPanel.setHeight("100%"); mainPanel.setHeight("100%");
mainPanel.setWidth("100%"); mainPanel.setWidth("100%");
@ -248,6 +249,8 @@ public class WAttachment extends Window implements EventListener<Event>
div.appendChild(toolBar); div.appendChild(toolBar);
text.setRows(3); text.setRows(3);
text.setHflex("1"); text.setHflex("1");
text.setHeight("100%");
div.appendChild(text); div.appendChild(text);
northPanel.appendChild(div); northPanel.appendChild(div);

View File

@ -122,6 +122,8 @@ public class ExportAction implements EventListener<Event>
vb.appendChild(vlayout); vb.appendChild(vlayout);
Hbox hb = new Hbox(); Hbox hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
Div div = new Div(); Div div = new Div();
div.setStyle("text-align: right;"); div.setStyle("text-align: right;");
div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType"))); div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType")));
@ -131,6 +133,8 @@ public class ExportAction implements EventListener<Event>
vlayout.appendChild(hb); vlayout.appendChild(hb);
hb = new Hbox(); hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly")); chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly"));
chkCurrentRow.setSelected(true); chkCurrentRow.setSelected(true);
hb.appendChild(chkCurrentRow); hb.appendChild(chkCurrentRow);

View File

@ -158,6 +158,8 @@ public class FileImportAction implements EventListener<Event>
vb.appendChild(vlayout); vb.appendChild(vlayout);
Hbox hb = new Hbox(); Hbox hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
Div div = new Div(); Div div = new Div();
div.setStyle("text-align: right;"); div.setStyle("text-align: right;");
div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType"))); div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType")));
@ -167,6 +169,8 @@ public class FileImportAction implements EventListener<Event>
vlayout.appendChild(hb); vlayout.appendChild(hb);
hb = new Hbox(); hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
Div div2 = new Div(); Div div2 = new Div();
div2.setStyle("text-align: right;"); div2.setStyle("text-align: right;");
div2.appendChild(new Label(Msg.getMsg(Env.getCtx(), "Charset", false))); div2.appendChild(new Label(Msg.getMsg(Env.getCtx(), "Charset", false)));
@ -179,6 +183,8 @@ public class FileImportAction implements EventListener<Event>
vlayout.appendChild(hb); vlayout.appendChild(hb);
hb = new Hbox(); hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
Div div3 = new Div(); Div div3 = new Div();
div3.setStyle("text-align: right;"); div3.setStyle("text-align: right;");
div3.appendChild(new Label(Msg.getMsg(Env.getCtx(), "import.mode", true))); div3.appendChild(new Label(Msg.getMsg(Env.getCtx(), "import.mode", true)));
@ -191,9 +197,12 @@ public class FileImportAction implements EventListener<Event>
vlayout.appendChild(hb); vlayout.appendChild(hb);
hb = new Hbox(); hb = new Hbox();
hb.setAlign("center");
hb.setPack("start");
bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile")); bFile.setLabel(Msg.getMsg(Env.getCtx(), "FileImportFile"));
bFile.setTooltiptext(Msg.getMsg(Env.getCtx(), "FileImportFileInfo")); bFile.setTooltiptext(Msg.getMsg(Env.getCtx(), "FileImportFileInfo"));
bFile.setUpload(AdempiereWebUI.getUploadSetting()); bFile.setUpload(AdempiereWebUI.getUploadSetting());
LayoutUtils.addSclass("txt-btn", bFile);
bFile.addEventListener(Events.ON_UPLOAD, this); bFile.addEventListener(Events.ON_UPLOAD, this);
hb.appendChild(bFile); hb.appendChild(bFile);
vlayout.appendChild(hb); vlayout.appendChild(hb);

View File

@ -125,7 +125,7 @@ public class ReportAction implements EventListener<Event>
{ {
chkExport.setLabel(Msg.getMsg(Env.getCtx(), "Export")); chkExport.setLabel(Msg.getMsg(Env.getCtx(), "Export"));
chkExport.setSelected(false); chkExport.setSelected(false);
} }
chkAllColumns.setLabel(Msg.getMsg(Env.getCtx(), "AllColumns")); chkAllColumns.setLabel(Msg.getMsg(Env.getCtx(), "AllColumns"));
chkAllColumns.setSelected(false); chkAllColumns.setSelected(false);
@ -145,6 +145,7 @@ public class ReportAction implements EventListener<Event>
Hbox hb = new Hbox(); Hbox hb = new Hbox();
hb.setAlign("center"); hb.setAlign("center");
hb.setPack("start");
Div div = new Div(); Div div = new Div();
div.appendChild(new Label(Msg.translate(Env.getCtx(), "AD_PrintFormat_ID"))); div.appendChild(new Label(Msg.translate(Env.getCtx(), "AD_PrintFormat_ID")));
hb.appendChild(div); hb.appendChild(div);
@ -155,12 +156,11 @@ public class ReportAction implements EventListener<Event>
vb.appendChild(chkCurrentRowOnly); vb.appendChild(chkCurrentRowOnly);
if ( isCanExport ) if ( isCanExport )
{ {
hb = new Hbox(); hb = new Hbox();
hb.setAlign("center"); hb.setAlign("center");
hb.setPack("start");
hb.appendChild(chkExport); hb.appendChild(chkExport);
chkExport.addEventListener(Events.ON_CHECK, this); chkExport.addEventListener(Events.ON_CHECK, this);
hb.appendChild(cboExportType); hb.appendChild(cboExportType);
@ -168,12 +168,10 @@ public class ReportAction implements EventListener<Event>
vb.appendChild(hb); vb.appendChild(hb);
} }
vb.appendChild(chkAllColumns); vb.appendChild(chkAllColumns);
vb.appendChild(confirmPanel); vb.appendChild(confirmPanel);
LayoutUtils.addSclass("dialog-footer", confirmPanel);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
} }

View File

@ -18,6 +18,7 @@ import java.io.FileNotFoundException;
import java.util.Vector; import java.util.Vector;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Checkbox;
@ -55,12 +56,15 @@ import org.zkoss.zhtml.Textarea;
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.Center;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload; import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image; import org.zkoss.zul.Image;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.South;
import org.zkoss.zul.Space; import org.zkoss.zul.Space;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Vbox;
@ -100,18 +104,12 @@ public class AboutWindow extends Window implements EventListener<Event> {
this.setPosition("center"); this.setPosition("center");
this.setTitle(ThemeManager.getBrowserTitle()); this.setTitle(ThemeManager.getBrowserTitle());
this.setSclass("popup-dialog");
this.setClosable(true); this.setClosable(true);
this.setMaximizable(true); this.setMaximizable(true);
this.setSizable(true); this.setSizable(true);
Vbox layout = new Vbox();
layout.setWidth("100%");
layout.setParent(this);
layout.setVflex("1");
layout.setHflex("1");
tabbox = new Tabbox(); tabbox = new Tabbox();
tabbox.setParent(layout);
tabbox.setVflex("1"); tabbox.setVflex("1");
tabbox.setHflex("1"); tabbox.setHflex("1");
Tabs tabs = new Tabs(); Tabs tabs = new Tabs();
@ -150,18 +148,31 @@ public class AboutWindow extends Window implements EventListener<Event> {
tabPanel = createTrace(); tabPanel = createTrace();
tabPanel.setParent(tabPanels); tabPanel.setParent(tabPanels);
Hbox hbox = new Hbox();
hbox.setParent(layout);
hbox.setPack("end");
hbox.setWidth("100%");
hbox.setVflex("min");
Button btnOk = ButtonFactory.createNamedButton(ConfirmPanel.A_OK); Button btnOk = ButtonFactory.createNamedButton(ConfirmPanel.A_OK);
btnOk.addEventListener(Events.ON_CLICK, this); btnOk.addEventListener(Events.ON_CLICK, this);
btnOk.setParent(hbox);
Borderlayout borderlayout = new Borderlayout();
this.appendChild(borderlayout);
borderlayout.setHflex("1");
borderlayout.setVflex("1");
Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
centerPane.appendChild(tabbox);
South southPane = new South();
southPane.setStyle("text-align: right");
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(btnOk);
this.setBorder("normal"); this.setBorder("normal");
this.setWidth("500px"); this.setWidth("600px");
this.setHeight("450px"); this.setHeight("450px");
this.setShadow(true);
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
} }
private Tabpanel createTrace() { private Tabpanel createTrace() {
@ -206,6 +217,7 @@ public class AboutWindow extends Window implements EventListener<Event> {
levelLabel.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session"); levelLabel.setTooltiptext("Set trace level. Warning: this will effect all session not just the current session");
btnAdempiereLog = new Button("iDempiere Log"); btnAdempiereLog = new Button("iDempiere Log");
btnAdempiereLog.setTooltiptext("Download iDempiere log file from server"); btnAdempiereLog.setTooltiptext("Download iDempiere log file from server");
LayoutUtils.addSclass("txt-btn", btnAdempiereLog);
btnAdempiereLog.addEventListener(Events.ON_CLICK, this); btnAdempiereLog.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(new Space()); hbox.appendChild(new Space());
@ -219,6 +231,8 @@ public class AboutWindow extends Window implements EventListener<Event> {
vbox.appendChild(hbox); vbox.appendChild(hbox);
hbox = new Hbox(); hbox = new Hbox();
hbox.setAlign("center");
hbox.setPack("start");
bErrorsOnly = new Checkbox(); bErrorsOnly = new Checkbox();
bErrorsOnly.setLabel(Msg.getMsg(Env.getCtx(), "ErrorsOnly")); bErrorsOnly.setLabel(Msg.getMsg(Env.getCtx(), "ErrorsOnly"));
//default only show error //default only show error
@ -228,16 +242,17 @@ public class AboutWindow extends Window implements EventListener<Event> {
hbox.appendChild(new Space()); hbox.appendChild(new Space());
btnDownload = new Button(Msg.getMsg(Env.getCtx(), "SaveFile")); btnDownload = new Button(Msg.getMsg(Env.getCtx(), "SaveFile"));
btnDownload .setTooltiptext("Download session log"); btnDownload .setTooltiptext("Download session log");
LayoutUtils.addSclass("txt-btn", btnDownload);
btnDownload.addEventListener(Events.ON_CLICK, this); btnDownload.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btnDownload); hbox.appendChild(btnDownload);
hbox.appendChild(new Space());
btnErrorEmail = new Button(Msg.getMsg(Env.getCtx(), "SendEMail")); btnErrorEmail = new Button(Msg.getMsg(Env.getCtx(), "SendEMail"));
btnErrorEmail.setTooltiptext("Email session log"); btnErrorEmail.setTooltiptext("Email session log");
LayoutUtils.addSclass("txt-btn", btnErrorEmail);
btnErrorEmail.addEventListener(Events.ON_CLICK, this); btnErrorEmail.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btnErrorEmail); hbox.appendChild(btnErrorEmail);
hbox.appendChild(new Space());
btnViewLog = new Button(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "View"))); btnViewLog = new Button(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "View")));
btnViewLog.setTooltiptext("View session log"); btnViewLog.setTooltiptext("View session log");
LayoutUtils.addSclass("txt-btn", btnViewLog);
btnViewLog.addEventListener(Events.ON_CLICK, this); btnViewLog.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btnViewLog); hbox.appendChild(btnViewLog);
hbox.setHflex("1"); hbox.setHflex("1");

View File

@ -63,9 +63,12 @@ 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.UploadEvent; import org.zkoss.zk.ui.event.UploadEvent;
import org.zkoss.zk.ui.util.Clients; import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Cell; import org.zkoss.zul.Cell;
import org.zkoss.zul.Center;
import org.zkoss.zul.Div; import org.zkoss.zul.Div;
import org.zkoss.zul.Vlayout; import org.zkoss.zul.South;
import org.zkoss.zul.Space;
/** /**
* EMail Dialog * EMail Dialog
@ -102,12 +105,12 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
{ {
super(); super();
this.setTitle(title); this.setTitle(title);
this.setWidth("550px"); this.setSclass("popup-dialog");
this.setHeight("600px");
this.setClosable(true); this.setClosable(true);
this.setMaximizable(true);
this.setBorder("normal"); this.setBorder("normal");
this.setStyle("position:absolute; margin: 0; padding: 0;"); this.setWidth("550px");
this.setShadow(true);
this.setMaximizable(true);
commonInit(from, to, subject, message, attachment); commonInit(from, to, subject, message, attachment);
} // EmailDialog } // EmailDialog
@ -298,20 +301,14 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
row = new Row(); row = new Row();
rows.appendChild(row); rows.appendChild(row);
row.appendCellChild(fMessage, 2); row.appendChild(new Space());
row.appendChild(fMessage);
fMessage.setHflex("1"); fMessage.setHflex("1");
fMessage.setHeight("100%");
fMessage.setRows(10); fMessage.setRows(10);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
Vlayout vlayout = new Vlayout();
vlayout.setStyle("width: 99%; margin: auto; height: 100%;");
grid.setVflex("1");
vlayout.appendChild(grid);
Div southDiv = new Div();
Button btn = new Button(); Button btn = new Button();
btn.setImage(ThemeManager.getThemeResource("images/Attachment24.png")); btn.setImage(ThemeManager.getThemeResource("images/Attachment24.png"));
btn.setUpload(AdempiereWebUI.getUploadSetting()); btn.setUpload(AdempiereWebUI.getUploadSetting());
@ -320,11 +317,23 @@ public class WEMailDialog extends Window implements EventListener<Event>, ValueC
confirmPanel.addComponentsLeft(btn); confirmPanel.addComponentsLeft(btn);
confirmPanel.getButton(ConfirmPanel.A_OK).setWidgetListener("onClick", "zAu.cmd0.showBusy(null)"); confirmPanel.getButton(ConfirmPanel.A_OK).setWidgetListener("onClick", "zAu.cmd0.showBusy(null)");
southDiv.appendChild(confirmPanel); Borderlayout borderlayout = new Borderlayout();
southDiv.setVflex("min"); this.appendChild(borderlayout);
vlayout.appendChild(southDiv); borderlayout.setHflex("1");
borderlayout.setVflex("min");
this.appendChild(vlayout); Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
centerPane.appendChild(grid);
grid.setVflex("1");
grid.setHflex("1");
South southPane = new South();
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(confirmPanel);
} // render } // render
/** /**

View File

@ -20,6 +20,7 @@ import java.io.InputStream;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.AdempiereWebUI; import org.adempiere.webui.AdempiereWebUI;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.ConfirmPanel;
@ -114,21 +115,24 @@ public class WImageDialog extends Window implements EventListener<Event>
*/ */
void init() throws Exception void init() throws Exception
{ {
this.setSclass("popup-dialog");
this.setBorder("normal");
this.setWidth("450px"); this.setWidth("450px");
this.setHeight("550px"); this.setHeight("550px");
this.setShadow(true);
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
this.setSizable(true); this.setSizable(true);
mainLayout.setParent(this); mainLayout.setParent(this);
mainLayout.setWidth("100%"); mainLayout.setHflex("1");
mainLayout.setHeight("100%"); mainLayout.setVflex("1");
mainLayout.setStyle("background-color: transparent");
fileLabel.setValue(Msg.getMsg(Env.getCtx(), "SelectFile")); fileLabel.setValue(Msg.getMsg(Env.getCtx(), "SelectFile"));
fileButton.setLabel("-"); fileButton.setLabel("-");
LayoutUtils.addSclass("txt-btn", fileButton);
North north = new North(); North north = new North();
north.setParent(mainLayout); north.setParent(mainLayout);
north.setStyle("background-color: transparent");
north.appendChild(parameterPanel); north.appendChild(parameterPanel);
parameterPanel.appendChild(fileLabel); parameterPanel.appendChild(fileLabel);
@ -136,14 +140,14 @@ public class WImageDialog extends Window implements EventListener<Event>
parameterPanel.appendChild((fileButton)); parameterPanel.appendChild((fileButton));
Center center = new Center(); Center center = new Center();
center.setSclass("dialog-content");
image.setHflex("true"); image.setHflex("true");
image.setVflex("true"); image.setVflex("true");
center.setParent(mainLayout); center.setParent(mainLayout);
center.appendChild(image); center.appendChild(image);
center.setStyle("background-color: transparent");
South south = new South(); South south = new South();
south.setStyle("background-color: transparent; border: none;"); south.setSclass("dialog-footer");
south.setParent(mainLayout); south.setParent(mainLayout);
south.appendChild(confirmPanel); south.appendChild(confirmPanel);

View File

@ -26,7 +26,11 @@ import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Column;
import org.adempiere.webui.component.Columns;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
@ -36,7 +40,6 @@ 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;
@ -52,6 +55,10 @@ import org.zkoss.zk.ui.Executions;
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.Center;
import org.zkoss.zul.South;
import org.zkoss.zul.Vbox;
/** /**
* @author Sendy Yagambrum * @author Sendy Yagambrum
@ -100,8 +107,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
private Listbox lstRegion; private Listbox lstRegion;
private Listbox lstCountry; private Listbox lstCountry;
private Button btnOk; private ConfirmPanel confirmPanel;
private Button btnCancel;
private Grid mainPanel; private Grid mainPanel;
private boolean m_change = false; private boolean m_change = false;
@ -181,7 +187,8 @@ public class WLocationDialog extends Window implements EventListener<Event>
setRegion(); setRegion();
initLocation(); initLocation();
// //
this.setWidth("380px"); this.setWidth("350px");
this.setSclass("popup-dialog");
this.setClosable(true); this.setClosable(true);
this.setBorder("normal"); this.setBorder("normal");
this.setShadow(true); this.setShadow(true);
@ -243,59 +250,76 @@ public class WLocationDialog extends Window implements EventListener<Event>
lstCountry.setWidth("154px"); lstCountry.setWidth("154px");
lstCountry.setRows(0); lstCountry.setRows(0);
btnOk = new Button(); confirmPanel = new ConfirmPanel(true);
btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png")); confirmPanel.addActionListener(this);
btnOk.addEventListener(Events.ON_CLICK,this);
btnCancel = new Button();
btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png"));
btnCancel.addEventListener(Events.ON_CLICK,this);
toLink = new Button(TO_LINK); toLink = new Button(TO_LINK);
LayoutUtils.addSclass("txt-btn", toLink);
toLink.addEventListener(Events.ON_CLICK,this); toLink.addEventListener(Events.ON_CLICK,this);
toRoute = new Button(TO_ROUTE); toRoute = new Button(TO_ROUTE);
LayoutUtils.addSclass("txt-btn", toRoute);
toRoute.addEventListener(Events.ON_CLICK,this); toRoute.addEventListener(Events.ON_CLICK,this);
mainPanel = GridFactory.newGridLayout(); mainPanel = GridFactory.newGridLayout();
mainPanel.setStyle("padding:5px");
} }
private void init() private void init()
{ {
Columns columns = new Columns();
mainPanel.appendChild(columns);
Column column = new Column();
columns.appendChild(column);
column.setWidth("30%");
column = new Column();
columns.appendChild(column);
column.setWidth("70%");
Row pnlAddress1 = new Row(); Row pnlAddress1 = new Row();
pnlAddress1.appendChild(lblAddress1.rightAlign()); pnlAddress1.appendChild(lblAddress1.rightAlign());
pnlAddress1.appendChild(txtAddress1); pnlAddress1.appendChild(txtAddress1);
txtAddress1.setHflex("1");
Row pnlAddress2 = new Row(); Row pnlAddress2 = new Row();
pnlAddress2.appendChild(lblAddress2.rightAlign()); pnlAddress2.appendChild(lblAddress2.rightAlign());
pnlAddress2.appendChild(txtAddress2); pnlAddress2.appendChild(txtAddress2);
txtAddress2.setHflex("1");
Row pnlAddress3 = new Row(); Row pnlAddress3 = new Row();
pnlAddress3.appendChild(lblAddress3.rightAlign()); pnlAddress3.appendChild(lblAddress3.rightAlign());
pnlAddress3.appendChild(txtAddress3); pnlAddress3.appendChild(txtAddress3);
txtAddress3.setHflex("1");
Row pnlAddress4 = new Row(); Row pnlAddress4 = new Row();
pnlAddress4.appendChild(lblAddress4.rightAlign()); pnlAddress4.appendChild(lblAddress4.rightAlign());
pnlAddress4.appendChild(txtAddress4); pnlAddress4.appendChild(txtAddress4);
txtAddress4.setHflex("1");
Row pnlCity = new Row(); Row pnlCity = new Row();
pnlCity.appendChild(lblCity.rightAlign()); pnlCity.appendChild(lblCity.rightAlign());
pnlCity.appendChild(txtCity); pnlCity.appendChild(txtCity);
txtCity.setHflex("1");
Row pnlPostal = new Row(); Row pnlPostal = new Row();
pnlPostal.appendChild(lblPostal.rightAlign()); pnlPostal.appendChild(lblPostal.rightAlign());
pnlPostal.appendChild(txtPostal); pnlPostal.appendChild(txtPostal);
txtPostal.setHflex("1");
Row pnlPostalAdd = new Row(); Row pnlPostalAdd = new Row();
pnlPostalAdd.appendChild(lblPostalAdd.rightAlign()); pnlPostalAdd.appendChild(lblPostalAdd.rightAlign());
pnlPostalAdd.appendChild(txtPostalAdd); pnlPostalAdd.appendChild(txtPostalAdd);
txtPostalAdd.setHflex("1");
Row pnlRegion = new Row(); Row pnlRegion = new Row();
pnlRegion.appendChild(lblRegion.rightAlign()); pnlRegion.appendChild(lblRegion.rightAlign());
pnlRegion.appendChild(lstRegion); pnlRegion.appendChild(lstRegion);
lstRegion.setHflex("1");
Row pnlCountry = new Row(); Row pnlCountry = new Row();
pnlCountry.appendChild(lblCountry.rightAlign()); pnlCountry.appendChild(lblCountry.rightAlign());
pnlCountry.appendChild(lstCountry); pnlCountry.appendChild(lstCountry);
lstCountry.setHflex("1");
Panel pnlLinks = new Panel(); Panel pnlLinks = new Panel();
pnlLinks.appendChild(toLink); pnlLinks.appendChild(toLink);
@ -305,18 +329,30 @@ public class WLocationDialog extends Window implements EventListener<Event>
if (MLocation.LOCATION_MAPS_ROUTE_PREFIX == null || Env.getAD_Org_ID(Env.getCtx()) <= 0) if (MLocation.LOCATION_MAPS_ROUTE_PREFIX == null || Env.getAD_Org_ID(Env.getCtx()) <= 0)
toRoute.setVisible(false); toRoute.setVisible(false);
pnlLinks.setWidth("100%"); pnlLinks.setWidth("100%");
pnlLinks.setStyle("text-align:left"); pnlLinks.setStyle("text-align:right");
Panel pnlButton = new Panel(); Borderlayout borderlayout = new Borderlayout();
pnlButton.appendChild(btnOk); this.appendChild(borderlayout);
pnlButton.appendChild(btnCancel); borderlayout.setHflex("1");
pnlButton.setWidth("100%"); borderlayout.setVflex("min");
pnlButton.setStyle("text-align:right");
this.appendChild(mainPanel); Center centerPane = new Center();
centerPane.setSclass("dialog-content");
centerPane.setAutoscroll(true);
borderlayout.appendChild(centerPane);
Vbox vbox = new Vbox();
centerPane.appendChild(vbox);
vbox.appendChild(mainPanel);
if (MLocation.LOCATION_MAPS_URL_PREFIX != null || MLocation.LOCATION_MAPS_ROUTE_PREFIX != null) if (MLocation.LOCATION_MAPS_URL_PREFIX != null || MLocation.LOCATION_MAPS_ROUTE_PREFIX != null)
this.appendChild(pnlLinks); vbox.appendChild(pnlLinks);
this.appendChild(pnlButton); vbox.setVflex("1");
vbox.setHflex("1");
South southPane = new South();
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(confirmPanel);
} }
/** /**
* Dynamically add fields to the Location dialog box * Dynamically add fields to the Location dialog box
@ -504,7 +540,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
public void onEvent(Event event) throws Exception public void onEvent(Event event) throws Exception
{ {
if (btnOk.equals(event.getTarget())) if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_OK))
{ {
inOKAction = true; inOKAction = true;
@ -534,7 +570,7 @@ public class WLocationDialog extends Window implements EventListener<Event>
} }
inOKAction = false; inOKAction = false;
} }
else if (btnCancel.equals(event.getTarget())) else if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_CANCEL))
{ {
m_change = false; m_change = false;
this.dispose(); this.dispose();

View File

@ -27,14 +27,19 @@ import java.sql.SQLException;
import java.util.logging.Level; import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.Column;
import org.adempiere.webui.component.Columns;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Grid;
import org.adempiere.webui.component.GridFactory;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
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.Row;
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.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;
@ -46,10 +51,10 @@ import org.compiere.util.Msg;
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.Cell; import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Hbox; import org.zkoss.zul.Center;
import org.zkoss.zul.Separator; import org.zkoss.zul.South;
import org.zkoss.zul.Vbox; import org.zkoss.zul.Space;
/** /**
* Location Dialog : Based on VLocationDialog * Location Dialog : Based on VLocationDialog
@ -65,7 +70,7 @@ public class WLocatorDialog extends Window implements EventListener<Event>
*/ */
private static final long serialVersionUID = -1013647722305985723L; private static final long serialVersionUID = -1013647722305985723L;
private Vbox mainBox = new Vbox(); private Grid mainPanel = GridFactory.newGridLayout();
private Listbox lstLocator = new Listbox(); private Listbox lstLocator = new Listbox();
private Listbox lstWarehouse = new Listbox(); private Listbox lstWarehouse = new Listbox();
@ -80,13 +85,13 @@ public class WLocatorDialog extends Window implements EventListener<Event>
private Label lblLocator = new Label(); private Label lblLocator = new Label();
private Label lblWarehouse = new Label(); private Label lblWarehouse = new Label();
private Label lblWarehouse2 = new Label();
private Label lblAisleX = new Label(); private Label lblAisleX = new Label();
private Label lblBinY = new Label(); private Label lblBinY = new Label();
private Label lblLevelZ = new Label(); private Label lblLevelZ = new Label();
private Label lblKey = new Label(); private Label lblKey = new Label();
private Button btnCancel = new Button(); private ConfirmPanel confirmPanel;
private Button btnOk = new Button();
private MLocatorLookup m_mLocator; private MLocatorLookup m_mLocator;
@ -145,149 +150,110 @@ public class WLocatorDialog extends Window implements EventListener<Event>
{ {
lblLocator.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID")); lblLocator.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
lblWarehouse.setValue(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); lblWarehouse.setValue(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
lblWarehouse2.setValue(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
lblAisleX.setValue(Msg.getElement(Env.getCtx(), "X")); lblAisleX.setValue(Msg.getElement(Env.getCtx(), "X"));
lblBinY.setValue(Msg.getElement(Env.getCtx(), "Y")); lblBinY.setValue(Msg.getElement(Env.getCtx(), "Y"));
lblLevelZ.setValue(Msg.getElement(Env.getCtx(), "Z")); lblLevelZ.setValue(Msg.getElement(Env.getCtx(), "Z"));
lblKey.setValue(Msg.translate(Env.getCtx(), "Value")); lblKey.setValue(Msg.translate(Env.getCtx(), "Value"));
Hbox boxLocator = new Hbox();
boxLocator.setWidth("100%");
lstLocator.setWidth("150px"); // Elaine 2009/02/02 - fixed the locator width
lstLocator.setMold("select"); lstLocator.setMold("select");
lstLocator.setRows(0); lstLocator.setRows(0);
LayoutUtils.addSclass("z-label", lstLocator); LayoutUtils.addSclass("z-label", lstLocator);
Cell cell = new Cell();
cell.setWidth("30%");
boxLocator.appendChild(cell);
cell.appendChild(lblLocator);
cell = new Cell();
cell.setWidth("70%");
boxLocator.appendChild(cell);
cell.appendChild(lstLocator);
Hbox boxCheckbox = new Hbox();
boxCheckbox.setWidth("100%");
boxCheckbox.setPack("start");
chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew")); chkCreateNew.setLabel(Msg.getMsg(Env.getCtx(), "CreateNew"));
cell = new Cell();
cell.setWidth("100%");
boxCheckbox.appendChild(cell);
cell.appendChild(chkCreateNew);
Hbox boxWarehouse = new Hbox();
boxWarehouse.setWidth("100%");
boxWarehouse.setHflex("true");
lstWarehouse.setWidth("100px");
lstWarehouse.setMold("select"); lstWarehouse.setMold("select");
lstWarehouse.setRows(0); lstWarehouse.setRows(0);
LayoutUtils.addSclass("z-label", lstWarehouse); LayoutUtils.addSclass("z-label", lstWarehouse);
cell = new Cell(); confirmPanel = new ConfirmPanel(true);
cell.setWidth("30%"); confirmPanel.addActionListener(this);
boxWarehouse.appendChild(cell);
cell.appendChild(lblWarehouse);
lblWarehouse.setHflex("true");
cell = new Cell();
cell.setWidth("70%");
boxWarehouse.appendChild(cell);
cell.appendChild(lstWarehouse);
cell.appendChild(txtWarehouse);
Hbox boxAisle = new Hbox(); Columns columns = new Columns();
boxAisle.setWidth("100%"); mainPanel.appendChild(columns);
boxAisle.setHflex("true");
cell = new Cell(); Column column = new Column();
cell.setWidth("30%"); columns.appendChild(column);
boxAisle.appendChild(cell); column.setWidth("30%");
lblAisleX.setHflex("true");
cell.appendChild(lblAisleX);
cell = new Cell();
cell.setWidth("70%");
boxAisle.appendChild(cell);
cell.appendChild(txtAisleX);
Hbox boxBin = new Hbox(); column = new Column();
boxBin.setWidth("100%"); columns.appendChild(column);
boxBin.setHflex("true"); column.setWidth("70%");
cell = new Cell(); Rows rows = mainPanel.newRows();
cell.setWidth("30%");
boxBin.appendChild(cell);
cell.appendChild(lblBinY);
lblBinY.setHflex("true");
cell = new Cell();
cell.setWidth("70%");
boxBin.appendChild(cell);
cell.appendChild(txtBinY);
Hbox boxLevel = new Hbox(); Row row = new Row();
boxLevel.setWidth("100%"); rows.appendChild(row);
boxLevel.setHflex("true"); row.appendChild(lblLocator);
row.appendChild(lstLocator);
lstLocator.setHflex("1");
cell = new Cell(); row = new Row();
cell.setWidth("30%"); rows.appendChild(row);
boxLevel.appendChild(cell); row.appendChild(new Space());
cell.appendChild(lblLevelZ); row.appendChild(chkCreateNew);
lblLevelZ.setHflex("true");
cell = new Cell();
cell.setWidth("70%");
boxLevel.appendChild(cell);
cell.appendChild(txtLevelZ);
Hbox boxKey = new Hbox(); row = new Row();
boxKey.setWidth("100%"); rows.appendChild(row);
boxKey.setHflex("true"); row.appendChild(lblWarehouse);
row.appendChild(lstWarehouse);
lstWarehouse.setHflex("1");
cell = new Cell(); row = new Row();
cell.setWidth("30%"); rows.appendChild(row);
boxKey.appendChild(cell); row.appendChild(lblWarehouse2);
cell.appendChild(lblKey); row.appendChild(txtWarehouse);
lblKey.setHflex("true"); txtWarehouse.setHflex("1");
cell = new Cell();
cell.setWidth("70%");
boxKey.appendChild(cell);
cell.appendChild(txtKey);
Hbox boxButtons = new Hbox(); row = new Row();
boxButtons.setWidth("100%"); rows.appendChild(row);
boxButtons.setStyle("padding: 5px;"); row.appendChild(lblAisleX);
boxButtons.setPack("end"); row.appendChild(txtAisleX);
txtAisleX.setHflex("1");
btnOk.setImage(ThemeManager.getThemeResource("images/Ok16.png")); row = new Row();
btnOk.addEventListener(Events.ON_CLICK, this); rows.appendChild(row);
row.appendChild(lblBinY);
row.appendChild(txtBinY);
txtBinY.setHflex("1");
btnCancel.setImage(ThemeManager.getThemeResource("images/Cancel16.png")); row = new Row();
btnCancel.addEventListener(Events.ON_CLICK, this); rows.appendChild(row);
row.appendChild(lblLevelZ);
row.appendChild(txtLevelZ);
txtLevelZ.setHflex("1");
boxButtons.appendChild(btnOk); row = new Row();
boxButtons.appendChild(btnCancel); rows.appendChild(row);
row.appendChild(lblKey);
row.appendChild(txtKey);
txtKey.setHflex("1");
mainBox.setWidth("250px"); Borderlayout borderlayout = new Borderlayout();
mainBox.setStyle("text-align:right"); this.appendChild(borderlayout);
mainBox.appendChild(boxLocator); borderlayout.setHflex("1");
mainBox.appendChild(new Separator()); borderlayout.setVflex("min");
mainBox.appendChild(boxCheckbox);
mainBox.appendChild(new Separator()); Center centerPane = new Center();
mainBox.appendChild(boxWarehouse); centerPane.setSclass("dialog-content");
mainBox.appendChild(boxAisle); centerPane.setAutoscroll(true);
mainBox.appendChild(boxBin); borderlayout.appendChild(centerPane);
mainBox.appendChild(boxLevel); centerPane.appendChild(mainPanel);
mainBox.appendChild(boxKey); mainPanel.setVflex("1");
mainBox.appendChild(new Separator()); mainPanel.setHflex("1");
mainBox.appendChild(boxButtons);
South southPane = new South();
southPane.setSclass("dialog-footer");
borderlayout.appendChild(southPane);
southPane.appendChild(confirmPanel);
this.appendChild(mainBox);
this.setTitle(title); this.setTitle(title);
this.setSclass("popup-dialog");
this.setClosable(true); this.setClosable(true);
this.setBorder("normal"); this.setBorder("normal");
this.setWidth("260Px"); this.setWidth("260px");
this.setShadow(true); this.setShadow(true);
this.setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
this.setSizable(true); // Elaine 2009/02/02 - window set to resizable this.setSizable(true); // Elaine 2009/02/02 - window set to resizable
} }
@ -414,8 +380,10 @@ public class WLocatorDialog extends Window implements EventListener<Event>
boolean sel = chkCreateNew.isChecked(); boolean sel = chkCreateNew.isChecked();
//lblWarehouse.setVisible(sel); //lblWarehouse.setVisible(sel);
lstWarehouse.setVisible(sel); lstWarehouse.setVisible(sel);
lstWarehouse.getParent().setVisible(sel);
//lWarehouseInfo.setVisible(!sel); //lWarehouseInfo.setVisible(!sel);
txtWarehouse.setVisible(!sel); txtWarehouse.setVisible(!sel);
txtWarehouse.getParent().setVisible(!sel);
txtWarehouse.setReadonly(true); txtWarehouse.setReadonly(true);
txtAisleX.setReadonly(!sel); txtAisleX.setReadonly(!sel);
@ -423,7 +391,7 @@ public class WLocatorDialog extends Window implements EventListener<Event>
txtLevelZ.setReadonly(!sel); txtLevelZ.setReadonly(!sel);
txtKey.setReadonly(!sel); txtKey.setReadonly(!sel);
//pack(); mainPanel.invalidate();
} // enableNew } // enableNew
/** /**
@ -596,12 +564,12 @@ public class WLocatorDialog extends Window implements EventListener<Event>
if (event == null) if (event == null)
return; return;
if (event.getTarget() == btnCancel) if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_CANCEL))
{ {
m_change = false; m_change = false;
this.detach(); this.detach();
} }
else if (event.getTarget() == btnOk) else if (event.getTarget() == confirmPanel.getButton(ConfirmPanel.A_OK))
{ {
actionOK(); actionOK();
m_change = true; m_change = true;

View File

@ -830,6 +830,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
winExportFile.setHeight("150px"); winExportFile.setHeight("150px");
winExportFile.setClosable(true); winExportFile.setClosable(true);
winExportFile.setBorder("normal"); winExportFile.setBorder("normal");
winExportFile.setSclass("popup-dialog");
winExportFile.setStyle("position:absolute"); winExportFile.setStyle("position:absolute");
cboType.setMold("select"); cboType.setMold("select");
@ -846,21 +847,22 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
cboType.setSelectedItem(li); cboType.setSelectedItem(li);
Hbox hb = new Hbox(); Hbox hb = new Hbox();
hb.setSclass("dialog-content");
hb.setAlign("center");
hb.setPack("start");
Div div = new Div(); Div div = new Div();
div.setStyle("text-align: right;"); div.setStyle("text-align: right;");
div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType"))); div.appendChild(new Label(Msg.getMsg(Env.getCtx(), "FilesOfType")));
hb.appendChild(div); hb.appendChild(div);
hb.appendChild(cboType); hb.appendChild(cboType);
cboType.setWidth("100%"); cboType.setWidth("100%");
hb.setVflex("1");
hb.setStyle("margin-top: 10px");
Vbox vb = new Vbox(); Vbox vb = new Vbox();
vb.setVflex("1");
vb.setWidth("100%"); vb.setWidth("100%");
winExportFile.appendChild(vb); winExportFile.appendChild(vb);
vb.appendChild(hb); vb.appendChild(hb);
vb.appendChild(confirmPanel); vb.appendChild(confirmPanel);
LayoutUtils.addSclass("dialog-footer", confirmPanel);
confirmPanel.addActionListener(this); confirmPanel.addActionListener(this);
} }