use of org.compiere.model.MProductBOM in project adempiere by adempiere.
the class myJTree method action_reloadBOM.
// action_fillTree
private void action_reloadBOM() {
//m_frame.setBusy(true);
m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
reload = true;
//int M_Product_ID = getM_Product_ID();
int M_Product_ID = m_selected_id;
if (M_Product_ID == 0)
return;
MProduct M_Product = MProduct.get(getCtx(), M_Product_ID);
treeInfo.setText(" Current Selection: " + M_Product.getValue());
Vector<Object> line = new Vector<Object>(17);
// 0 Select
line.add(new Boolean(false));
// 1 IsActive
line.add(new Boolean(M_Product.isActive()));
// 2 Line
line.add(new Integer(0));
KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(), M_Product.getValue().concat("_").concat(M_Product.getName()));
// 3 M_Product_ID
line.add(pp);
MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName());
KeyNamePair uom = new KeyNamePair(M_Product.getC_UOM_ID(), u.getUOMSymbol());
// 4 C_UOM_ID
line.add(uom);
// 5 QtyBOM
line.add(Env.ONE);
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(line);
dataBOM.clear();
if (isImplosion()) {
for (MProductBOM bomline : getParentBOMs(M_Product_ID)) {
addParent(bomline, parent);
}
//m_tree = new myJTree(parent);
} else {
/* m_childEn = m_selectedNode.children();
Vector<Object> line = new Vector<Object>(17);
while (m_childEn != null && m_childEn.hasMoreElements())
{
DefaultMutableTreeNode nd = (DefaultMutableTreeNode)m_childEn.nextElement();
//String[] uo = (String[])nd.getUserObject();
line.add(nd.getUserObject());
dataBOM.add( line);
}
*/
for (MProductBOM bom : getChildBOMs(M_Product_ID, true)) {
addChild(bom, parent);
}
//m_tree = new myJTree(parent);
}
//m_tree.addTreeSelectionListener(this);
//treePane.getViewport().add (m_tree, null);
loadTableBOM();
//m_frame.setBusy(false);
m_frame.setCursor(Cursor.getDefaultCursor());
}
Aggregations