use of org.zkoss.zul.Separator in project adempiere by adempiere.
the class InfoPanel method init.
protected void init() {
ThemeUtils.addSclass("ad-infopanel", this);
if (isModal()) {
setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
setWidth(p_width + "px");
setHeight(p_height + "px");
setContentStyle("overflow: auto");
setSizable(true);
setMaximizable(true);
ThemeUtils.addSclass("ad-infopanel-modal", this);
} else {
setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
// setBorder("none");
// setWidth("100%");
// setHeight("100%");
// setStyle("position: absolute");
ThemeUtils.addSclass("ad-infopanel-embedded", this);
}
// Elaine 2008/12/16
confirmPanel = new ConfirmPanel(true, true, false, true, true, true);
confirmPanel.addActionListener(Events.ON_CLICK, this);
// Elaine 2008/12/16
confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setVisible(hasCustomize());
confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory());
confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom());
confirmPanel.getButton(ConfirmPanel.A_OK).setVisible(p_saveResults);
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setTooltip(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Confirm_checkAutoQuery");
checkAutoQuery.addActionListener(this);
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(checkAutoQuery, confirmPanel.getButton(ConfirmPanel.A_REFRESH));
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(new Separator("vertical"), confirmPanel.getButton(ConfirmPanel.A_REFRESH));
//
statusBar.setEastVisibility(false);
statusBar.setAttribute("zk_component_ID", "info_statusBar");
//
p_southLayout.setVflex("min");
Center center = new Center();
center.appendChild(confirmPanel);
p_southLayout.appendChild(center);
South south = new South();
south.appendChild(statusBar);
p_southLayout.appendChild(south);
//
// Reset button
bReset = confirmPanel.createButton(ConfirmPanel.A_RESET);
bReset.addActionListener(this);
lblReset = new Label();
lblReset.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Reset")));
p_table.setOddRowSclass(null);
p_table.setAttribute("zk_component_ID", "Lookup_Data_SearchResults");
p_table.setVflex(true);
// Sizes
p_centerNorth.setVflex("min");
p_centerCenter.setVflex("1");
p_centerSouth.setHeight("25%");
//
ThemeUtils.addSclass("info-panel-center", p_centerLayout);
// May be empty
p_centerLayout.appendChild(p_centerNorth);
// the table
p_centerLayout.appendChild(p_centerCenter);
// detail tabs or other
p_centerLayout.appendChild(p_centerSouth);
//
// Need to use a container for p_table so we can insert paging if required.
Div div = new Div();
div.appendChild(p_table);
div.setVflex("1");
div.setHflex("1");
p_centerCenter.appendChild(div);
p_centerCenter.setAutoscroll(false);
p_centerCenter.setHflex("1");
//
p_centerSouth.setCollapsible(true);
p_centerSouth.setSplittable(true);
p_centerSouth.setHflex("1");
// Setup the north reset button and criteria grid
West spWest = new West();
spWest.setHflex("min");
ThemeUtils.addSclass("criteria", spWest);
Center spCenter = new Center();
//spCenter.setWidth("100%");
spCenter.setHflex("1");
spCenter.setVflex("min");
ThemeUtils.addSclass("criteria", spCenter);
p_northLayout.setHflex("min");
p_northLayout.setVflex("min");
p_northLayout.appendChild(spWest);
p_northLayout.appendChild(spCenter);
// spWest - the reset button
Grid bGrid = GridFactory.newGridLayout();
bGrid.setSizedByContent(true);
Columns bColumns = new Columns();
Column col = new Column();
col.setHflex("min");
bColumns.appendChild(col);
bGrid.appendChild(bColumns);
Rows bRows = new Rows();
Row bRow = new Row();
bGrid.appendChild(bRows);
bRows.appendChild(bRow);
bRow.appendChild(bReset);
bRow = new Row();
bRows.appendChild(bRow);
bRow.appendChild(lblReset);
spWest.appendChild(bGrid);
// The criteria table
//p_criteriaGrid.setSizedByContent(true);
spCenter.appendChild(p_criteriaGrid);
Borderlayout mainPanel = new Borderlayout();
mainPanel.setWidth("100%");
mainPanel.setHeight("100%");
//
North north = new North();
mainPanel.appendChild(north);
north.appendChild(p_northLayout);
//
center = new Center();
mainPanel.appendChild(center);
center.appendChild(p_centerLayout);
//
south = new South();
mainPanel.appendChild(south);
south.appendChild(p_southLayout);
//
if (!isModal()) {
mainPanel.setStyle("position: absolute");
}
this.appendChild(mainPanel);
this.addEventListener(Events.ON_OK, this);
this.setVisible(true);
}
use of org.zkoss.zul.Separator in project adempiere by adempiere.
the class InfoPAttributePanel method addAttributes.
// dynInit
/**
* Add Attributes
* @return rows
*/
private int addAttributes() {
PreparedStatement pstmt = null;
ResultSet rs = null;
String whereAttributeSet;
if (p_M_AttributeSet_ID > 0)
whereAttributeSet = "AND M_Attribute_ID IN (SELECT M_Attribute_ID FROM M_AttributeUse WHERE M_AttributeSet_ID=" + p_M_AttributeSet_ID + ")";
else
whereAttributeSet = "";
String sql = MRole.getDefault().addAccessSQL("SELECT M_Attribute_ID, Name, Description, AttributeValueType, IsInstanceAttribute " + "FROM M_Attribute " + "WHERE IsActive='Y' " + whereAttributeSet + " ORDER BY IsInstanceAttribute, Name", "M_Attribute", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
boolean instanceLine = false;
boolean productLine = false;
try {
pstmt = DB.prepareStatement(sql, null);
rs = pstmt.executeQuery();
while (rs.next()) {
int attribute_ID = rs.getInt(1);
String name = rs.getString(2);
String description = rs.getString(3);
String attributeValueType = rs.getString(4);
boolean isInstanceAttribute = "Y".equals(rs.getString(5));
// Add label for product attributes if there are any
if (!productLine && !isInstanceAttribute) {
Row row = new Row();
rows.appendChild(row);
row.setSpans("2");
Label group = new Label(Msg.translate(Env.getCtx(), "IsProductAttribute"));
row.appendChild(group);
rows.appendChild(row);
row = new Row();
rows.appendChild(row);
row.setSpans("2");
Separator separator = new Separator();
separator.setBar(true);
row.appendChild(separator);
rows.appendChild(row);
productLine = true;
}
// Add label for Instances attributes
if (!instanceLine && isInstanceAttribute) {
Row row = new Row();
rows.appendChild(row);
row.setSpans("2");
Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
row.appendChild(group);
rows.appendChild(row);
row = new Row();
rows.appendChild(row);
row.setSpans("2");
Separator separator = new Separator();
separator.setBar(true);
row.appendChild(separator);
rows.appendChild(row);
instanceLine = true;
}
//
Row row = new Row();
rows.appendChild(row);
Label label = new Label(name);
if (description != null && description.length() > 0)
label.setTooltiptext(description);
Div div = new Div();
div.setAlign("right");
div.appendChild(label);
row.appendChild(div);
Component field = null;
if (MAttribute.ATTRIBUTEVALUETYPE_List.equals(attributeValueType)) {
field = new Listbox();
((Listbox) field).setRows(0);
((Listbox) field).setMultiple(false);
((Listbox) field).setMold("select");
((Listbox) field).setWidth("150px");
KeyNamePair[] knp = getAttributeList(attribute_ID);
for (int i = 0; i < knp.length; i++) ((Listbox) field).appendItem(knp[i].getName(), knp[i]);
} else if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
field = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
((NumberBox) field).setWidth("150px");
} else {
field = new WStringEditor(name, false, false, true, 10, 40, null, null).getComponent();
((Textbox) field).setWidth("150px");
}
row.appendChild(field);
//
field.setId(String.valueOf(attribute_ID));
// If name is null, replace it with "_"
if (name.equals("")) {
name = "_";
}
field.setAttribute("zk_component_ID", "InfoPAttributePanel_field_" + name.replaceAll("[^a-zA-Z0-9_]", "_"));
//
if (isInstanceAttribute)
m_instanceEditors.add(field);
else
m_productEditors.add(field);
// To (numbers)
Component fieldTo = null;
if (MAttribute.ATTRIBUTEVALUETYPE_Number.equals(attributeValueType)) {
fieldTo = new WNumberEditor(name, false, false, true, DisplayType.Number, name).getComponent();
((NumberBox) fieldTo).setWidth("150px");
row = new Row();
rows.appendChild(row);
div = new Div();
div.setAlign("right");
div.appendChild(new Label("-"));
row.appendChild(div);
row.appendChild(fieldTo);
}
if (fieldTo != null)
fieldTo.setAttribute("zk_component_ID", "InfoPAttributePanel_fieldTo_" + name);
if (isInstanceAttribute)
m_instanceEditorsTo.add(fieldTo);
else
m_productEditorsTo.add(fieldTo);
}
} catch (Exception e) {
log.log(Level.SEVERE, sql, e);
} finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
// print instance line if not printed
if (!instanceLine) {
boolean isGuarantee = true;
boolean isSerial = true;
boolean isLot = true;
if (p_M_AttributeSet_ID > 0) {
MAttributeSet as = new MAttributeSet(Env.getCtx(), p_M_AttributeSet_ID, null);
isGuarantee = as.isGuaranteeDate();
isSerial = as.isSerNo();
isLot = as.isLot();
}
if (isGuarantee || isSerial || isLot) {
Row row = new Row();
rows.appendChild(row);
row.setSpans("2");
Label group = new Label(Msg.translate(Env.getCtx(), "IsInstanceAttribute"));
row.appendChild(group);
rows.appendChild(row);
row = new Row();
rows.appendChild(row);
row.setSpans("2");
Separator separator = new Separator();
separator.setBar(true);
row.appendChild(separator);
rows.appendChild(row);
instanceLine = true;
}
}
return 0;
}
use of org.zkoss.zul.Separator in project adempiere by adempiere.
the class WBOMDrop method createMainPanel.
// getInvoices
/**************************************************************************
* Create Main Panel.
* Called when changing Product
*/
private void createMainPanel() {
log.config(": " + m_product);
this.getChildren().clear();
//this.invalidate();
//this.setBorder(null);
m_selectionList.clear();
m_productList.clear();
m_qtyList.clear();
m_buttonGroups.clear();
this.appendChild(new Separator());
this.appendChild(grpSelectionPanel);
this.appendChild(new Separator());
this.appendChild(grpSelectProd);
this.appendChild(new Separator());
this.appendChild(confirmPanel);
this.appendChild(new Separator());
this.setBorder("normal");
Caption title = new Caption(Msg.getMsg(Env.getCtx(), "SelectProduct"));
grpSelectProd.getChildren().clear();
grpSelectProd.appendChild(title);
if (m_product != null && m_product.get_ID() > 0) {
title.setLabel(m_product.getName());
if (m_product.getDescription() != null && m_product.getDescription().length() > 0)
//this.setsetToolTipText(m_product.getDescription());
;
m_bomLine = 0;
addBOMLines(m_product, m_qty);
}
}
use of org.zkoss.zul.Separator in project adempiere by adempiere.
the class WBOMDrop method addBOMLines.
// createMainPanel
/**
* Add BOM Lines to this.
* Called recursively
* @param product product
* @param qty quantity
*/
private void addBOMLines(MProduct product, BigDecimal qty) {
MProductBOM[] bomLines = MProductBOM.getBOMLines(product);
for (int i = 0; i < bomLines.length; i++) {
grpSelectProd.appendChild(new Separator());
addBOMLine(bomLines[i], qty);
grpSelectProd.appendChild(new Separator());
}
log.fine("#" + bomLines.length);
}
use of org.zkoss.zul.Separator in project adempiere by adempiere.
the class WCharge method createNewChargePanel.
/**
* Creates the New Charge panel.
*
* The New Charge panel is used to specify the name and key of an account
* and whether or not the account is a charge account.
*/
private void createNewChargePanel() {
final int nameFieldColumns = 20;
final int valueFieldColumns = 10;
// top row
m_lblValue.setValue(Msg.translate(Env.getCtx(), EColumn.VALUE.title()));
m_txbValueField.setCols(valueFieldColumns);
m_chbIsExpense.setChecked(true);
m_chbIsExpense.setLabel(Msg.getMsg(Env.getCtx(), EColumn.EXPENSE.title()));
// bottom row
m_lblName.setValue(Msg.translate(Env.getCtx(), EColumn.NAME.title()));
m_txbNameField.setCols(nameFieldColumns);
m_btnNew.setLabel(Msg.getMsg(Env.getCtx(), AD_MESSAGE_CREATE) + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));
m_btnNew.addEventListener(Events.ON_CLICK, this);
Rows rows = new Rows();
m_grdNew.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
row.setSpans("3");
Label label = new Label(Msg.getMsg(Env.getCtx(), "ChargeNewAccount"));
label.setStyle("font-weight: bold;");
row.appendChild(label);
row = new Row();
rows.appendChild(row);
row.appendChild(m_lblValue);
row.appendChild(m_txbValueField);
row.appendChild(m_chbIsExpense);
row = new Row();
rows.appendChild(row);
row.appendChild(m_lblName);
row.appendChild(m_txbNameField);
row.appendChild(m_btnNew);
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
return;
}
Aggregations