use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WPOS method setMPOS.
// dynInit
/**
* Set MPOS
* @return true if found/set
*/
private void setMPOS() {
int salesRep_ID = Env.getAD_User_ID(getCtx());
setPOS(salesRep_ID);
if (getM_POS() != null) {
validLocator();
return;
}
int orgId = Env.getAD_Org_ID(getCtx());
poss = getPOSByOrganization(orgId);
// Select POS
String msg = Msg.getMsg(ctx, "SelectPOS");
selection = new Window();
Panel mainPanel = new Panel();
Panel panel = new Panel();
selection.setTitle(msg);
Borderlayout mainLayout = new Borderlayout();
Grid layout = GridFactory.newGridLayout();
selection.appendChild(panel);
selection.setWidth("200px");
selection.setHeight("140px");
// North
Panel centerPanel = new Panel();
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
//
Center center = new Center();
center.setStyle("border: none");
mainLayout.appendChild(center);
center.appendChild(centerPanel);
centerPanel.appendChild(layout);
layout.setWidth("100%");
layout.setHeight("100%");
selection.appendChild(mainPanel);
Rows rows = null;
Row row = null;
rows = layout.newRows();
row = rows.newRow();
for (MPOS pos : poss) {
listTerminal.addItem(pos.getKeyNamePair());
}
okButton.addActionListener(this);
cancelButton.addEventListener("onClick", this);
okButton.setWidth("45px");
okButton.setHeight("45px");
cancelButton.setWidth("45px");
cancelButton.setHeight("45px");
listTerminal.setHeight("45px");
listTerminal.setStyle("height:45px;" + WPOS.FONTSIZEMEDIUM);
row.setSpans("2");
row.appendChild(listTerminal);
row.setHeight("45px");
row = rows.newRow();
confirm = new ConfirmPanel(true);
confirm.addActionListener(this);
confirm.getOKButton().setWidth("55px");
confirm.getOKButton().setHeight("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
row.appendChild(confirm);
row.setHeight("55px");
AEnv.showWindow(selection);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WPOSKeyboard method init.
/**
* Initialize
* @param startText
* @param POSKeyLayout_ID
*/
public void init(int POSKeyLayout_ID) {
Panel panel = new Panel();
appendChild(panel);
// Content
Panel mainPanel = new Panel();
Borderlayout mainLayout = new Borderlayout();
Grid productLayout = GridFactory.newGridLayout();
appendChild(panel);
// North
Panel northPanel = new Panel();
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
Center center = new Center();
//
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(northPanel);
northPanel.appendChild(productLayout);
productLayout.setWidth("100%");
appendChild(mainPanel);
Rows rows = null;
Row row = null;
rows = productLayout.newRows();
row = rows.newRow();
String txtCalcId = txtCalc.getId();
row.appendChild(txtCalc);
txtCalc.setName("number");
txtCalc.setWidth("92%");
WPOSKeyPanel keys = new WPOSKeyPanel(POSKeyLayout_ID, this, txtCalcId, keyBoardType);
center = new Center();
center.setStyle("border: none");
keys.setWidth("100%");
keys.setHeight("99%");
center.appendChild(keys);
mainLayout.appendChild(center);
South south = new South();
ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false);
confirm.addActionListener(this);
south.appendChild(confirm);
mainLayout.appendChild(south);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WPOSUserPinDialog method showDialog.
private void showDialog(WPOS pos) {
passwordField = new WPOSTextField("", pos.getKeyboard());
passwordField.setStyle("Font-size:medium; font-weight:bold");
passwordField.addEventListener(this);
passwordField.addEventListener(Events.ON_OK, this);
passwordField.setType("password");
Panel mainPanel = new Panel();
this.setWidth("200px");
this.setHeight("100px");
b_ok.addActionListener(pos);
b_ok.addEventListener(Events.ON_OK, pos);
b_cancel.addActionListener(pos);
Borderlayout mainLayout = new Borderlayout();
Grid layout = GridFactory.newGridLayout();
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
Panel centerPanel = new Panel();
Center center = new Center();
center.setStyle("border: none");
mainLayout.appendChild(center);
center.appendChild(centerPanel);
centerPanel.appendChild(layout);
layout.setWidth("100%");
layout.setHeight("100%");
this.appendChild(mainPanel);
Rows rows = null;
Row row = null;
rows = layout.newRows();
row = rows.newRow();
Label msg = new Label(Msg.parseTranslation(pos.getCtx(), "@UserPIN@"));
row.appendChild(msg);
row = rows.newRow();
row.appendChild(passwordField);
row.setSpans("2");
row = rows.newRow();
row.appendChild(b_ok);
row.appendChild(b_cancel);
b_ok.addActionListener(this);
b_cancel.addActionListener(this);
AEnv.showWindow(this);
pos.validateAndSetUserPin(returnValue);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WPOSQuantityPanel method init.
@Override
protected void init() {
Grid LayoutButton = GridFactory.newGridLayout();
Rows rows = null;
Row row = null;
parameterPanel = new Panel();
parameterPanel.appendChild(LayoutButton);
LayoutButton.setWidth("100%");
LayoutButton.setHeight("100%");
rows = LayoutButton.newRows();
row = rows.newRow();
row.setHeight("55px");
buttonDelete = createButtonAction("Cancel", "Ctrl+F3");
buttonDelete.setTooltiptext("Ctrl+F3-" + Msg.translate(ctx, "DeleteLine"));
buttonDelete.addActionListener(this);
row.appendChild(buttonDelete);
buttonPlus = createButtonAction("Plus", "Ctrl+1");
buttonPlus.setTooltiptext("Ctrl+0-" + Msg.translate(ctx, "add"));
row.appendChild(buttonPlus);
buttonMinus = createButtonAction("Minus", "Ctrl+0");
row.appendChild(buttonMinus);
buttonUp = createButtonAction(ACTION_UP, "Alt+Up");
buttonUp.setTooltiptext("Alt+Up-" + Msg.translate(ctx, "Previous"));
row.appendChild(buttonUp);
buttonDown = createButtonAction(ACTION_DOWN, "Alt+Down");
buttonDown.setTooltiptext("Alt+Down-" + Msg.translate(ctx, "Next"));
row.appendChild(buttonDown);
if (posPanel.isPresentElectronicScales()) {
buttonScales = createButtonAction("Calculator", "Ctrl+W");
buttonScales.setTooltiptext("ALT+down-" + Msg.translate(ctx, "Calculator"));
row.appendChild(buttonScales);
// buttonScales.addActionListener(posPanel.getScalesListener());
}
Label qtyLabel = new Label(Msg.translate(Env.getCtx(), "QtyOrdered"));
row.appendChild(qtyLabel);
fieldQuantity = new POSNumberBox(false);
row.appendChild(fieldQuantity);
fieldQuantity.addEventListener(Events.ON_OK, this);
fieldQuantity.addEventListener(Events.ON_CHANGE, this);
fieldQuantity.setStyle("display: inline;width:65px;height:30px;Font-size:medium;");
Label priceLabel = new Label(Msg.translate(Env.getCtx(), "PriceActual"));
row.appendChild(priceLabel);
fieldPrice = new POSNumberBox(false);
DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount, AEnv.getLanguage(Env.getCtx()));
fieldPrice.getDecimalbox().setFormat(format.toPattern());
fieldPrice.setTooltiptext(Msg.translate(Env.getCtx(), "PriceActual"));
row.appendChild(fieldPrice);
if (!posPanel.isModifyPrice())
fieldPrice.setEnabled(false);
else {
fieldPrice.addEventListener(Events.ON_OK, this);
fieldPrice.addEventListener(Events.ON_CHANGE, this);
}
fieldPrice.setStyle("display: inline;width:70px;height:30px;Font-size:medium;");
Label priceDiscount = new Label(Msg.translate(Env.getCtx(), "Discount"));
row.appendChild(priceDiscount);
fieldDiscountPercentage = new POSNumberBox(false);
row.appendChild(fieldDiscountPercentage);
fieldDiscountPercentage.setTooltiptext(Msg.translate(Env.getCtx(), "Discount"));
if (!posPanel.isModifyPrice())
fieldDiscountPercentage.setEnabled(false);
else {
fieldDiscountPercentage.addEventListener(Events.ON_OK, this);
fieldDiscountPercentage.addEventListener(Events.ON_CHANGE, this);
}
fieldDiscountPercentage.setStyle("display: inline;width:70px;height:30px;Font-size:medium;");
Keylistener keyListener = new Keylistener();
fieldPrice.appendChild(keyListener);
keyListener.setCtrlKeys("@#up@#down^#f3^1^0");
keyListener.addEventListener(Events.ON_CTRL_KEY, posPanel);
keyListener.addEventListener(Events.ON_CTRL_KEY, this);
keyListener.setAutoBlur(false);
changeStatus(false);
}
use of org.adempiere.webui.component.Row in project adempiere by adempiere.
the class WPaySelect method zkInit.
// init
/**
* Static Init
* @throws Exception
*/
private void zkInit() throws Exception {
//
form.appendChild(mainPanel);
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("99%");
parameterPanel.appendChild(parameterLayout);
//
labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
fieldBankAccount.addActionListener(this);
fieldBankAccount.setAttribute("zk_component_ID", "Lookup_Criteria_C_BankAccount_ID");
fieldBankAccount.setAttribute("zk_component_prefix", "Lookup_");
fieldBankAccount.setAttribute("IsDynamic", "False");
fieldBankAccount.setAttribute("fieldName", "fieldBankAccount");
fieldBankAccount.setWidth("200px");
//
labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
fieldBPartner.addValueChangeListener(this);
fieldBPartner.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_C_BPartner_ID");
fieldBPartner.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fieldBPartner.getComponent().setAttribute("IsDynamic", "False");
fieldBPartner.getComponent().setAttribute("fieldName", "fieldBPartner");
fieldBPartner.getComponent().setWidth("200px");
//
bRefresh.addActionListener(this);
//
labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
fieldPayDate.addValueChangeListener(this);
fieldPayDate.getComponent().setAttribute("zk_component_ID", "Lookup_Criteria_PayDate");
fieldPayDate.getComponent().setAttribute("zk_component_prefix", "Lookup_");
fieldPayDate.getComponent().setAttribute("IsDynamic", "False");
fieldPayDate.getComponent().setAttribute("fieldName", "fieldPayDate");
fieldPayDate.getComponent().setWidth("200px");
//
labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
fieldPaymentRule.addActionListener(this);
fieldPaymentRule.setAttribute("zk_component_ID", "Lookup_Criteria_PaymentRule");
fieldPaymentRule.setAttribute("zk_component_prefix", "Lookup_");
fieldPaymentRule.setAttribute("IsDynamic", "False");
fieldPaymentRule.setAttribute("fieldName", "fieldPaymentRule");
fieldPaymentRule.setWidth("200px");
//
labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
fieldDtype.addActionListener(this);
fieldDtype.setAttribute("zk_component_ID", "Lookup_Criteria_C_DocType_ID");
fieldDtype.setAttribute("zk_component_prefix", "Lookup_");
fieldDtype.setAttribute("IsDynamic", "False");
fieldDtype.setAttribute("fieldName", "fieldDtype");
//
labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
labelBalance.setText("0");
labelBalance.setAttribute("zk_component_ID", "Lookup_Criteria_CurrentBalance");
labelBalance.setAttribute("zk_component_prefix", "Lookup_");
labelBalance.setAttribute("IsDynamic", "False");
labelBalance.setAttribute("fieldName", "labelBalance");
//
onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue"));
onlyDue.addActionListener(this);
onlyDue.setAttribute("zk_component_ID", "Lookup_Criteria_OnlyDue");
onlyDue.setAttribute("fieldName", "onlyDue");
onlyDue.setName("OnlyDue");
onlyDue.setTooltiptext(Msg.getMsg(Env.getCtx(), "OnlyDue"));
//
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.addActionListener(this);
checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Criteria_AutoRefresh");
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
//
dataStatus.setText(" ");
dataStatus.setPre(true);
dataStatus.setAttribute("zk_component_ID", "Lookup_Criteria_DataStatus");
dataStatus.setAttribute("zk_component_prefix", "Lookup_");
dataStatus.setAttribute("IsDynamic", "False");
dataStatus.setAttribute("fieldName", "dataStatus");
//
bGenerate.addActionListener(this);
bCancel.addActionListener(this);
//
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
//
Rows rows = parameterLayout.newRows();
Row row = rows.newRow();
row.appendChild(labelBankAccount.rightAlign());
row.appendChild(fieldBankAccount);
row.appendChild(labelBankBalance.rightAlign());
Panel balancePanel = new Panel();
balancePanel.appendChild(labelCurrency);
balancePanel.appendChild(labelBalance);
row.appendChild(balancePanel);
row.appendChild(new Space());
//
row = rows.newRow();
row.appendChild(labelBPartner.rightAlign());
row.appendChild(fieldBPartner.getComponent());
row.appendChild(new Space());
row.appendChild(new Space());
row.appendChild(new Space());
//
row = rows.newRow();
row.appendChild(labelDtype.rightAlign());
row.appendChild(fieldDtype);
row.appendChild(labelPaymentRule.rightAlign());
row.appendChild(fieldPaymentRule);
row.appendChild(checkAutoQuery);
//
row = rows.newRow();
row.appendChild(labelPayDate.rightAlign());
row.appendChild(fieldPayDate.getComponent());
row.appendChild(new Space());
row.appendChild(onlyDue);
row.appendChild(bRefresh);
//
commandPanel.addButton(bGenerate);
commandPanel.getButton(ConfirmPanel.A_OK).setVisible(false);
//
southPanel = new Panel();
southPanel.appendChild(dataStatus);
southPanel.appendChild(new Separator());
southPanel.appendChild(commandPanel);
//
South south = new South();
south.setStyle("border: none");
mainLayout.appendChild(south);
south.appendChild(southPanel);
//
Center center = new Center();
mainLayout.appendChild(center);
center.appendChild(miniTable);
}
Aggregations