use of org.compiere.apps.ALayoutConstraint in project adempiere by adempiere.
the class VProductConfigurationBOM method createSelectionPanel.
/**************************************************************************
* Create Selection Panel
* @param order
* @param invoice
* @param project
*/
private void createSelectionPanel(boolean order, boolean invoice, boolean project) {
int row = 0;
selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection")));
productField = new CComboBox(getProducts());
CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
label.setLabelFor(productField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(productField);
productField.addActionListener(this);
// Qty
label = new CLabel(productQty.getTitle());
label.setLabelFor(productQty);
selectionPanel.add(label);
selectionPanel.add(productQty);
productQty.setValue(Env.ONE);
productQty.addActionListener(this);
if (order) {
orderField = new CComboBox(getOrders());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID"));
label.setLabelFor(orderField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(orderField);
orderField.addActionListener(this);
}
if (invoice) {
invoiceField = new CComboBox(getInvoices());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Invoice_ID"));
label.setLabelFor(invoiceField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(invoiceField);
invoiceField.addActionListener(this);
}
if (project) {
projectField = new CComboBox(getProjects());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Project_ID"));
label.setLabelFor(projectField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(projectField);
projectField.addActionListener(this);
}
// Enabled in ActionPerformed
confirmPanel.getOKButton().setEnabled(false);
// Size
Dimension size = selectionPanel.getPreferredSize();
size.width = WINDOW_WIDTH;
selectionPanel.setPreferredSize(size);
}
use of org.compiere.apps.ALayoutConstraint in project adempiere by adempiere.
the class VProductConfigurationBOM method addDisplay.
// addBOMLine
/**
* Add Line to Display
* @param parentM_Product_ID parent product
* @param M_Product_ID product
* @param bomType bom type
* @param name name
* @param lineQty qty
*/
private void addDisplay(int parentM_Product_ID, int M_Product_ID, String bomType, String name, BigDecimal lineQty, int PP_Product_BOM_ID, String M_Feature, int PP_Product_BOMLine_ID) {
log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty);
//
boolean selected = true;
if (MPPProductBOMLine.COMPONENTTYPE_Component.equals(bomType)) {
String title = "";
JCheckBox cb = new JCheckBox(title);
cb.setSelected(true);
cb.setEnabled(false);
m_selectionList.add(cb);
this.add(cb, new ALayoutConstraint(m_bomLine++, 0));
} else //FIXME: add different types for libero
if (MPPProductBOMLine.COMPONENTTYPE_Variant.equals(bomType)) {
String title = Msg.getMsg(Env.getCtx(), "Optional");
JCheckBox cb = new JCheckBox(title);
cb.setSelected(false);
selected = false;
cb.addActionListener(this);
m_selectionList.add(cb);
this.add(cb, new ALayoutConstraint(m_bomLine++, 0));
} else // Alternative
{
//String title = Msg.getMsg(Env.getCtx(), "Alternative") + " " + bomType;
String title = M_Feature;
JRadioButton b = new JRadioButton(title);
//String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType;
String groupName = String.valueOf(getProductFromMPPProductBOM(PP_Product_BOM_ID).get_ID()) + "_" + bomType;
ButtonGroup group = (ButtonGroup) m_buttonGroups.get(groupName);
if (group == null) {
log.fine("ButtonGroup=" + groupName);
group = new ButtonGroup();
m_buttonGroups.put(groupName, group);
group.add(b);
// select first one
b.setSelected(true);
} else {
group.add(b);
b.setSelected(false);
selected = false;
}
b.addActionListener(this);
m_selectionList.add(b);
this.add(b, new ALayoutConstraint(m_bomLine++, 0));
}
// Add to List & display
m_productList.add(new Integer(M_Product_ID));
m_bomLineIDList.add(new Integer(PP_Product_BOMLine_ID));
/*VNumber qty = new VNumber ("Qty", true, false, true, DisplayType.Quantity, name);
qty.setValue(lineQty);
qty.setReadWrite(selected);
m_qtyList.add(qty);
*/
CLabel label = new CLabel(name);
//label.setLabelFor(qty);
this.add(label);
//this.add(qty);
}
use of org.compiere.apps.ALayoutConstraint in project adempiere by adempiere.
the class VAttributeGrid method init.
/**
* Init
* @param WindowNo
* @param frame
*/
public void init(int WindowNo, FormFrame frame) {
m_WindowNo = WindowNo;
m_frame = frame;
// Layout
frame.getContentPane().add(this, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(tabbedPane, BorderLayout.CENTER);
this.add(confirmPanel, BorderLayout.SOUTH);
tabbedPane.addChangeListener(this);
confirmPanel.addActionListener(this);
//
tabbedPane.add(selectPanel, Msg.getMsg(Env.getCtx(), "Selection"));
selectPanel.add(attributeLabel1, new ALayoutConstraint(0, 0));
m_attributes = MAttribute.getOfClient(Env.getCtx(), true, true);
Vector<KeyNamePair> vector = new Vector<KeyNamePair>();
vector.add(new KeyNamePair(0, ""));
for (int i = 0; i < m_attributes.length; i++) vector.add(m_attributes[i].getKeyNamePair());
attributeCombo1 = new CComboBox(vector);
selectPanel.add(attributeCombo1, null);
selectPanel.add(attributeLabel2, new ALayoutConstraint(1, 0));
attributeCombo2 = new CComboBox(vector);
selectPanel.add(attributeCombo2, null);
//
fillPicks();
selectPanel.add(labelPriceList, new ALayoutConstraint(2, 0));
selectPanel.add(pickPriceList);
selectPanel.add(labelWarehouse, new ALayoutConstraint(3, 0));
selectPanel.add(pickWarehouse);
//
selectPanel.setPreferredSize(new Dimension(300, 200));
//
// Grid
tabbedPane.add(gridPanel, "AttributeGrid");
modePanel.add(modeLabel);
modePanel.add(modeCombo);
modeCombo.addActionListener(this);
}
use of org.compiere.apps.ALayoutConstraint in project adempiere by adempiere.
the class VBOMDrop method createSelectionPanel.
/**************************************************************************
* Create Selection Panel
* @param order
* @param invoice
* @param project
*/
private void createSelectionPanel(boolean order, boolean invoice, boolean project) {
int row = 0;
selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection")));
productField = new CComboBox(getProducts());
CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
label.setLabelFor(productField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(productField);
productField.addActionListener(this);
// Qty
label = new CLabel(productQty.getTitle());
label.setLabelFor(productQty);
selectionPanel.add(label);
selectionPanel.add(productQty);
productQty.setValue(Env.ONE);
productQty.addActionListener(this);
if (order) {
orderField = new CComboBox(getOrders());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID"));
label.setLabelFor(orderField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(orderField);
orderField.addActionListener(this);
}
if (invoice) {
invoiceField = new CComboBox(getInvoices());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Invoice_ID"));
label.setLabelFor(invoiceField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(invoiceField);
invoiceField.addActionListener(this);
}
if (project) {
projectField = new CComboBox(getProjects());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Project_ID"));
label.setLabelFor(projectField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(projectField);
projectField.addActionListener(this);
}
// Enabled in ActionPerformed
confirmPanel.getOKButton().setEnabled(false);
// Size
Dimension size = selectionPanel.getPreferredSize();
size.width = WINDOW_WIDTH;
selectionPanel.setPreferredSize(size);
}
Aggregations