use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class ConfirmPanel method init.
/**
* initialise components
*/
private void init() {
pnlBtnLeft = new Hbox();
// load from the left
pnlBtnLeft.setPack("start");
// Shrink to fit the contents
pnlBtnLeft.setHflex("min");
pnlBtnLeft.setSizedByContent(false);
ThemeUtils.addSclass("ad-confirmpanel-left", pnlBtnLeft);
pnlBtnRight = new Hbox();
// Load from the right
pnlBtnRight.setPack("end");
// Take up the rest of the space in the Confirm Panel
pnlBtnRight.setHflex("1");
pnlBtnRight.setSizedByContent(false);
ThemeUtils.addSclass("ad-confirmpanel-right", pnlBtnRight);
this.appendChild(pnlBtnLeft);
this.appendChild(pnlBtnRight);
ThemeUtils.addSclass("ad-confirmpanel", this);
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class FindWindow method addSelectionColumn.
// setValues
/**
* Add Selection Column to first Tab
* @param mField field
**/
public void addSelectionColumn(GridField mField) {
log.config(mField.getHeader());
int displayLength = mField.getDisplayLength();
if (displayLength <= 0 || displayLength > FIELDLENGTH)
mField.setDisplayLength(FIELDLENGTH);
else
displayLength = 0;
// Editor
WEditor editor = null;
Label label = null;
if (mField.isRangeLookup()) {
Hbox box = new Hbox();
editor = WebEditorFactory.getEditor(mField, false);
label = editor.getLabel();
editor.setMandatory(false);
editor.setReadWrite(true);
editor.dynamicDisplay();
Component fieldLabel = editor.getComponent();
box.appendChild(editor.getComponent());
rangeFirstEditor.add(mField.getColumnName());
// The Editor
WEditor toRangeEditor = WebEditorFactory.getEditor(mField, false);
// New Field value to be updated to editor
toRangeEditor.setMandatory(false);
toRangeEditor.setReadWrite(true);
toRangeEditor.dynamicDisplay();
//
m_sEditors2.add(toRangeEditor);
Label separator = new Label(" - ");
box.appendChild(separator);
Component fieldLabel1 = toRangeEditor.getComponent();
box.appendChild(toRangeEditor.getComponent());
if (// set it back
displayLength > 0)
mField.setDisplayLength(displayLength);
//
if (isTwoColumns) {
if (!isPair)
panel = new Row();
} else
panel = new Row();
panel.appendChild(LayoutUtils.makeRightAlign(label));
panel.appendChild(box);
contentSimpleRows.appendChild(panel);
fieldLabel.addEventListener(Events.ON_OK, this);
fieldLabel1.addEventListener(Events.ON_OK, this);
} else {
editor = WebEditorFactory.getEditor(mField, false);
label = editor.getLabel();
editor.setMandatory(false);
editor.setReadWrite(true);
editor.dynamicDisplay();
Component fieldLabel = editor.getComponent();
if (// set it back
displayLength > 0)
mField.setDisplayLength(displayLength);
//
if (isTwoColumns) {
if (!isPair)
panel = new Row();
} else
panel = new Row();
panel.appendChild(LayoutUtils.makeRightAlign(label));
panel.appendChild(fieldLabel);
contentSimpleRows.appendChild(panel);
fieldLabel.addEventListener(Events.ON_OK, this);
m_sEditors2.add(null);
}
m_sEditors.add(editor);
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class FindWindow method initSimple.
/**
* initialise lookup record tab
* @throws IOException
*
**/
private void initSimple() throws IOException {
lblDocumentNo = new Label();
lblDocumentNo.setValue(Msg.translate(Env.getCtx(), "DocumentNo").replaceAll("&", ""));
lblDescription = new Label();
lblDescription.setValue(Msg.translate(Env.getCtx(), "Description").replaceAll("&", ""));
lblName = new Label();
lblName.setValue(Msg.translate(Env.getCtx(), "Name").replaceAll("&", ""));
lblValue = new Label();
lblValue.setValue(Msg.translate(Env.getCtx(), "Value").replaceAll("&", ""));
fieldDocumentNo = new Textbox();
fieldDocumentNo.setId("fieldDocumentNo");
fieldDocumentNo.setMaxlength(40);
fieldDescription = new Textbox();
fieldDescription.setId("fieldDescription");
fieldDescription.setMaxlength(40);
fieldName = new Textbox();
fieldName.setMaxlength(40);
fieldValue = new Textbox();
fieldValue.setMaxlength(40);
// Get button from Action
WAppsAction action = new WAppsAction(ConfirmPanel.A_NEW, null, ConfirmPanel.A_NEW);
Button btnNew = action.getButton();
btnNew.setName("btnNew");
btnNew.addEventListener(Events.ON_CLICK, this);
// Get button from Action
action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
Button btnOk = action.getButton();
btnOk.setName("btnOkSimple");
btnOk.addEventListener(Events.ON_CLICK, this);
// Get from action
action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
Button btnCancel = action.getButton();
btnCancel.setName("btnCancel");
btnCancel.addEventListener(Events.ON_CLICK, this);
Panel pnlButtonRight = new Panel();
// Change to Standard button order
pnlButtonRight.appendChild(btnCancel);
pnlButtonRight.appendChild(btnOk);
pnlButtonRight.setAlign("right");
pnlButtonRight.setWidth("100%");
Panel pnlButtonLeft = new Panel();
pnlButtonLeft.appendChild(btnNew);
Hbox hboxButton = new Hbox();
hboxButton.appendChild(pnlButtonLeft);
hboxButton.appendChild(pnlButtonRight);
hboxButton.setWidth("100%");
pnlDocument = new Row();
pnlDocument.setId("pnlDocument");
pnlDocument.appendChild(LayoutUtils.makeRightAlign(lblDocumentNo));
pnlDocument.appendChild(fieldDocumentNo);
pnlDescription = new Row();
pnlDescription.appendChild(LayoutUtils.makeRightAlign(lblDescription));
pnlDescription.appendChild(fieldDescription);
pnlValue = new Row();
pnlValue.appendChild(LayoutUtils.makeRightAlign(lblValue));
pnlValue.appendChild(fieldValue);
pnlName = new Row();
pnlName.appendChild(LayoutUtils.makeRightAlign(lblName));
pnlName.appendChild(fieldName);
contentSimple = new Grid();
contentSimple.setId("contentSimple");
contentSimple.setWidth("100%");
contentSimple.makeNoStrip();
contentSimpleRows = new Rows();
contentSimple.appendChild(contentSimpleRows);
contentSimpleRows.appendChild(pnlValue);
contentSimpleRows.appendChild(pnlName);
contentSimpleRows.appendChild(pnlDocument);
contentSimpleRows.appendChild(pnlDescription);
contentSimple.setVflex(true);
Borderlayout layout = new Borderlayout();
layout.setStyle("height: 100%; width: 99%; position: relative");
winLookupRecord.appendChild(layout);
Center center = new Center();
layout.appendChild(center);
center.appendChild(contentSimple);
center.setFlex(true);
South south = new South();
layout.appendChild(south);
south.appendChild(hboxButton);
winLookupRecord.setWidth("100%");
winLookupRecord.setHeight("100%");
winLookupRecord.addEventListener(Events.ON_OK, this);
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class AboutWindow method createCredit.
private Tabpanel createCredit() {
Tabpanel tabPanel = new Tabpanel();
Vbox vbox = new Vbox();
vbox.setParent(tabPanel);
vbox.setWidth("100%");
Hbox hbox = new Hbox();
hbox.setParent(vbox);
ToolBarButton link = new ToolBarButton();
link.setImage("images/Posterita.jpg");
link.setParent(hbox);
link.setHref("http://www.posterita.org");
link.setTarget("_blank");
Label label = new Label("Contributed the initial Zk Web Client code.");
label.setParent(hbox);
Separator separator = new Separator();
separator.setParent(vbox);
Div div = new Div();
div.setParent(vbox);
div.setWidth("100%");
Label caption = new Label("Sponsors");
caption.setStyle("font-weight: bold;");
div.appendChild(caption);
separator = new Separator();
separator.setBar(true);
separator.setParent(div);
Vbox content = new Vbox();
content.setWidth("100%");
content.setParent(div);
link = new ToolBarButton();
link = new ToolBarButton();
link.setLabel("eEvolution");
link.setHref("http://www.eevolution.com/");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Adaxa");
link.setHref("http://www.adaxa.com/");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Westfalia IT");
link.setHref("http://www.westfalia-it.com");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Walkingtree ");
link.setHref("http://www.walkingtree.in");
link.setTarget("_blank");
link.setParent(content);
link.setLabel("Sysnova");
link.setHref("http://www.sysnova.com/");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Idalica");
link.setHref("http://www.idalica.com/");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("ERPCyA");
link.setHref("http://www.erpcya.com/");
link.setTarget("_blank");
link.setParent(content);
separator = new Separator();
separator.setParent(vbox);
div = new Div();
div.setParent(vbox);
div.setWidth("100%");
caption = new Label("Contributors");
caption.setStyle("font-weight: bold;");
div.appendChild(caption);
separator = new Separator();
separator.setBar(true);
separator.setParent(div);
content = new Vbox();
content.setWidth("100%");
content.setParent(div);
link = new ToolBarButton();
link.setLabel("Victor PĂ©rez");
link.setHref("http://wiki.adempiere.net/User:vpj-cd");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Paul Bowden");
link.setHref("http://wiki.adempiere.net/User:Phib");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Michael McKay");
link.setHref("http://wiki.adempiere.net/User:MJMcKay");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Mario Calderon");
link.setHref("http://wiki.adempiere.net/User:mar_cal_westf");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Ashley G Ramdass");
link.setHref("http://wiki.adempiere.net/User:Agramdass");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Low Heng Sin");
link.setHref("http://wiki.adempiere.net/User:Hengsin");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Carlos Ruiz");
link.setHref("http://wiki.adempiere.net/User:CarlosRuiz");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Teo Sarca");
link.setHref("http://wiki.adempiere.net/User:Teo_sarca");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Trifon Trifonov");
link.setHref("http://wiki.adempiere.net/User:Trifonnt");
link.setTarget("_blank");
link.setParent(content);
link = new ToolBarButton();
link.setLabel("Yamel Senih");
link.setHref("http://wiki.adempiere.net/User:Yamel_Senih");
link.setTarget("_blank");
link.setParent(content);
return tabPanel;
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class InfoCashLinePanel method statInit.
// InfoCashLinePanel
/**
* Static Setup - add fields to parameterPanel
* @throws Exception if Lookups cannot be created
*/
private void statInit() {
// Format the dates and number boxes
fDateFrom.setWidth("97px");
fDateTo.setWidth("97px");
fAmtFrom.getDecimalbox().setWidth("90px");
fAmtTo.getDecimalbox().setWidth("90px");
fDateFrom.setAttribute("zk_component_ID", "Lookup_Criteria_DateFrom");
fDateFrom.addEventListener(Events.ON_CHANGE, this);
fDateTo.setAttribute("zk_component_ID", "Lookup_Criteria_DateTo");
fDateTo.addEventListener(Events.ON_CHANGE, this);
fAmtFrom.setAttribute("zk_component_ID", "Lookup_Criteria_AmtFrom");
fAmtFrom.addEventListener(Events.ON_CHANGE, this);
fAmtTo.setAttribute("zk_component_ID", "Lookup_Criteria_AmtTo");
fAmtTo.addEventListener(Events.ON_CHANGE, this);
SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.Date, AEnv.getLanguage(Env.getCtx()));
fDateFrom.setFormat(dateFormat.toPattern());
fDateTo.setFormat(dateFormat.toPattern());
DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
fAmtFrom.getDecimalbox().setFormat(format.toPattern());
fAmtFrom.getDecimalbox().setStyle("text-align:right; " + fAmtFrom.getDecimalbox().getStyle());
fAmtTo.getDecimalbox().setFormat(format.toPattern());
fAmtTo.getDecimalbox().setStyle("text-align:right; " + fAmtTo.getDecimalbox().getStyle());
// Create the main criteria fields
// 5241 - C_Cash.C_Cash_ID
fCash_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, p_TabNo, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_Cash_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Cash_ID"), "", false, false, true);
fCash_ID.addValueChangeListener(this);
fCash_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Cash_ID");
// 5249 - C_Cash.C_CashBook_ID
fCashBook_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_CashBook_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_CashBook_ID"), "", false, false, true);
fCashBook_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
//fCashBook_ID.addValueChangeListener(this);
fCashBook_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_CashBook_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fCashBook_ID.getComponent().setWidth("100%");
// 5354 - C_CashLine.C_Invoice_ID
fInvoice_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Invoice_ID), DisplayType.Search), Msg.translate(Env.getCtx(), "C_Invoice_ID"), "", false, false, true);
fInvoice_ID.addValueChangeListener(this);
fInvoice_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Invoice_ID");
// 5296 - C_CashLine.C_Charge_ID
fPayment_ID = new WSearchEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Payment_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Payment_ID"), "", false, false, true);
fPayment_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Payment_ID");
// 5295 - C_CashLine.C_BankAccount_ID
fBankAccount_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_BankAccount_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_BankAccount_ID"), "", false, false, true);
fBankAccount_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
//fBankAccount_ID.addValueChangeListener(this);
fBankAccount_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fBankAccount_ID.getComponent().setWidth("100%");
// 5296 - C_CashLine.C_Charge_ID
fCharge_ID = new WTableDirEditor(MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Charge_ID), DisplayType.TableDir), Msg.translate(Env.getCtx(), "C_Charge_ID"), "", false, false, true);
fCharge_ID.getComponent().addEventListener(Events.ON_CHANGE, this);
fCharge_ID.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_Charge_ID");
// Width is set in WTableDirEditor to 200px. Make it more flexible;
fCharge_ID.getComponent().setWidth("100%");
cbAbsolute.setLabel(Msg.translate(Env.getCtx(), "AbsoluteAmt"));
cbAbsolute.addEventListener(Events.ON_CHECK, this);
cbAbsolute.setAttribute("zk_component_ID", "Lookup_Criteria_AbsoluteAmt");
// Setup the criteria. The rest of the panel is managed by the info.java class
Rows rows = new Rows();
Row row = new Row();
rows.appendChild(row);
row.appendChild(fCashBook_ID.getLabel().rightAlign());
row.appendChild(fCashBook_ID.getComponent());
row.appendChild(fCash_ID.getLabel().rightAlign());
row.appendChild(fCash_ID.getComponent());
row = new Row();
rows.appendChild(row);
row.appendChild(fInvoice_ID.getLabel().rightAlign());
row.appendChild(fInvoice_ID.getComponent());
row.appendChild(fPayment_ID.getLabel().rightAlign());
row.appendChild(fPayment_ID.getComponent());
row = new Row();
//row.setSpans("1, 1, 1, 1");
rows.appendChild(row);
row.appendChild(fBankAccount_ID.getLabel().rightAlign());
row.appendChild(fBankAccount_ID.getComponent());
row.appendChild(lDateFrom.rightAlign());
Hbox hbox = new Hbox();
hbox.appendChild(fDateFrom);
hbox.appendChild(lDateTo);
hbox.appendChild(fDateTo);
row.appendChild(hbox);
row = new Row();
//row.setSpans("1, 1, 1, 1");
rows.appendChild(row);
row.appendChild(fCharge_ID.getLabel().rightAlign());
row.appendChild(fCharge_ID.getComponent());
row.appendChild(lAmtFrom.rightAlign());
hbox = new Hbox();
hbox.appendChild(fAmtFrom);
hbox.appendChild(lAmtTo);
hbox.appendChild(fAmtTo);
hbox.appendChild(cbAbsolute);
row.appendChild(hbox);
p_criteriaGrid.appendChild(rows);
super.setSizes();
}
Aggregations