use of org.zkoss.zkex.zul.North in project adempiere by adempiere.
the class WPOSInfoProduct method setValuesFromProduct.
/**
* setValuesFromProduct
* @param productId
* @param imageId
*/
public void setValuesFromProduct(int productId, BigDecimal quantity, int imageId, int priceListId, int partnerId) {
if (productId <= 0) {
initialValue();
return;
}
// Refresh Values
ProductInfo productInfo = new ProductInfo(productId, quantity, imageId, priceListId, partnerId);
labelPriceName.setText(Msg.parseTranslation(ctx, "@PriceStd@ , @PriceList@ ") + posPanel.getCurSymbol());
labelValue.setText(productInfo.value);
labelPrice.setText(posPanel.getNumberFormat().format(productInfo.priceStd));
labelPriceList.setText(posPanel.getNumberFormat().format(productInfo.priceList));
labelName.setText(productInfo.name);
labelUOMSymbol.setText(productInfo.uomSymbol);
labelProductCategory.setText(productInfo.productCategoryName);
labelProductTax.setText(productInfo.productTaxCategory);
labelDescription.setText(productInfo.description);
posPanel.updateProductPlaceholder(productInfo.name);
if (productInfo.imageData != null) {
North nt = new North();
Borderlayout mainLayout = new Borderlayout();
AImage img = null;
byte[] data = productInfo.imageData;
if (data != null && data.length > 0) {
try {
img = new AImage(null, data);
} catch (Exception e) {
}
}
Image bImg = new Image();
bImg.setContent(img);
bImg.setWidth("100%");
bImg.setHeight("100px");
nt.appendChild(bImg);
buttonImage.setClass("z-button");
mainLayout.appendChild(nt);
mainLayout.setStyle("background-color: transparent");
nt.setStyle("background-color: transparent");
buttonImage.getChildren().clear();
buttonImage.appendChild(mainLayout);
buttonImage.invalidate();
infoProductLayout.invalidate();
labelLayout.invalidate();
buttonPanel.invalidate();
} else {
buttonImage.getChildren().clear();
buttonImage.invalidate();
}
}
use of org.zkoss.zkex.zul.North 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.zkoss.zkex.zul.North in project adempiere by adempiere.
the class WDeleteEntity method zkInit.
private void zkInit() throws Exception {
//Form Init()
form.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
clientLabel.setText(Msg.getElement(Env.getCtx(), "AD_Client_ID"));
tableLabel.setText(Msg.getElement(Env.getCtx(), "AD_Table_ID"));
dryRun = new Checkbox(Msg.getMsg(Env.getCtx(), "DryRun"));
dryRun.setChecked(true);
ConfirmPanel panel = new ConfirmPanel(false, false, false, false, false, false, false);
bRefresh = panel.createButton(ConfirmPanel.A_REFRESH);
bRefresh.addActionListener(this);
//
parameterPanel.appendChild(parameterLayout);
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(parameterPanel);
Rows rows = null;
Row row = null;
parameterLayout.setWidth("100%");
rows = parameterLayout.newRows();
row = rows.newRow();
row.appendChild(clientLabel.rightAlign());
row.appendChild(clientPick);
row.appendChild(tableLabel.rightAlign());
row.appendChild(tablePick);
// For Button
row = rows.newRow();
row.appendChild(new Hbox());
row.appendChild(dryRun);
row.appendChild(new Hbox());
row.appendChild(bRefresh);
//
centerPanel.appendChild(centerLayout);
centerLayout.setWidth("100%");
Center center = new Center();
mainLayout.appendChild(center);
center.setStyle("border: none");
center.appendChild(centerPanel);
tree = new Tree();
treeCols = new Treecols();
treeCol = new Treecol("");
treeCol2 = new Treecol();
centerPanel.appendChild(tree);
treeCols.appendChild(treeCol);
treeCols.appendChild(treeCol2);
tree.appendChild(treeCols);
center.setFlex(true);
center.setAutoscroll(true);
South south = new South();
south.appendChild(southPanel);
southPanel.appendChild(southLayout);
southPanel.setWidth("100%");
mainLayout.appendChild(south);
Rows rows2 = southLayout.newRows();
Row south_row = rows2.newRow();
south_row.appendChild(confirmPanel);
confirmPanel.addActionListener(this);
}
use of org.zkoss.zkex.zul.North in project adempiere by adempiere.
the class FindWindow method initAdvanced.
/**
* initialise Advanced Tab
* @throws IOException
*
**/
private void initAdvanced() throws IOException {
ToolBarButton btnNew = new ToolBarButton();
btnNew.setImage("/images/New24.png");
btnNew.setAttribute("name", "btnNewAdv");
btnNew.addEventListener(Events.ON_CLICK, this);
ToolBarButton btnDelete = new ToolBarButton();
btnDelete.setAttribute("name", "btnDeleteAdv");
btnDelete.setImage("/images/Delete24.png");
btnDelete.addEventListener(Events.ON_CLICK, this);
ToolBarButton btnSave = new ToolBarButton();
btnSave.setAttribute("name", "btnSaveAdv");
btnSave.setImage("/images/Save24.png");
btnSave.addEventListener(Events.ON_CLICK, this);
fQueryName = new Combobox();
fQueryName.setTooltiptext(m_sToolTipText);
fQueryName.setReadonly(false);
fQueryName.addEventListener(Events.ON_FOCUS, this);
fQueryName.addEventListener(Events.ON_BLUR, this);
fQueryName.addEventListener(Events.ON_SELECT, this);
// Get from Action
WAppsAction action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
Button btnOk = action.getButton();
btnOk.setName("btnOkAdv");
btnOk.addEventListener(Events.ON_CLICK, this);
//
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");
ToolBar toolBar = new ToolBar();
toolBar.appendChild(btnNew);
toolBar.appendChild(btnDelete);
toolBar.appendChild(fQueryName);
toolBar.appendChild(btnSave);
toolBar.setWidth("100%");
fQueryName.setStyle("margin-left: 3px; margin-right: 3px; position: relative; top: 5px;");
btnSave.setDisabled(m_AD_Tab_ID <= 0);
Hbox confirmPanel = new Hbox();
confirmPanel.appendChild(pnlButtonRight);
confirmPanel.setWidth("100%");
advancedPanel = new Listbox();
ListHead listhead = new ListHead();
listhead.setSizable(true);
ListHeader lstHAndOr = new ListHeader();
lstHAndOr.setLabel(Msg.getMsg(Env.getCtx(), "And/Or"));
lstHAndOr.setWidth("40px");
ListHeader lstHLeftBracket = new ListHeader();
lstHLeftBracket.setLabel("(");
lstHLeftBracket.setWidth("20px");
ListHeader lstHColumn = new ListHeader();
lstHColumn.setLabel(Msg.translate(Env.getCtx(), "AD_Column_ID"));
lstHColumn.setWidth("100px");
ListHeader lstHOperator = new ListHeader();
lstHOperator.setLabel(Msg.getMsg(Env.getCtx(), "Operator"));
ListHeader lstHQueryValue = new ListHeader();
lstHQueryValue.setLabel(Msg.getMsg(Env.getCtx(), "QueryValue"));
lstHQueryValue.setWidth("170px");
ListHeader lstHQueryTo = new ListHeader();
lstHQueryTo.setLabel(Msg.getMsg(Env.getCtx(), "QueryValue2"));
lstHQueryTo.setWidth("170px");
ListHeader lstHRightBracket = new ListHeader();
lstHRightBracket.setLabel(")");
lstHRightBracket.setWidth("20px");
listhead.appendChild(lstHAndOr);
listhead.appendChild(lstHLeftBracket);
listhead.appendChild(lstHColumn);
listhead.appendChild(lstHOperator);
listhead.appendChild(lstHQueryValue);
listhead.appendChild(lstHQueryTo);
listhead.appendChild(lstHRightBracket);
advancedPanel.appendChild(listhead);
advancedPanel.setVflex(true);
Borderlayout layout = new Borderlayout();
layout.setStyle("height: 100%; width: 99%; position: relative;");
winAdvanced.appendChild(layout);
North north = new North();
layout.appendChild(north);
north.appendChild(toolBar);
Center center = new Center();
layout.appendChild(center);
center.appendChild(advancedPanel);
center.setFlex(true);
South south = new South();
layout.appendChild(south);
south.appendChild(confirmPanel);
winAdvanced.setHeight("100%");
winAdvanced.setWidth("100%");
winAdvanced.addEventListener(Events.ON_OK, this);
}
Aggregations